嗨,我是新來的Ruby on Rails的Ruby on Rails的RVM使用
我有我的Mac上安裝RVM
默認紅寶石1.8.7
$ ruby -v
ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin10.0]
$ rails -v
Rails 2.3.18
$ gem -v
2.2.2
當我嘗試使用Ruby 2.1.0我想加載失敗
$ rvm use 2.1.0
Using /usr/local/rvm/gems/ruby-2.1.0
$ ruby -v
ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-darwin10.0]
$ rails -v
/usr/local/rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/dependency.rb:298:in `to_specs': Could not find 'railties' (>= 0) among 14 total gem(s) (Gem::LoadError)
from /usr/local/rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/dependency.rb:309:in `to_spec'
from /usr/local/rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_gem.rb:53:in `gem'
from /usr/local/rvm/rubies/ruby-2.1.0/bin/rails:22:in `<main>'
$ gem -v
2.2.2
軌道,我不知道如何解決它
這裏是RVM列表知道
$ rvm list known
# MRI Rubies
[ruby-]1.8.6[-p420]
[ruby-]1.8.7[-p374]
[ruby-]1.9.1[-p431]
[ruby-]1.9.2[-p320]
[ruby-]1.9.3[-p484]
[ruby-]2.0.0-p195
[ruby-]2.0.0[-p353]
[ruby-]2.1.0
[ruby-]2.1-head
ruby-head
# GoRuby
goruby
# Topaz
topaz
# TheCodeShop - MRI experimental patches
tcs
# jamesgolick - All around gangster
jamesgolick
# Minimalistic ruby implementation - ISO 30170:2012
mruby[-head]
# JRuby
jruby-1.6.8
jruby-1.7.6
jruby-1.7.9
jruby[-1.7.10]
jruby-head
# Rubinius
rbx-2.0.0
rbx-2.1.1
rbx[-2.2.4]
rbx-head
# Ruby Enterprise Edition
ree-1.8.6
ree[-1.8.7][-2012.02]
# Kiji
kiji
# MagLev
maglev[-head]
maglev-1.0.0
# Mac OS X Snow Leopard Or Newer
macruby-0.10
macruby-0.11
macruby[-0.12]
macruby-nightly
macruby-head
# Opal
opal
# IronRuby
ironruby[-1.1.3]
ironruby-head
RVM信息
RVM信息
ruby-2.1.0:
rvm:
version: "rvm 1.25.17 (stable) by Wayne E. Seguin <[email protected]>, Michal Papis <[email protected]> [https://rvm.io/]"
updated: "2 days 6 hours 43 minutes 42 seconds ago"
path: "/usr/local/rvm"
ruby:
interpreter: "ruby"
version: "2.1.0p0"
date: "2013-12-25"
platform: "x86_64-darwin10.0"
patchlevel: "2013-12-25 revision 44422"
full_version: "ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-darwin10.0]"
homes:
gem: "/usr/local/rvm/gems/ruby-2.1.0"
ruby: "/usr/local/rvm/rubies/ruby-2.1.0"
binaries:
ruby: "/usr/local/rvm/rubies/ruby-2.1.0/bin/ruby"
irb: "/usr/local/rvm/rubies/ruby-2.1.0/bin/irb"
gem: "/usr/local/rvm/rubies/ruby-2.1.0/bin/gem"
rake: "/usr/local/rvm/rubies/ruby-2.1.0/bin/rake"
environment:
PATH: "/usr/local/rvm/gems/ruby-2.1.0/bin:/usr/local/rvm/gems/[email protected]/bin:/usr/local/rvm/rubies/ruby-2.1.0/bin:/usr/local/rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin"
GEM_HOME: "/usr/local/rvm/gems/ruby-2.1.0"
GEM_PATH: "/usr/local/rvm/gems/ruby-2.1.0:/usr/local/rvm/gems/[email protected]"
MY_RUBY_HOME: "/usr/local/rvm/rubies/ruby-2.1.0"
IRBRC: "/usr/local/rvm/rubies/ruby-2.1.0/.irbrc"
RUBYOPT: ""
gemset: ""
追加的'RVM info'輸出到你的問題。這告訴我們你的RVM/Ruby環境是如何配置的。 –
你有沒有用'bundle install'來更新你的新寶石版本的寶石集? –
請參考:http://stackoverflow.com/questions/9212116/rails-could-not-find-railties –