想快速学习下各种语言,正好看到了一本《七周七语言》,随便翻了一下,感觉很满足好奇心的一本书,决定趁着时间还充裕,学习一下。

ruby的提供很多方法,这里根据《programming ruby》中使用rvm安装ruby1.9.3

登录到https://rvm.io/,可以看到安装rvm的方法,这里使用(需要git支持,sudo apt-get install git curl)

curl -L get.rvm.io | bash -s stable

将rvm添加到shell上,

source ~/.rvm/scripts/rvm

安装ruby

rvm install ruby-1.9.3-p362

然后就是安装过程了

lambertchow@lambertchow:~$ rvm install ruby-1.9.3-p362
No binary rubies available for: downloads/ruby-1.9.3-p362.
Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies.
Fetching yaml-0.1.4.tar.gz to /home/lambertchow/.rvm/archives
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  460k  100  460k    0     0  51264      0  0:00:09  0:00:09 --:--:-- 52823
Extracting yaml to /home/lambertchow/.rvm/src/yaml-0.1.4
Configuring yaml in /home/lambertchow/.rvm/src/yaml-0.1.4.
Compiling yaml in /home/lambertchow/.rvm/src/yaml-0.1.4.
Installing yaml to /home/lambertchow/.rvm/usr
Installing Ruby from source to: /home/lambertchow/.rvm/rubies/ruby-1.9.3-p362, this may take a while depending on your cpu(s)...
ruby-1.9.3-p362 - #downloading ruby-1.9.3-p362, this may take a while depending on your connection...
ruby-1.9.3-p362 - #extracting ruby-1.9.3-p362 to /home/lambertchow/.rvm/src/ruby-1.9.3-p362
ruby-1.9.3-p362 - #extracted to /home/lambertchow/.rvm/src/ruby-1.9.3-p362
ruby-1.9.3-p362 - #configuring
ruby-1.9.3-p362 - #compiling
ruby-1.9.3-p362 - #installing 
Retrieving rubygems-1.8.24
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  371k  100  371k    0     0   573k      0 --:--:-- --:--:-- --:--:--  689k
Extracting rubygems-1.8.24 ...
Removing old Rubygems files...
Installing rubygems-1.8.24 for ruby-1.9.3-p362 ...
Installation of rubygems completed successfully.
Saving wrappers to '/home/lambertchow/.rvm/bin'.
ruby-1.9.3-p362 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
ruby-1.9.3-p362 - #importing default gemsets (/home/lambertchow/.rvm/gemsets/), this may take time ...
Install of ruby-1.9.3-p362 - #complete

安装完成

lambertchow@lambertchow:~$ ruby -v
ruby 1.9.3p362 (2012-12-25 revision 38607) [i686-linux]

安装成功。

 

之间自己编译国,没解决本地问题,放弃了。有简单的方法,还是别折腾的最好。

呵呵,ruby作者都说了

This is probably more work than you were expecting. If all you wanted to do was install a
prepacked Ruby, we’d agree. But what you’ve really done here is given yourself an incredible
amount of flexibility. Maybe in the future a project comes along that requires that you use Ruby
1.8.7. That’s not a problem—just use rvm install 1.8.7 to install it, and use rvm use 1.8.7 to
switch to it.

 

 

 

posted on 2013-01-09 22:28  fisher2012  阅读(198)  评论(0)    收藏  举报