Created
July 11, 2014 09:42
-
-
Save jollyjoester/aa4a3dd2faad40d06150 to your computer and use it in GitHub Desktop.
Setting Ruby on Rails on docker:centos
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Docker:centosでRuby on Rails環境作成 | |
| #以下rootもしくはsudoで | |
| yum update | |
| yum -y install tar | |
| yum -y install gcc | |
| #Dockerのcentos:latestでやる場合は通常のコマンドではエラーになる | |
| #yum -y install openssl-devel ##エラー | |
| yum -y install --enablerepo=centosplus openssl-devel | |
| yum -y install sqlite-devel | |
| yum -y install git | |
| yum -y install nodejs | |
| #以下Rubyを使うユーザーで(システムワイドに使うときは/usr/localへ) | |
| su [user] | |
| git clone https://github.com/sstephenson/rbenv.git ~/.rbenv | |
| echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile | |
| echo 'eval "$(rbenv init -)"' >> ~/.bash_profile | |
| source ~/.bash_profile | |
| #restart shell | |
| #rbenv入ってるか確認 | |
| type rbenv | |
| rbenv install 2.1.2 | |
| rbenv global 2.1.2 | |
| rbenv rehash | |
| ruby -v | |
| gem i bundler | |
| gem i rails | |
| rails -v | |
| gem i spring | |
| gem i execjs | |
| rails new [app_name] | |
| cd [app_name] | |
| #Gemfileの下記行コメントアウト外す | |
| #gem 'therubyracer', platforms: :ruby | |
| bundle install | |
| #g++がないと怒られる | |
| sudo yum -y installgcc-c++ | |
| gem i therubyracer | |
| rails s |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello, Ruby on Rails on docker:centos