你的红宝石已经很老了(从本周开始,正式弃用)。您的 gem 安装在/usr/local/bin
.
你可能想看看rbenv
这可能会立即解决您的问题
设置完 rbenv后,我像这样编译我的红宝石
# start in your home directory
cd $HOME
# make a src folder for compiling ruby
mkdir -p .src && cd .src
# download ruby
curl -O ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p247.tar.gz
# extract compressed file
tar -xzf ruby-2.0.0-p247.tar.gz
# cd to folder
cd ruby-2.0.0-p247
# configure
./configure --prefix=$HOME/.rbenv/versions/2.0.0-p247 --with-opt-dir=/path/to/openssl --enable-shared
# make and install
make && make install
# cleanup
rm -rf ruby-2.0.0-p247
现在让我们使用它!
# make rbenv aware of our new rubies
rbenv rehash
# set our new version as the default
rbenv global 2.0.0-p247
# let's check it out!
ruby --version
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12.3.0]
现在让我们rails
开始吧
# install rails
gem install rails
# check the version
rails --version
Rails 4.0.0