我正在研究Rails 2.3.2应用程序。我使用RVM安装了Ruby 1.8.6。当我尝试运行bundler -v
或rails -v
等时,我收到错误消息:
venky@indeg:~/Desktop/practice/AppMonitor$ sudo gem install -v=2.3.2 rails
Successfully installed rails-2.3.2
1 gem installed
Installing ri documentation for rails-2.3.2...
Installing RDoc documentation for rails-2.3.2...
venky@indeg:~/Desktop/practice/AppMonitor$ rails -v
/usr/lib/ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find rails (>= 0) amongst [bundler-unload-1.0.2, executable-hooks-1.3.2, gem-wrappers-1.2.7, json-1.8.1, rubygems-bundler-1.4.4, rvm-1.11.3.9] (Gem::LoadError)
from /usr/lib/ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
from /usr/lib/ruby/1.9.1/rubygems.rb:1231:in `gem'
from /usr/local/bin/rails:22:in `<main>'
这是我的rvm ruby版本:
venky@indeg:~/Desktop/practice/AppMonitor$ rvm list
rvm rubies
=> ruby-1.8.6-p420 [ i686 ]
ruby-1.8.7-head [ i686 ]
ruby-1.9.1-p431 [ i686 ]
ruby-1.9.3-p551 [ i686 ]
* ruby-2.2.1 [ i686 ]
ruby-2.2.3 [ i686 ]
# => - current
# =* - current && default
# * - default
我尝试了一些像Could not find bundler (>= 0) amongst [] (Gem::LoadError) with rails 2.3.18和Could not find rails (>= 0) amongst [] (Gem::LoadError)这样的链接,但没有帮助我。 请帮我摆脱这个..
答案 0 :(得分:2)
您只需rvm list
然后rvm use ruby version