-
Build tools:
sudo yum groupinstall "Development Tools"
-
Dependencies:
yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel \ libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison iconv-devel
-
Install RVM
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
-
Install Ruby
rvm install 1.9.2
-
Install Rails, Bundler (problem was here)
gem install bundler --no-rdoc --no-ri gem install rails --no-rdoc --no-ri
-
MySQL
sudo yum install sqlite3-dev
-
Node JS
wget http://nodejs.org/dist/v0.6.15/node-v0.6.15.tar.gz tar -xf node-v0.6.15.tar.gz cd node-v0.6.15 ./configure sudo make install
Shortcut way to try out:
sudo yum localinstall --nogpgcheck http://nodejs.tchol.org/repocfg/fedora/nodejs-stable-release.noarch.rpm
sudo yum install nodejs
[ec2-user@domU-12-31-38-04-80-4D zlib]$ gem install rails --include-dependencies
ERROR: Loading command: install (LoadError)
no such file to load -- zlib
ERROR: While executing gem ... (NameError)
uninitialized constant Gem::Commands::InstallCommand
Originally taken from here
cd /home/ec2-user/.rvm/src/ruby-1.9.2-p320/ext/zlib
ruby extconf.rb --with-zlib-include=/usr/include --width-zlib-lib=/usr/lib
make
sudo make install
gem install rails --include-dependencies
Originally taken from here
cd /home/ec2-user/.rvm/src/ruby-1.9.2-p320/ext/openssl
ruby extconf.rb
make
make install
Steps for CentOS(less painful btw):
Setup EPEL
rpm -Uhv http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm
All Supplemental Packages
yum install gcc gcc-c++ mysql-devel libxml2-devel libxslt-devel libssl-devel zlib zlib-devel openssl
RVM install
bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
echo ' -s "$HOME/.rvm/scripts/rvm" && . "$HOME/.rvm/scripts/rvm" # Load RVM function'>>~/.bash_profile
Ruby install
rvm pkg install openssl
rvm install 1.9.3 --with-openssl-dir=$rvm_path/usr
rvm use ruby-1.9.3 --default
gem install bundle
gem install rails