Install Ruby on Rails 7
Older posts:
Install the latest version of Ruby 3, Rails 7, and Postgresql
rvm list
rvm get head
rvm install ruby-3.1.0
rvm --default use 3.1.0
gem install rails -v 7.0.1
gem update bundler
gem update rails
gem update --system
sudo apt update
sudo apt install postgresql libpq-dev redis-server redis-tools
ruby -v
rails -v
bundler -v
pg_config --version
Create app:
rails help
rails new askdemos -j=importmap -c=tailwind -d=postgresql
rails new askdemos -j=importmap -c=bootstrap -d=postgresql
To start the app, don’t use rails c
any more. You can use ./bin/dev
or bin/dev
to start it via Procfile.dev
In you are using Cloud9, you might want to do this:
# Procfile.dev
--web: bin/rails server -p 3000
++web: bin/rails server -p 8080
css: bin/rails tailwindcss:watch
BTW, if you get errors running ./bin/dev
, try running gem install foreman
.
Next Step - install Postgresql
Bonus: using Rails main in Gemfile
gem 'rails', git: 'https://github.com/rails/rails.git'
# or
# gem 'rails', github: 'rails/rails'
Did you like this article? Did it save you some time?