March 28, 2020 · Ruby
Ruby on Rails setup 101 @ 2020
Install Guide
Install rvm
# Install rvm
\curl -sSL https://get.rvm.io | bash -s stable
# Load source
source ~/.zshrc
# Install ruby source
brew update
# Install ruby required binaries, show process via --debug
rvm requirements --debug
# If it stuck, control + C and run this, then rvm install 2.7
brew install zlib autoconf automake coreutils zlib libyaml readline
Install Ruby @ 2.7
rvm install 2.7
rvm use 2.7.0 --default
# Check ruby version
ruby -v
# Check gem version
gem -v
# Install bundler (somthing like npm/yarn)
gem install bundler
# Install rails
gem install rails -v 5.2
# Check rails version
rails -v
Setup project based gemset
#manaully
rvm gemset create gemset1
rvm use [email protected]
#1 liner
rvm use [email protected]
#autoload
cd YOUR_PROJECT_DIR
echo "rvm use [email protected]" > .rvmrc
#setup api only rails
rails _6.0.0_ new . --api
Fix rails some strange default gem issues
# replece sqlite3 in your gemfile
gem 'sqlite3', '>= 1.4.2'
# replace tzinfo-data
gem 'tzinfo-data', '>= 1.2019.3'
# Fix bundler issue
gem install bundler:2.1.4
bundle _2.1.4_ update && bundle _2.1.4_ install
Online guides
Short, for experienced: https://courses.growthschool.com/p/rails-101
Long, for dig deep : https://www.learnenough.com/ruby-on-rails-6th-edition-tutorial
load it into intellj
this one doesnt work
https://www.jetbrains.com/help/idea/opening-a-rails-project-in-intellij-idea.html#
this trick works
https://stackoverflow.com/questions/31645363/intellij-ultimate-detects-ruby-on-rails-as-jruby