请帮我解决这个问题。我有 ubuntu 14.04。ruby 的一个新版本。
roman@Salomon:~/shopcart$ spree install --auto-accept
gemfile spree
gemfile spree_gateway
gemfile spree_auth_devise
run bundle install from "."
/home/roman/.rvm/gems/ruby-2.2.0/gems/htmlentities-4.3.1/lib/htmlentities/mappings/expanded.rb:465: warning: duplicated key at line 466 ignored: "inodot"
/home/roman/.rvm/gems/ruby-2.2.0/gems/activerecord-4.1.8/lib/active_record/dynamic_matchers.rb:26:in `method_missing': undefined method `raise_in_transactional_callbacks=' for ActiveRecord::Base:Class (NoMethodError)
from /home/roman/.rvm/gems/ruby-2.2.0/gems/activerecord-4.1.8/lib/active_record/railtie.rb:110:in `block (3 levels) in <class:Railtie>'
from /home/roman/.rvm/gems/ruby-2.2.0/gems/activerecord-4.1.8/lib/active_record/railtie.rb:109:in `each'
from /home/roman/.rvm/gems/ruby-2.2.0/gems/activerecord-4.1.8/lib/active_record/railtie.rb:109:in `block (2 levels) in <class:Railtie>'
from /home/roman/.rvm/gems/ruby-2.2.0/gems/activesupport-4.1.8/lib/active_support/lazy_load_hooks.rb:38:in `instance_eval'
from /home/roman/.rvm/gems/ruby-2.2.0/gems/activesupport-4.1.8/lib/active_support/lazy_load_hooks.rb:38:in `execute_hook'
from /home/roman/.rvm/gems/ruby-2.2.0/gems/activesupport-4.1.8/lib/active_support/lazy_load_hooks.rb:28:in `block in on_load'
from /home/roman/.rvm/gems/ruby-2.2.0/gems/activesupport-4.1.8/lib/active_support/lazy_load_hooks.rb:27:in `each'
from /home/roman/.rvm/gems/ruby-2.2.0/gems/activesupport-4.1.8/lib/active_support/lazy_load_hooks.rb:27:in `on_load'
from /home/roman/.rvm/gems/ruby-2.2.0/gems/activerecord-4.1.8/lib/active_record/railtie.rb:108:in `block in <class:Railtie>'
from /home/roman/.rvm/gems/ruby-2.2.0/gems/railties-4.1.8/lib/rails/initializable.rb:30:in `instance_exec'
from /home/roman/.rvm/gems/ruby-2.2.0/gems/railties-4.1.8/lib/rails/initializable.rb:30:in `run'
from /home/roman/.rvm/gems/ruby-2.2.0/gems/railties-4.1.8/lib/rails/initializable.rb:55:in `block in run_initializers'
from /home/roman/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'
from /home/roman/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
from /home/roman/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'
from /home/roman/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'
from /home/roman/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/tsort.rb:345:in `each'
from /home/roman/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/tsort.rb:345:in `call'
from /home/roman/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'
from /home/roman/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'
from /home/roman/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each'
from /home/roman/.rvm/gems/ruby-2.2.0/gems/railties-4.1.8/lib/rails/initializable.rb:54:in `run_initializers'
from /home/roman/.rvm/gems/ruby-2.2.0/gems/railties-4.1.8/lib/rails/application.rb:300:in `initialize!'
from /home/roman/shopcart/config/environment.rb:5:in `<top (required)>'
from /home/roman/.rvm/gems/ruby-2.2.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
from /home/roman/.rvm/gems/ruby-2.2.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
from /home/roman/.rvm/gems/ruby-2.2.0/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:247:in `block in require'
from /home/roman/.rvm/gems/ruby-2.2.0/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:232:in `load_dependency'
from /home/roman/.rvm/gems/ruby-2.2.0/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:247:in `require'
from /home/roman/.rvm/gems/ruby-2.2.0/gems/spring-1.3.2/lib/spring/application.rb:92:in `preload'
from /home/roman/.rvm/gems/ruby-2.2.0/gems/spring-1.3.2/lib/spring/application.rb:143:in `serve'
from /home/roman/.rvm/gems/ruby-2.2.0/gems/spring-1.3.2/lib/spring/application.rb:131:in `block in run'
from /home/roman/.rvm/gems/ruby-2.2.0/gems/spring-1.3.2/lib/spring/application.rb:125:in `loop'
from /home/roman/.rvm/gems/ruby-2.2.0/gems/spring-1.3.2/lib/spring/application.rb:125:in `run'
from /home/roman/.rvm/gems/ruby-2.2.0/gems/spring-1.3.2/lib/spring/application/boot.rb:18:in `<top (required)>'
from /home/roman/.rvm/rubies/ruby-2.2.0/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /home/roman/.rvm/rubies/ruby-2.2.0/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from -e:1:in `<main>'
roman@Salomon:~/shopcart$
并且
run bundle install from "."
The git source git://github.com/spree/spree_gateway.git is not yet checked out. Please run `bundle install` before trying to start your application
roman@Salomon:~/blog$ bundle install
Updating git://github.com/spree/spree_gateway.git
Updating git://github.com/spree/spree_auth_devise.git
Fetching gem metadata from https://rubygems.org/.........
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies...
Bundler could not find compatible versions for gem "rails":
In Gemfile:
spree (= 2.4.3) ruby depends on
spree_core (= 2.4.3) ruby depends on
rails (~> 4.1.8) ruby
rails (4.2.0)
答案1
当您使用“rails new my_app”创建 rails 应用程序时,您没有指定希望它使用 rails4.1.8
如果是新应用,请尝试rails _4.1.8_ new my_app