# ! /usr/bin/sh # Ubuntu系統下安裝ruby/rails必要的庫和編譯環境 sudo apt-get update sudo apt-get install -y build-essential openssl curl libcurl3-dev libreadline6 libreadline6-dev git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libxml2-dev libxslt-dev autoconf automake libtool imagemagick libmagickwand-dev libpcre3-dev libsqlite3-dev # rbenv環境安裝 git clone https://github.com/sstephenson/rbenv.git ~/.rbenv echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc echo 'eval "$(rbenv init -)"' >> ~/.bashrc source ~/.bashrc type rbenv git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build # ruby環境安裝,首先列出可安裝的版本,而後選擇後進行下載編譯 rbenv install -l rbenv install 1.9.3-p448 # 設置當前使用的ruby版本並將gem的源改成淘寶鏡像 rbenv global 1.9.3-p448 rbenv rehash gem sources --remove https://rubygems.org/ gem sources -a http://ruby.taobao.org/ # 安裝rails gem install bundler rails # 檢查安裝後的軟件版本 ruby -v gem -v rake -V rails -v # 安裝JAVA sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java6-installer # 升級 #sudo update-java-alternatives -s java-6-oracle # 設置JAVA環境變量 sudo apt-get install oracle-java6-set-default # 設置JAVA字符 sudo mkdir /usr/lib/jvm/java-6-oracle/jre/lib/fonts/fallback cd /usr/lib/jvm/java-6-oracle/jre/lib/fonts/fallback sudo ln -s /usr/share/fonts/truetype/wqy/wqy-microhei.ttc wqy-microhei.ttf sudo ln -s /usr/share/fonts/truetype/wqy/wqy-zenhei.ttc wqy-zenhei.ttf # 安裝node.js(已經包含npm) sudo add-apt-repository ppa:chris-lea/node.js sudo apt-get update sudo apt-get install nodejs
備註:rake -V V是大寫java
環境在Ubuntu14.04下親測。node