2012-12-08 26 views
0

我是Rails新手&想試用Spree Commerce,但試圖安裝Spree時遇到了一些問題,我一直在關注 Spree installation guideSpree設置錯誤:設計Github Gem'spree_auth_devise'和Rails服務器

當我嘗試安裝施普雷我得到下面的錯誤:

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> 

下面是我的應用程序寶石文件:

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(NB我先從我的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應用程序(非瘋狂)中的軌道服務器工作正常,任何幫助將非常感激。

感謝, 羅斯

回答

2

談到作爲一個Windows用戶具有相當多的在Windows上使用Rails的經驗,我會勸你保存自己很多頭痛的問題,並使用VirtualBox或VMware的設立一個Ubuntu 12.04 LTS VM 。 Vagrant可以讓你的自動化程度更高一點。

這就是說,我會確保你在系統級別滿足先決條件。

如果您不在Ruby 1.9.3-p327上,請升級到它。這不太可能是問題,但它包含一些重要的安全修復程序。

通過運行gem update --system確保rubygems是最新的。

確保捆綁器和耙子是最新的:gem update bundlergem update rake。如果你今天沒有安裝它,那麼在你使用它的時候也要使用狂熱寶石。

開始與現在一個新的項目,您使用的是最新:

rails _3.2.9_ new spree_project [-d mysql if you're using mysql] 
cd spree_project 
spree install 

每當你運行任何佣金或項目中的軌道的命令,你有bundle exec到前面加上爲好,否則錯誤寶石可以裝載,並會導致你神祕的頭痛。所以運行測試服務器的正確命令是bundle exec rails s

看看如何適合你。

+0

感謝一百萬,這工作完美 – Holly

+0

感謝您標記答案。您也可以在freenode irc組#spree中獲得幫助。 –