我尝试在Ubuntu 10.04上安装Rails。到目前为止,我已经执行了这些命令:
apt-get install build-essential libapache2-mod-passenger apache2 rubygems ruby1.8-dev libopenssl-ruby
gem install fastthread
gem install rails
Fastthread
安装很容易。但是尝试安装 Rails 会导致以下问题:
ERROR: Error installing rails:
bundler requires RubyGems version >= 1.3.6
所以,我尝试了gem -v
,它返回了1.3.5
。
如何升级rubygems?apt-get
无法安装高于1.3.5版本的rubygems。而gem update --system
会产生以下结果:
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.
我现在无法安装 Rails,因为我需要一个更新的 RubyGems 版本,而 Ubuntu 不允许我升级当前版本的 RubyGems。
另外,我尝试使用 apt-get install rails
安装 Rails,似乎成功了,但是当我输入 gem list
时却没有看到 rails
。这是怎么回事?
另外注意:输出的 gem list
结果为:
*** LOCAL GEMS ***
abstract (1.0.0)
actionmailer (3.0.1, 3.0.0)
actionpack (3.0.1, 3.0.0)
activemodel (3.0.1, 3.0.0)
activerecord (3.0.1, 3.0.0)
activeresource (3.0.1, 3.0.0)
activesupport (3.0.1, 3.0.0)
arel (2.0.1, 1.0.1)
builder (2.1.2)
erubis (2.6.6)
fastthread (1.0.7)
i18n (0.4.2)
mail (2.2.9)
mime-types (1.16)
mysql (2.8.1)
polyglot (0.3.1)
rack (1.2.1)
rack-mount (0.6.13)
rack-test (0.5.6)
railties (3.0.1, 3.0.0)
rake (0.8.7)
rubygems-update (1.3.7)
thor (0.14.4)
treetop (1.4.8)
tzinfo (0.3.23)
我假设通过apt-get安装Rails也安装了那些gem包。在使用apt-get安装Rails之前,我只有mysql和fastthread。