ubuntu10.10安装ruby及heroku
1:安装ruby1.9.2, 不要使用之前的版本
sudo apt-get install ruby1.9.2
命令执行后装的竟然是1.9.1,肯跌啊
2:安装gem(ruby1.9.1以后的版本自带gems)
sudo apt-get install gems
3:安装heroku
方案一:sudo gem install heroku(如果方案一不行或者时间过长可考虑方案二)
方案二:http://rubygems.org/gems
用上面的网址从heroku这个gem包开始一个一个的找依赖并下载到本地进行本地安装
4:如果在运行heroku的时候出现类似这样的错误
leozhou@ubuntu:/var/lib/gems/1.8/gems/heroku-2.8.6/bin$ heroku
/var/lib/gems/1.8/gems/heroku-2.8.6/lib/heroku/client.rb:2:in `require': no such file to load -- rest_client (LoadError)
??? from /var/lib/gems/1.8/gems/heroku-2.8.6/lib/heroku/client.rb:2
??? from /var/lib/gems/1.8/gems/heroku-2.8.6/lib/heroku.rb:6:in `require'
??? from /var/lib/gems/1.8/gems/heroku-2.8.6/lib/heroku.rb:6
??? from ./heroku:6:in `require'
??? from ./heroku:6
只要把文件/var/lib/gems/1.8/gems/heroku-2.8.6/lib/heroku/client.rb里第二行对rest_client的引用去掉即可。
注:碰到readline的问题试试这个方法:
http://dirk.net/2009/04/05/no-such-file-to-load-readline-loaderror-when-running-scriptconsole/