[AWS][CentOS]とりあえずRailsを入れる | iii threetreeslight

November 1, 2012

[AWS][CentOS]とりあえずRailsを入れる

必要なパッケージを入れまくる

gitやコンパイラ、sslやhttpd, curl, readline, opensslなどずさーっと。
amiの中にゴロゴロ入ってましたが。。。 

# yum -y install git 

yum -y install make

yum -y install gcc

yum -y install gcc-c++

yum -y install zlib-devel

yum -y install curl

yum -y install curl-devel

yum -y install readline-devel
# yum -y install openssl 


[webadmin]rvm入れる

$ \curl -L https://get.rvm.io | bash -s stable –ruby
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 10237  100 10237    0     0   3745      0  0:00:02  0:00:02 –:–:– 19278
Please read and follow further instructions.
Press ENTER to continue.
Downloading RVM from wayneeseguin branch stable
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1123k  100 1123k    0     0   213k      0  0:00:05  0:00:05 –:–:–  372k

Installing RVM to /home/webadmin/.rvm/
    Adding rvm PATH line to /home/webadmin/.bashrc /home/webadmin/.zshenv.
    Adding rvm loading line to /home/webadmin/.bash_profile /home/webadmin/.zprofile.


RVM: Shell scripts enabling management of multiple ruby environments.

RTFM: https://rvm.io/

HELP: http://webchat.freenode.net/?channels=rvm (#rvm on irc.freenode.net)

Cheatsheet: http://cheat.errtheblog.com/s/rvm/

Screencast: http://screencasts.org/episodes/how-to-use-rvm

In case of any issues read output of ‘rvm requirements’ and/or ‘rvm notes’

Installation of RVM in /home/webadmin/.rvm/ is almost complete: * To start using RVM you need to run source /home/webadmin/.rvm/scripts/rvm in all your open shell windows, in rare cases you need to reopen all shell windows.

webadmin,

#

Thank you for using RVM!

I sincerely hope that RVM helps to make your life easier and more enjoyable!!!

#

~Wayne

rvm 1.16.17 (stable) by Wayne E. Seguin , Michal Papis [https://rvm.io/]
 ruby-1.9.3-p286 - #configure ruby-1.9.3-p286 - #download % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 4939k 100 4939k 0 0 802k 0 0:00:06 0:00:06 –:–:– 1131k ruby-1.9.3-p286 - #extract ruby-1.9.3-p286 - #validate ruby-1.9.3-p286 - #setup Saving wrappers to ‘/home/webadmin/.rvm/bin’. ruby-1.9.3-p286 - #importing default gemsets (/home/webadmin/.rvm/gemsets/) Creating alias default for ruby-1.9.3-p286. Recording alias default for ruby-1.9.3-p286. Creating default links/files Saving wrappers to ‘/home/webadmin/.rvm/bin’. * To start using RVM you need to run source /home/webadmin/.rvm/scripts/rvm in all your open shell windows, in rare cases you need to reopen all shell windows.


bash_profileに書き込まれちゃうものをbashrcに書く

$ vim ~/.basrc
+ [ -s “$HOME/.rvm/scripts/rvm” ]] && source “$HOME/.rvm/scripts/rvm” # Load RVM into a shell session as a function
+ rvm use 1.9.3@hoge

一応確認

$ rvm -v
rvm 1.16.17 (stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]&#13; $ ruby -v
ruby 1.9.3p286 (2012-10-12 revision 37165) [x86_64-linux]

https://rvm.io/


railsのインストール

$ rvm gemset create hoge
$ use 1.9.3@hoge
$ gem install rails
$ rails -v
Rails 3.2.8