A simple Ruby on Rails example
Pre-Set (This is not required if you already have same env)
-
Install rbenv
weijhih.lian at Byronde-MacBook-Pro.local in ~
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc (~/.bash_profile)
echo 'eval "$(rbenv init -)"' >> ~/.bashrc (~/.bash_profile)
source ~/.bashrc (~/.bash_profile)
-
Install ruby
sudo gem install ruby 2.3.7
-
Set ruby version for rbenv
rbenv global 2.3.7
-
Install bundler
gem install bundler
-
Install rails
sudo gem install rails
-
Check again (make sure they are all under rbenv folder)
-
weijhih.lian at Byronde-MacBook-Pro.local in ~
-
$ which ruby
-
/Users/weijhih.lian/.rbenv/shims/ruby
-
$ which bundler
-
/Users/weijhih.lian/.rbenv/shims/bundler
-
$ which rails
-
/Users/weijhih.lian/.rbenv/shims/rails
-