开发者

issues with Spree

开发者 https://www.devze.com 2023-02-07 05:43 出处:网络
I am tr开发者_C百科ying to install and run Spree on my local machine by following the steps mentioned in Getting started with Spree

I am tr开发者_C百科ying 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消