我想知道您是否可以帮我找出为什么我不能在我的 MBP 上使用 OS X Mountain Lion 安装 Ruby on Rails。这是一个奇怪的问题,我会尽可能多地给你信息。
我已经安装了 ruby,它在 1.9.3 版上运行
我已经安装了 ruby gems,它适用于我尝试安装的所有其他 gem。
它的版本是 1.8.24
当我运行$ sudo gem install rails
它时回复消息:Successfully installed rails-3.2.8
1 gem installed
虽然当我问它时rails -v
它返回:
`Rails is not currently installed on this system. To get the latest version, simply type:
$ sudo gem install rails
You can then rerun your "rails" command.`
我应该怎么办?
rails bash 文件 ( /usr/bin/rails
) 包含:
#!/usr/bin/ruby
# Stub rails command to load rails from Gems or print an error if not installed.
require 'rubygems'
version = ">= 0"
if ARGV.first =~ /^_(.*)_$/ and Gem::Version.correct? $1 then
version = $1
ARGV.shift
end
begin
gem 'railties', version or raise
rescue Exception
puts 'Rails is not currently installed on this system. To get the latest version, simply type:'
puts
puts ' $ sudo gem install rails'
puts
puts 'You can then rerun your "rails" command.'
exit 0
end
load Gem.bin_path('railties', 'rails', version)
那一定意味着 gem 文件不存在或者是旧的或损坏的
我该如何检查?