ubuntu下配置ruby时遇到问题(二)
1, 查看系统,核心版本。
uname -a
less /proc/version
lsb_release -a 这个比较详细。
2,Ubuntu下apt-get update/upgrade 不能工作的解决办法。
1> gedit /etc/apt/sources.list 然后替换为下面的内容。或者替换为163的镜像文件sources.list, 在上一篇有列出。
#deb cdrom:[Ubuntu 10.04 LTS _Lucid Lynx_ - Release i386 (20100429)]/ lucid main restricted # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to # newer versions of the distribution. deb http://cn.archive.ubuntu.com/ubuntu/ lucid main restricted deb-src http://cn.archive.ubuntu.com/ubuntu/ lucid main restricted ## Major bug fix updates produced after the final release of the ## distribution. deb http://cn.archive.ubuntu.com/ubuntu/ lucid-updates main restricted deb-src http://cn.archive.ubuntu.com/ubuntu/ lucid-updates main restricted ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team. Also, please note that software in universe WILL NOT receive any ## review or updates from the Ubuntu security team. deb http://cn.archive.ubuntu.com/ubuntu/ lucid universe deb-src http://cn.archive.ubuntu.com/ubuntu/ lucid universe deb http://cn.archive.ubuntu.com/ubuntu/ lucid-updates universe deb-src http://cn.archive.ubuntu.com/ubuntu/ lucid-updates universe ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team, and may not be under a free licence. Please satisfy yourself as to ## your rights to use the software. Also, please note that software in ## multiverse WILL NOT receive any review or updates from the Ubuntu ## security team. deb http://cn.archive.ubuntu.com/ubuntu/ lucid multiverse deb-src http://cn.archive.ubuntu.com/ubuntu/ lucid multiverse deb http://cn.archive.ubuntu.com/ubuntu/ lucid-updates multiverse deb-src http://cn.archive.ubuntu.com/ubuntu/ lucid-updates multiverse ## Uncomment the following two lines to add software from the 'backports' ## repository. ## N.B. software from this repository may not have been tested as ## extensively as that contained in the main release, although it includes ## newer versions of some applications which may provide useful features. ## Also, please note that software in backports WILL NOT receive any review ## or updates from the Ubuntu security team. # deb http://cn.archive.ubuntu.com/ubuntu/ lucid-backports main restricted universe multiverse # deb-src http://cn.archive.ubuntu.com/ubuntu/ lucid-backports main restricted universe multiverse ## Uncomment the following two lines to add software from Canonical's ## 'partner' repository. ## This software is not part of Ubuntu, but is offered by Canonical and the ## respective vendors as a service to Ubuntu users. # deb http://archive.canonical.com/ubuntu lucid partner # deb-src http://archive.canonical.com/ubuntu lucid partner deb http://security.ubuntu.com/ubuntu lucid-security main restricted deb-src http://security.ubuntu.com/ubuntu lucid-security main restricted deb http://security.ubuntu.com/ubuntu lucid-security universe deb-src http://security.ubuntu.com/ubuntu lucid-security universe deb http://security.ubuntu.com/ubuntu lucid-security multiverse deb-src http://security.ubuntu.com/ubuntu lucid-security multiverse
2> 安装sudo apt-get install curl 试试功能。如果仍然不行,
sudo apt-get install update /upgrade
如果可以就安装 sudo apt-get install curl 及其下面的命令, ruby要调为
sudo apt-cache search ruby 用来查看有哪些RUBY包可安装。
sudo apt-get install ruby #但是默认装的是1.8,我想更新到1.9的高版本。
sudo apt-get install irb #装用于调试的irb
sudo apt-get install ri ri如何使用,我还没有用会。
==========================================
sudo apt-get install curl 安装curl
curl -L get.rvm.io|bash -s stable --ruby 安装rvm。
source ~/.rvm/scripts/rvm 使其生效
rvm -v 显示rvm版本号,表示安装成功。
rvm list known 查看有哪些可安装
rvm install 1.9.3 安装ruby 1.9.3的版本。
rvm use 1.9.3 --default 设置为默认的版本。rvm可使几个版本共存。
rvm list 查看已经安装的ruby
rvm remove 1.8.0 可用来卸载一个已安装版本
sudo apt-get install rubygems 安装gem, 为cucumber做准备。
gem list 安装成功后查看,一般会自带几个安装好的组件
gem install cucumber 安装cucumber
cucumber --version 查看即知是否安装成功。
3, 如果以上方法都行不通,我只有换10.04版了。