ubuntu上更新gems

来源:岁月联盟 编辑:exp 时间:2012-06-11
在Ubuntu上安装gem:

sudo apt-get install rubygems

这个没问题,但是apt-get库中的 gem 版本太低了,安装不了 rails。

偿试 gem 自升级

 gem update --system

提示:www.2cto.com

ERROR: While executing gem … (RuntimeError)
gem update –system is disabled on Debian. RubyGems can be updated using the official Debian repositories by aptitude or apt-get.

是说,gem update –system 在 apt-get 系统下(Debian or Ubuntu)被禁止了。

2,只有手动安装了
apt-get remove rubygems #移除 apt-get 管理的 gem
wget http://rubyforge.org/frs/download.php/76032/rubygems-1.8.23.tgz #rubyforge上找到最新 gem 包地址
tar xzf rubygems-1.8.23.tgz
cd rubygems-1.8.23
sudo ruby setup.rb
gem -v


3, 然后,后续安装就正常了。