Install Ruby, ROR and RBENV on Ubuntu 16.04

Ref:
https://gorails.com/setup/ubuntu/16.04

Install Ruby on Rails on Ubuntu 16.04


https://medium.com/@rgdev/how-to-install-ruby-rails-on-ubuntu-16-04-from-scratch-quickly-4da73c67daa3

I think I already installed many packages needed like curl, nodejs and yarn. so just install this:

Use rbenv to install ruby 2.6.3 at home:

output:

NOTE: Instal ruby 2.6.2 AND make it default:

CHECK:

Then install ‘bundler’

I already setup git, so no need to set it up again. check

Install Rails (v6.0.0.rc1)

If you’re using rbenv, you’ll need to run the following command to make the rails executable available:

check:

SETUP MYSQL
Install libmysqlclient-dev gives you the necessary files to compile the mysql2 gem which is what Rails will use to connect to MySQL when you setup your Rails app.

Let’s create your first Rails application (with mysql):

then modify /home/teddy/Documents/ruby/first-app-mysql/config/database.yml. Modify the database username, password and db name:
SORRY, ONLY ADMIN CAN SHOW THIS!
Create the database manually or run ‘rake db:create’

Then run ‘rails server’

Then open on your browser: http://localhost:3000/

Leave a Reply

Your email address will not be published. Required fields are marked *