我是 Rails 的新手,想尝试 Spree Commerce,但在尝试安装 Spree 时遇到了一些问题,我一直在遵循Spree 安装指南。
当我尝试安装 Spree 时,出现以下错误:
C:\Users\Ross\Documents\eCommerce\Spree\test_spree_store>spree install
Would you like to install the default gateways? (yes/no) [yes] y
Would you like to install the default authentication system? (yes/no) [yes] y
Would you like to run the migrations? (yes/no) [yes] y
Would you like to load the seed data? (yes/no) [yes] y
Would you like to load the sample data? (yes/no) [yes] y
gemfile spree
gemfile spree_usa_epay
gemfile spree_skrill
gemfile spree_auth_devise
run bundle install from "."
←[31mYou passed :github as an option for gem 'spree_auth_devise', but it is invalid.←[0m
C:\Users\Ross\Documents\eCommerce\Spree\test_spree_store>
以下是我的应用程序 Gem 文件:
source 'https://rubygems.org'
gem 'rails', '3.2.9'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# To use Jbuilder templates for JSON
# gem 'jbuilder'
# Use unicorn as the app server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'debugger'
gem 'spree', '1.2.2'
gem 'spree_usa_epay'
gem 'spree_skrill'
gem 'spree_auth_devise', :github => 'spree/spree_auth_devise', :branch => '1-2-stable'
我尝试在spree install
不接受默认身份验证设置的情况下再次运行(注意,我首先从我的 gem 文件中删除了最后四行代码)。
C:\Users\Ross\Documents\eCommerce\Spree\spree_test>spree install
Would you like to install the default gateways? (yes/no) [yes] y
Would you like to install the default authentication system? (yes/no) [yes] n
What is the name of the class representing users within your application? [User] y
Would you like to run the migrations? (yes/no) [yes] y
Would you like to load the seed data? (yes/no) [yes] y
Would you like to load the sample data? (yes/no) [yes] y
gemfile spree
gemfile spree_usa_epay
gemfile spree_skrill
run bundle install from "."
create config/initializers/spree.rb
create config/spree.yml
remove public/index.html
append public/robots.txt
create app/assets/javascripts/store
create app/assets/javascripts/admin
create app/assets/stylesheets/store
create app/assets/stylesheets/admin
create app/assets/images/store
create app/assets/images/admin
create app/assets/javascripts/store/all.js
create app/assets/javascripts/admin/all.js
create app/assets/stylesheets/store/all.css
create app/assets/stylesheets/admin/all.css
create app/overrides
append config/environment.rb
append db/seeds.rb
copying migrations
creating database
running migrations
loading seed data
rake db:seed
rake aborted!
wrong constant name y
C:/Users/Ross/Documents/eCommerce/Spree/spree_test/config/environment.rb:5:in `<top (required)>'
Tasks: TOP => db:abort_if_pending_migrations => environment
(See full trace by running task with --trace)
loading sample data
insert config/routes.rb
**************************************************
We added the following line to your application's config/routes.rb file:
mount Spree::Core::Engine, :at => '/'
**************************************************
Spree has been installed successfully. You're all ready to go!
Enjoy!
即使耙子被中止,它似乎也能工作?但是,当我尝试运行服务器时,它不起作用并且出现以下错误:
C:\Users\Ross\Documents\eCommerce\Spree\spree_test>rails s
=> Booting WEBrick
=> Rails 3.2.9 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.9/lib/active_support/inflector/methods.rb:230:in `const_defined?': wrong constant name y (NameError)
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.9/lib/active_support/inflector/methods.rb:230:in `block in constantize'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.9/lib/active_support/inflector/methods.rb:229:in `each'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.9/lib/active_support/inflector/methods.rb:229:in `constantize'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.9/lib/active_support/core_ext/string/inflections.rb:54:in `constantize'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/spree_core-1.2.2/lib/spree/core.rb:53:in `user_class'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/spree_promo-1.2.2/app/models/spree/promotion/rules/user.rb:7:in `<class:User>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/spree_promo-1.2.2/app/models/spree/promotion/rules/user.rb:4:in `<module:Rules>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/spree_promo-1.2.2/app/models/spree/promotion/rules/user.rb:3:in `<class:Promotion>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/spree_promo-1.2.2/app/models/spree/promotion/rules/user.rb:2:in `<module:Spree>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/spree_promo-1.2.2/app/models/spree/promotion/rules/user.rb:1:in `<top (required)>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:469:in `load'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:469:in `block in load_file'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:639:in `new_constants_in'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:468:in `load_file'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:353:in `require_or_load'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:502:in `load_missing_constant'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:192:in `block in const_missing'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:190:in `each'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:190:in `const_missing'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/spree_promo-1.2.2/lib/spree/promo/engine.rb:45:in `block in <class:Engine>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.9/lib/rails/initializable.rb:30:in `instance_exec'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.9/lib/rails/initializable.rb:30:in `run'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.9/lib/rails/initializable.rb:55:in `block in run_initializers'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.9/lib/rails/initializable.rb:54:in `each'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.9/lib/rails/initializable.rb:54:in `run_initializers'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.9/lib/rails/application.rb:136:in `initialize!'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.9/lib/rails/railtie/configurable.rb:30:in `method_missing'
from C:/Users/Ross/Documents/eCommerce/Spree/spree_test/config/environment.rb:5:in `<top (required)>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/polyglot-0.3.3/lib/polyglot.rb:63:in `require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/polyglot-0.3.3/lib/polyglot.rb:63:in `require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:251:in `block in require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:236:in `load_dependency'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:251:in `require'
from C:/Users/Ross/Documents/eCommerce/Spree/spree_test/config.ru:4:in `block in <main>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:51:in `instance_eval'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:51:in `initialize'
from C:/Users/Ross/Documents/eCommerce/Spree/spree_test/config.ru:1:in `new'
from C:/Users/Ross/Documents/eCommerce/Spree/spree_test/config.ru:1:in `<main>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:40:in `eval'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:40:in `parse_file'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/server.rb:200:in `app'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.9/lib/rails/commands/server.rb:46:in `app'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/server.rb:301:in `wrapped_app'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/server.rb:252:in `start'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.9/lib/rails/commands/server.rb:70:in `start'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.9/lib/rails/commands.rb:55:in `block in <top (required)>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.9/lib/rails/commands.rb:50:in `tap'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.9/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
C:\Users\Ross\Documents\eCommerce\Spree\spree_test>
我不知道从哪里开始处理所有这些错误,并且害怕弄乱这些文件,而且 rails 服务器在其他 rails 应用程序(非狂欢)中也能正常工作,任何帮助将不胜感激。
谢谢,罗斯