Install Ruby & Ruby on Rails in Ubuntu Xenial
Ruby
This guide involves:
- Setting up Ruby using rbenv
- Installing Node
- Installing Rails
Install Ruby Dependencies
Packages required to build ruby.
Install rbenv & ruby-build
Install Bundler
Set Up Git Globally
If you haven’t already done it…
Copy and paste the contents of the public key to Github/BitBucket.
Check the ssh connection:
Set Up Node
Install Node using NVM (Node Version Manager)
See: http://linoxide.com/ubuntu-how-to/installing-nodejs-ubuntu-16-04/
Build a quick hello world node app to check:
nano hello.js
# Enter:
a="Nice";
b="One!"
c=2;
d=2;
e=c+d;
console.log(c +' plus '+d+' equals:' +e);
console.log('Hello World! '+a+' '+b);
Run node hello.js
in the terminal to output:
2 plus 2 equals:4
Hello World! Nice One!
Install Rails
Build a New Rails App using MySQL(MariaDB)
Assuming that a MySQL server is already installed on the system, prepare Rails for MySQL:
# Requirement to compile the mysql2 gem
sudo apt-get install libmysqlclient-dev
# Gem used by Rails to connect to MySQL
gem install mysql2
Set up new Rails app:
rails new railsapp -d mysql
cd railsapp
rake db:create
rails server
References
comments powered by Disqus