安装任何版本的 ruby 时,RVM 都会报错。我们以 ree-1.8.7-head 为例
rasfast@rasfast-home:~$ rvm install ree-1.8.7-head
Installing Ruby from source to: /home/rasfast/.rvm/rubies/ree-1.8.7-head, this may take a while depending on your cpu(s)...
ree-1.8.7-head - #fetching
Cloning from git://github.com/FooBarWidget/rubyenterpriseedition187-330, this may take a while depending on your connection...
Cloning into /home/rasfast/.rvm/repos/ree-1.8.7-head...
remote: Counting objects: 3307, done.
remote: Compressing objects: 100% (2900/2900), done.
remote: Total 3307 (delta 435), reused 2491 (delta 290)
Receiving objects: 100% (3307/3307), 7.75 MiB | 55 KiB/s, done.
Resolving deltas: 100% (435/435), done.
HEAD is now at e1b23fe Merge remote branch 'upstream/v1_8_7_334'
From git://github.com/FooBarWidget/rubyenterpriseedition187-330
* branch master -> FETCH_HEAD
Already up-to-date.
Copying from repo to src path...
Running autoreconf
ree-1.8.7-head - #configuring
ERROR: Error running ' ./configure --prefix=/home/rasfast/.rvm/rubies/ree-1.8.7-head ', please read /home/rasfast/.rvm/log/ree-1.8.7-head/configure.log
ERROR: There has been an error while running configure. Halting the installation.
rasfast@rasfast-home:~$ cat /home/rasfast/.rvm/log/ree-1.8.7-head/configure.log
[2011-09-03 23:21:44] ./configure --prefix=/home/rasfast/.rvm/rubies/ree-1.8.7-head
configure: error: cannot run /bin/bash ./config.sub
您能建议下一步如何解决这个问题吗?
答案1
安装 rvm 后,最好检查一下
rvm requirements
在 ubuntu 上得到如下结果:
... skipped some part
bash >= 4.1 required
curl is required
git is required (>= 1.7 recommended)
patch is required (for ree and some ruby-head's).
... skipped some part
Additional Dependencies:
# For Ruby / Ruby HEAD (MRI, Rubinius, & REE), install the following:
ruby: /usr/bin/apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion
如果您尚未安装建议的软件包,请尝试安装它们,然后获取您的 ruby 构建。
对于 1.8.7,一些库可能比预期的要新,因此编译可能会失败(例如 openssl,请在以下位置查找解决方案http://beginrescueend.com/packages/openssl/如何获取所需版本的本地 rvm openssl 安装)