首先还是安装ruby:
1、安装所需依赖
sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev
2、安装git sudo apt-get install git
3、http://stackoverflow.com/questions/26595620/how-to-install-ruby-2-1-4-on-ubuntu-14-04下载rbenv 并设置好环境变量:
git clone https://github.com/rbenv/rbenv.git ~/.rbenv echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc echo 'eval "$(rbenv init -)"' >> ~/.bashrc exec $SHELL
下载ruby源码 设置环境变量
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
exec $SHELL
安装:
rbenv install 2.3.1
rbenv global 2.3.1
ruby -v
rbenv --》ruby envirement 大概是这两个单词的缩写,用来配置ruby的环境和安装的
issue:
rbenv: ruby: command not found
http://stackoverflow.com/questions/21275951/rbenv-ruby-command-not-found
解决办法:在根目录下创建一个.ruby-version文件并在里面输入你安装的ruby的版本号保存。
安装好ruby后安装linuxbrew
参考:http://blog.csdn.net/zzhongcy/article/details/38709041
1、下载
git clone https://github.com/Homebrew/linuxbrew.git ~/.linuxbrew
2、配置环境变量
执行命令:vim ~/.bashrc 进入.bashrc文件的编辑状态中后将一下两句拷贝进去
export PATH="$HOME/.linuxbrew/bin:$PATH"
export LD_LIBRARY_PATH="$HOME/.linuxbrew/lib:$LD_LIBRARY_PATH"