Note: I'm using RVM as my ruby version manager, also yo could use rbenv
- Check ruby version
ruby -v
- To update ruby
rvm install ruby --latest OR rvm install ruby 2.5.0
- Check rails version
rails -v
- To update rails and other gems
gem update rails OR gem install rails -v 5.1.4
gem update
- Creating a new rails app using postgresql
mkdir myapp
echo '2.5.0' > myapp/.ruby-version
echo 'myapp' > myapp/.ruby-version
rails new myapp --database=postgresql
cd myapp
- Run bundle install
bundle update
bundle install
- Create gitignore file
wget -c https://www.gitignore.io/api/git%2Cvim%2Cruby%2Clinux%2Cmacos%2Crails%2Cvisualstudiocode -O .gitignore