Skip to content

Instantly share code, notes, and snippets.

@usutani
Forked from t-oginogin/Ruby-memo.md
Last active August 29, 2015 13:57
Show Gist options
  • Save usutani/9448750 to your computer and use it in GitHub Desktop.
Save usutani/9448750 to your computer and use it in GitHub Desktop.

Ruby2.1 on Ubuntu

sudo ls

sudo apt-get update
sudo apt-get -y install gcc
sudo apt-get -y install make
sudo apt-get -y install build-essential
sudo apt-get -y install zlib1g-dev libssl-dev libreadline-dev libyaml-dev libxml2-dev libxslt-dev

cd /usr/src/
sudo wget http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.0.tar.gz
sudo tar xvzf ruby-2.1.0.tar.gz
cd ruby-2.1.0/
sudo ./configure --disable-install-doc --disable-install-rdoc --disable-install-capi
sudo make
sudo make install
sudo make clean

sudo gem install chef --no-ri --no-rdoc

Ruby2.0.0-p247 + Rails 4.0.0(アップデート)

$ rvm get stable
$ rvm reinstall 2.0.0 --skip-openssl --with-opt-dir=`brew --prefix openssl`
$ gem update --system
$ rvm use 2.0.0
$ gem install rails --no-ri --no-rdoc

Ruby2.0 + Rails 4.0環境構築(新規)

rvmでrubyをインストールする前に

次のコマンドを実行して必要なものを確認し、brewでインストールしておく

$ rvm requirements

gccをインストール

(Xcode4.6のものではerrorになるため)

$ brew update
$ brew tap homebrew/dupes
$ brew install apple-gcc42

rvmインストール

$ \curl -L https://get.rvm.io | bash -s stable

rvmを有効にする(初回のみ)

$ echo "source $HOME/.rvm/scripts/rvm" >> ~/.bash_profile
$ source ~/.bash_profile

rvmでruby-2.0.0-p0インストール

$ brew install openssl
$ brew link openssl --force
$ brew install curl-ca-bundle
$ rvm get stable
$ rvm reinstall 2.0.0-p0 --skip-openssl --with-opt-dir=`brew --prefix openssl`
$ rvm use 2.0.0

rvmでruby-1.9.3インストール

$ rvm reinstall 1.9.3 --skip-openssl --with-opt-dir=`brew --prefix openssl`
$ rvm use 1.9.3

Rails 4.0.0インストール

$ gem install rails --version 4.0.0.beta1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment