Skip to content

Instantly share code, notes, and snippets.

@falcon8823
Created January 24, 2014 09:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save falcon8823/8594723 to your computer and use it in GitHub Desktop.
Save falcon8823/8594723 to your computer and use it in GitHub Desktop.

Ubuntu Rails環境構築

Rubyのインストール

Rubyのインストールにはrbenvを使います。

Rubyのビルドに必要なパッケージをインストール

sudo apt-get -y install libncurses5-dev build-essential libreadline-dev libssl-dev libcurl4-openssl-dev zlib1g-dev libxml2-dev libxslt-dev git

rbenvのインストール

git clone git://github.com/sstephenson/rbenv.git ~/.rbenv
## bashの場合
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
## zshの場合
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(rbenv init -)"' >> ~/.zshrc

ruby-buildのインストール

git clone git://github.com/sstephenson/ruby-build.git
cd ruby-build/
./install.sh

Rubyのインストール

# `MAKE_OPTS=-j2` のように環境変数を与えれば、ビルドが並列化される。
rbenv install 2.1.0
# ビルドが走る
rbenv global 2.1.0
rbenv rehash

Railsのインストール

DBシステムの導入

両方入れておけば良い。

# MySQLを使う場合
sudo apt-get -y install mysql-client mysql-server libmysql++-dev
# SQLiteを使う場合
sudo apt-get -y install sqlite3 libsqlite3-dev

Railsのインストール

gem install rails bundler spring --no-ri --no-rdoc
rbenv rehash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment