asdf allows you to manage multiple runtime versions with a single CLI tool. It's an alternative to rvm or rbenv, but isn't limited to just ruby.
The following only holds true at the time of writing this. Follow directions located on the asdf wiki.
$ git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.8.1
$ nano ~/.bashrc
# Append the following:
. $HOME/.asdf/asdf.sh
. $HOME/.asdf/completions/asdf.bash
The following plugins are required to run rails:
- nodejs
- ruby
- sqlite
- yarn
$ asdf plugin add nodejs && asdf plugin add ruby && asdf plugin add sqlite && asdf plugin add yarn
$ asdf install nodejs latest && asdf install ruby latest && asdf install sqlite latest && asdf install yarn latest
$ asdf list # take note of versions
$ asdf global nodejs VERSION && asdf global ruby VERSION && asdf global sqlite VERSION && asdf global yarn VERSION
By default, rails will use sqlite. Sqlite is a small, fast, containerized database engine. This is fine for development. For staging or production, postgres or mysql should be used.
$ asdf plugin add postgres
$ asdf install postgres latest
$ asdf list # take note of versions
$ asdf global postgres VERSION
$ pg_ctl start # start PostgreSQL server
~/.irbrc
is loaded when irb is executed. The bash method clear is not available while in irb. I replicated it in ruby. The method is cross platform, and works with ruby >= 2.7.0.
# required_ruby_version = ">= 2.7.0"
require 'io/console'
def clear
original_return_format = conf.return_format
$stdout.clear_screen
conf.return_format = ""
end
asdf
$ gem install rails
--database
is an optional parameter. Default database is sqlite.
$ rails new APP_PATH [--database=postgresql]
$ cd APP_PATH
$ rails s
Spina CMS is an easy to use CMS for rails 6+.
Rails and postgres must be installed (and running).
$ rails new APP_PATH --database=postgresql
$ cd APP_PATH
$ nano Gemfile
# Append the following:
gem 'spina'
$ bundle
$ rails g spina:install
$ nano config/initializers/assets.rb
# Append the following:
Rails.application.config.assets.precompile += %w( default/application.css )
$ rake db:create
$ rake db:migrate
$ rails s
Milligram is a minimalist CSS framework.
$ cd APP_PATH
$ nano Gemfile
# Append the following:
gem 'milligram'
$ nano app/assets/stylesheets/defaulty/application.css.sass
# Append the following:
@import "milligram"
$ bundle
$ nano