4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

rbenv による Ruby on Rails 環境構築

Last updated at Posted at 2012-07-25

Ubuntu 12.04 でインストールしたときのメモ。

まずは依存パッケージをインストールしておく

sudo apt-get install libsqlite3-dev libssl-dev zlib1g-dev

sudo apt-get install sqlite3 # いらないかも

つぎに rbenv のインストール

git clone https://github.com/sstephenson/rbenv.git .rbenv
cd .rbenv
git checkout v0.3.0
cd
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> .bash_profile
echo 'eval "$(rbenv init -)"' >> .bash_profile
exec $SHELL

ruby-build もインストールしておく

mkdir -p ~/.rbenv/plugins
cd ~/.rbenv/plugins
git clone git://github.com/sstephenson/ruby-build.git

ruby 1.9.2 をインストールする。
インストール可能な ruby のバージョンは、単に "rbenv install" とすれば一覧が得られる。

rbenv install 1.9.2-p320
rbenv rehash
rbenv global 1.9.2-p320

rails 3.1 系の最新を入れる

gem install rails --version "<3.2.0"
rbenv rehash

node.js もいれておく

gem install node
rbenv rehash

これは node.js じゃない。とりあえず apt-get で入れておく。

apt-get install nodejs

できた!

$ rails -v
Rails 3.1.6

4
4
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?