Ruby安装问题 [英] Ruby installation problems
问题描述
我正在使用ubuntu 11.10,但在安装ruby时遇到了麻烦.当我尝试安装它时,它发出了以下提示:
I am using ubuntu 11.10 and I'm having troubles installing ruby. when I tried to install it it gave out this:
Installing Ruby from source to: /usr/share/ruby-rvm/rubies/ruby-1.9.3-p125, this may take a while depending on your cpu(s)...
ruby-1.9.3-p125 - #fetching
ruby-1.9.3-p125 - #extracted to /usr/share/ruby-rvm/src/ruby-1.9.3-p125 (already extracted)
Applying patch 'xcode-debugopt-fix-r34840' (located at /usr/share/ruby-rvm/patches/ruby/1.9.3/p125/xcode-debugopt-fix-r34840.diff)
Error running 'patch -F 25 -p1 -N -f <"/usr/share/ruby-rvm/patches/ruby/1.9.3/p125/xcode-debugopt-fix-r34840.diff"', please read /usr/share/ruby-rvm/log/ruby-1.9.3-p125/patch.apply.xcode-debugopt-fix-r34840.log
ruby-1.9.3-p125 - #autoreconf
ruby-1.9.3-p125 - #configuring
ruby-1.9.3-p125 - #compiling
ruby-1.9.3-p125 - #installing
Removing old Rubygems files...
Installing rubygems-1.8.21 for ruby-1.9.3-p125 ...
Installation of rubygems completed successfully.
ruby-1.9.3-p125 - adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
ruby-1.9.3-p125 - #importing default gemsets (/usr/share/ruby-rvm/gemsets/)
Install of ruby-1.9.3-p125 - #complete
之后,我测试了ruby并返回了此代码:
After that I test out ruby and it returns this:
The program 'ruby' can be found in the following packages:
* ruby1.8
* ruby1.9.1
Try: sudo apt-get install <selected package>
请帮助.
推荐答案
我之前也遇到过这个问题.失败的原因是缺少依赖的程序包.
I met this question before too. The reason it fails is lack of dependent packages.
运行rvm requirements
,请参阅要求并安装所有软件包,包括ruby-head
Run rvm requirements
, see the requirements and install all packages, including the one under ruby-head
对我来说,我必须安装:
For me, I have to install:
sudo apt-get install curl patch build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion
运行所有软件包后,通过输入以下命令安装1.9.3或Rubinius:
After running all packages, install 1.9.3 or Rubinius by typing in:
rvm install 1.9.3
或rvm install rbx
应该顺利.
安装后,转到终端"->编辑"->配置文件首选项"->标题和命令",然后选中"Run command as login shell
".关闭,然后也关闭终端窗口.打开一个新的终端窗口,运行rvm --default use 1.9.3
(或其他),然后再次关闭终端.
After installation, go to Terminal->Edit->Profile Preference->Title and Command, check Run command as login shell
. Close, and close terminal window too. Open up a new terminal window, run rvm --default use 1.9.3
(or others), and close terminal again.
现在打开一个新终端,输入ruby,它现在应该可以为您提供正确的ruby.
Now open a new terminal, type ruby, it now should give you the right ruby.
这篇关于Ruby安装问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!