Installtion and Setup
Following the guide at: http://railsapps.github.io/installrubyonrails-ubuntu.html
with of course, our own tips and twists and insights
\curl -L https://get.rvm.io | bash -s stable --ruby
If you get message "GPG signature verification failed" then use following command
gpg2 --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
To use RVM
source ~/.rvm/scripts/rvm
Create new gemset
rvm use 2.3.0@teddy --create
where 2.3.0 is ruby version and teddy is project name
Use existing gemset
rvm use 2.3.0@teddy
Display a list of gemsets
rvm gemset list
<- also tells which gemset is active
gemsets for ruby-2.3.0 (found in /home/user/.rvm/gems/ruby-2.3.0)
(default)
global
=> myapp
rails5.0
If you have more than one Ruby version installed, you can see all of the gemsets by typing
rvm gemset list_all
Install rails - most recent stable release
gem install rails
Install rails - specific version
gem install rails --version=3.2.18
Create new project
rails new <project_name>
install gems after new project
bundle install
which rails is version
which rails
/home/user/.rvm/gems/ruby-2.3.0@myapp/bin/rails
Rails Console
rails console
To reloads the environment
2.3.0 :001 > reload!
Reloading...
=> true
Get a list of gems that are outdated
gem outdated
Update all stale gems
gem update