Saturday, August 27, 2016

ruby on rails installation and configuration on Amazon EC2 Linux instance


  1. sudo yum install -y git-core zlib zlib-devel gcc-c++ patch readline readline-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison curl sqlite-devel
  2. git clone git://github.com/sstephenson/rbenv.git .rbenv
  3. echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
  4. echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
  5. exec $SHELL
  6. git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
  7. echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bash_profile
  8. exec $SHELL
  9. rbenv install -v 2.2.4
  10. ruby --version
  11. rbenv global 2.2.4
  12. git clone git://github.com/nodejs/node.git
  13. cd node
  14. git checkout v6.0.0
  15. ./configure
  16. make
  17. sudo make install
  18. sudo su
  19. git clone https://github.com/isaacs/npm.git
  20. cd npm/
  21. exit
  22. sudo make install
To access webapp running on Amazon instance from laptop, make sure you start rails with "-b 0.0.0.0" option to bind it on all interfaces and configure security groups to allow custom tcp traffic on whichever port rails is listening

No comments: