我输入 gem install rails --version 4.0.0
安装,然后输入 rails -v
时,提示如下:
/usr/lib/ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find minitest (~> 4.2) amongst [abstract-1.0.0, actionmailer-4.0.0, actionmailer-3.0.3, actionmailer-2.2.2, actionpack-4.0.0, actionpack-3.0.3, actionpack-2.2.2, activemodel-4.0.0, activemodel-3.0.3, activerecord-4.0.0, activerecord-3.0.3, activerecord-2.2.2, activerecord-deprecated_finders-1.0.3, activeresource-4.0.0, activeresource-3.0.3, activeresource-2.2.2, activesupport-4.0.0, activesupport-3.0.3, activesupport-2.2.2, arel-4.0.0, arel-2.0.10, atomic-1.1.10, bigdecimal-1.2.1, builder-3.2.2, builder-3.1.4, builder-2.1.2, bundler-1.3.5, bundler-unload-1.0.1, erubis-2.7.0, erubis-2.6.6, hike-1.2.3, i18n-0.6.4, json-1.8.0, mail-2.5.4, mail-2.2.20, mime-types-1.23, minitest-5.0.6, multi_json-1.7.7, polyglot-0.3.3, rack-1.5.2, rack-1.2.8, rack-mount-0.6.14, rack-test-0.6.2, rack-test-0.5.7, rails-4.0.0, rails-observers-0.1.2, railties-4.0.0, railties-3.0.3, rake-10.1.0, rdoc-4.0.1, rubygems-bundler-1.2.2, rvm-1.11.3.8, sprockets-2.10.0, sprockets-rails-2.0.0, test-unit-2.5.5, thor-0.18.1, thor-0.14.6, thread_safe-0.1.2, thread_safe-0.1.0, tilt-1.4.1, treetop-1.4.14, tzinfo-1.0.1, tzinfo-0.3.37] (Gem::LoadError)
from /usr/lib/ruby/1.9.1/rubygems/specification.rb:777:in `block in activate_dependencies'
from /usr/lib/ruby/1.9.1/rubygems/specification.rb:766:in `each'
from /usr/lib/ruby/1.9.1/rubygems/specification.rb:766:in `activate_dependencies'
from /usr/lib/ruby/1.9.1/rubygems/specification.rb:750:in `activate'
from /usr/lib/ruby/1.9.1/rubygems/specification.rb:780:in `block in activate_dependencies'
from /usr/lib/ruby/1.9.1/rubygems/specification.rb:766:in `each'
from /usr/lib/ruby/1.9.1/rubygems/specification.rb:766:in `activate_dependencies'
from /usr/lib/ruby/1.9.1/rubygems/specification.rb:750:in `activate'
from /usr/lib/ruby/1.9.1/rubygems.rb:1232:in `gem'
from /usr/local/bin/rails:22:in `<main>'
然后我输入 gem list rails,提示如下:
LOCAL GEMS
rails (4.0.0)
rails-observers (0.1.2)
**最后我输入 gem install rails --version 3.0.3
,安装成功后,再输入 rails -v
,提示如下:
Rails 4.0.0
好神奇,这到底是为什么呢?我的 Ruby 版本是 2.0.0,新人求解