我使用 rvm
来管理不同的红宝石和它们的宝石组合。我的 shell 是 zsh,oh-My-zsh 配置了基本设置。启用的 oh-my-zsh 插件有 ruby、 ails、 osx 和 git。下面是我用来安装 ruby-1.8.7和 ails-3.0.7的命令。
rvm install 1.8.7
rvm use 1.8.7
gem install rails -v=3.0.7
然后我输入 rails
得到:
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.
我也尝试过更彻底的安装,比如在切换到 ruby-1.8.7之后重新安装 rubygems
,或者创建一个全新的宝石组合,但都没有成功。
这是 Rvm 的信息:
ruby-1.8.7-p352@rails:
system:
uname: "Darwin yicai.local 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun 7 16:32:41 PDT 2011; root:xnu-1504.15.3~1/RELEASE_X86_64 x86_64"
bash: "/bin/bash => GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin10.0)"
zsh: "/bin/zsh => zsh 4.3.9 (i386-apple-darwin10.0)"
rvm:
version: "rvm 1.8.6 by Wayne E. Seguin (wayneeseguin@gmail.com) [https://rvm.beginrescueend.com/]"
ruby:
interpreter: "ruby"
version: "1.8.7"
date: "2011-06-30"
platform: "i686-darwin10.8.0"
patchlevel: "2011-06-30 patchlevel 352"
full_version: "ruby 1.8.7 (2011-06-30 patchlevel 352) [i686-darwin10.8.0]"
homes:
gem: "/Users/nil/.rvm/gems/ruby-1.8.7-p352@rails"
ruby: "/Users/nil/.rvm/rubies/ruby-1.8.7-p352"
binaries:
ruby: "/Users/nil/.rvm/rubies/ruby-1.8.7-p352/bin/ruby"
irb: "/Users/nil/.rvm/rubies/ruby-1.8.7-p352/bin/irb"
gem: "/Users/nil/.rvm/rubies/ruby-1.8.7-p352/bin/gem"
rake: "/Users/nil/.rvm/bin/rake"
environment:
PATH: "/Users/nil/.rvm/gems/ruby-1.8.7-p352@rails/bin:/Users/nil/.rvm/gems/ruby-1.8.7-p352@global/bin:/Users/nil/.rvm/rubies/ruby-1.8.7-p352/bin:/Users/nil/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/sbin"
GEM_HOME: "/Users/nil/.rvm/gems/ruby-1.8.7-p352@rails"
GEM_PATH: "/Users/nil/.rvm/gems/ruby-1.8.7-p352@rails:/Users/nil/.rvm/gems/ruby-1.8.7-p352@global"
MY_RUBY_HOME: "/Users/nil/.rvm/rubies/ruby-1.8.7-p352"
IRBRC: "/Users/nil/.rvm/rubies/ruby-1.8.7-p352/.irbrc"
RUBYOPT: ""
gemset: "rails"
Gem 版本是1.8.10,最新的版本。