I am trying to install and run Spree on my local machine by following the steps mentioned in Getting started with Spree
However, when I start the server I get the following error:
Could not find table 'pages'
Can someone please help me out with this?
Solved the issue!
Generated the following generators:
spree_static_content and spree_product_assembly which did the magic!
Could not find table 'pages' means rails is not being able to find that table in the database.
In those instructions, review the section 'configuring the database' and then '4.6 Populating the Database'.
It sounds like you want to give spree a go, but don't have experience with Rails.
The spot where you are stuck is not something specific to spree, its a step required in setting up all rails projects referred to as database migration.
For what you need to know about migrations the official Rails Guides are great.
http://guides.rubyonrails.org/migrations.html
For a comprehensive intro to Rails which may also answer a few of your other questions, check out http://railstutorial.org/ruby-on-rails-tutorial-book
If you just want to try stuff.. the spree tute is on track
Do these steps again..
(If it generates an error, to a rake db:drop first to get rid of what you have already done)
rake db:create
rails g spree:site
rake spree:install
rake spree_sample:install
rake db:bootstrap
rake db:migrate
rake db:seed
rake db:sample
rake db:admin:create
Here is what I did to get Spree up and running:
Create a new rails project:
$ rails new spree_project
Add these 5 gems to the projects Gemfile (/spree_project/Gemfile):
gem 'spree', :git => 'git://github.com/spree/spree.git'
gem 'spree_auth_devise', :git => 'git://github.com/spree/spree_auth_devise'
gem 'spree_gateway', :git => 'git://github.com/spree/spree_gateway.git'
gem 'spree_usa_epay'
gem 'spree_skrill'
Run a bundle install and setup the database (rake db:bootstrap did not work for me)
$ bundle install
$ rake db:migrate
$ rake db:seed
$ bundle exec rake spree_sample:load
The 'pages' table is used by the spree_static_content gem. You can either remove the gem from your gemfile, or you can generate migrations for the static content gem:
rails generate spree_static_content:install
If you've included the 'spree_product_assembly' gem as well, you'll want to do the same for it:
rails generate spree_product_assembly:install
Then, reset the database (just to make sure)
rake db:bootstrap
rake db:admin:create
I ran into similar issues after trying the http://spreecommerce.com/documentation/getting_started.html instructions, but it seems to have created a nice demo app after taking these additional steps.
Related
im having this issue when i try to deploy my ruby on rails application to heroku, i check different posts here, because i saw this issue before but i couldnt fix it.
when i try to run:
$ heroku rake db:migrate
I get a lot of these ones: DEPRECATION WARNING:
and then:
rake aborted!
Please install the postgresql adapter: `gem install activerecord-postgresql-adapter` (pg is not part of the bundle. Add it to Gemfile.)
Tasks: TOP => db:migrate => db:load_config
(See full trace by running task with --trace)
I tried to change my Gemfile with 'pg' and my group :assets do to :production, i know im missing something but i could'nt figured out what.
Some ideas?
Also when I go to the app url, I get this:
Application Error
An error occurred in the application and your page could not be served. Please try again in a few moments.
If you are the application owner, check your logs for details.
Thanks in advance for any suggest and help!!!
You have to use Postgres on Heroku, you can't use sqlite3 because Heroku prohibits you from saving to the file system. So add the pg gem to your production bundle and re-deploy then your migrations should run.
Answer here is simple, add the following production in your gemfile as:
group :production do
gem 'pg'
end
Your local machine won't work with this production, so we now have to bundle it by ignoring PostgreSQL gem which can be done as:
bundle install --without production
After this, try heroku rake db:migrate. Must work.
Good luck
In rails 3.1 you can use the awesome rake task to copy in migrations as seen below from your engine.
rake my_engine:install:migrations
This normally works perfectly if i direct my Gemfile to the git repository or via :path.
However, if i just use the ruby gem directly
gem 'spud_admin'
my rake task disappears
Any ideas why this rake task disappears?
Well, I had a similar problem and managed to solve it thanks to jipiboily's comment. I have an engine called 'myEngine2' so I tried to call it like that:
rake myEngine2:install:migrations
but this failed. I than typed
bundle exec rake -T
there was a line:
rake my_engine2_engine:install:migrations # Copy migrations from
my_engine2_engine to application
I gave it a shot and it worked. Maybe it's the same problem in your case?
Issue was resolved. It had something to do with how jeweler had structured the gem environment. Switching to bundler and using rails plugin new seems to have resolved the issue.
I just updated refinerycms-news engine in my Gemfile from '~> 0.9.8' to :git => 'https://github.com/resolve/refinerycms-news.git', and now there is an error caused by a missing column. The migration to create the column can be found in the installed gem, but rake db:migrate does nothing. Is there another rake task or other step that will run it?
You'll have to follow this convention for Refinery CMS:
rails generate refinerycms_news
rake db:migrate
The generator copies only new migrations in and then rake db:migrate runs them.
Cheers,
Phil
I just cloned a github repo on a fresh Ubuntu machine, running sqlite3 for all environments. rake db:create says development.sqlite3 already exists. rake db:migrate says I'm missing a bunch of required gems and should run rake gems:install. rake gems:install, of course, says it Could not find table 'studies', which sounds to me like something rake db:migrate should fix.
I looked around the net and while lots of people have gotten 'could not find table' errors, they all got them from rake db:migrate, not rake gems:install. I'm suspecting it's an application-specific error, but still, any ideas would be appreciated.
PS: Ruby 1.8.7, Rails 2.3.8.
You can always install separate gems with gem install -r <gem name> or gem install -v=<gem version> -r <gem name> command, not using rake.
Is this a Rails 3 app? If so, you should run:
bundle install
Rails 3 uses Bundler instead of the rake tasks to manage gems. http://gembundler.com/
Did you try running with the trace option? Might help pin down the failing gem:
rake -t gems:install
I'm kinda new to this stuff, and I need some help please
I created my rails app using ruby 1.8.7/rails 2.3.8
I added Surveyor to the Gemfile.
I pushed the project to heroku.com using git, went through the normal
procedure in the "Quick Start" guide on heroku, including
$ heroku bundle install
$ heroku db:migrate
and all went through peacefully. But when I try to create a survey
using:
$ heroku rake surveyor FILE=surveys/kitchen_sink_survey.rb
I get the following error:
rake aborted!
uninitialized constant Surveyor
Can anyone help me with this please?
You will need to run rails generate surveyor:install before db:migrate
You need to also add the gem to your environment.rb
Rails::Initializer.run do |config|
config.gem "surveyor"
end