Thursday, June 25, 2015

RVM - Ruby enVironment Manager


  • Without RVM, it’s pretty difficult to have more than one version of Ruby on your computer.

RVM stands for Ruby enVironment Manager.

http://code.tutsplus.com/tutorials/why-you-should-use-rvm--net-19529


  •  Postgres uses information from the operating system to determine the language and encoding of databases

 sudo /usr/sbin/update-locale LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8

 PostgreSQL is the database of choice in the Ruby community
sudo apt-get install postgresql libpq-dev

 Creating the Database Instance & Adding a User

  2  ls /usr/lib/postgresql/9.3/bin/initdb -D /usr/local/pgsql/data
    3  createuser vagrant

sudo mkdir -p /usr/local/pgsql/data
sudo chown postgres:postgres /usr/local/pgsql/data
sudo su postgres
/usr/lib/postgresql/9.3/bin/initdb -D /usr/local/pgsql/data
createuser vagrant

There are several options for managing Ruby versions, but we’ll use RVM with the standard "single user" method.
From your SSH session, we first need to install the curl tool for fetching files, then can use a script provided by the RVM team for easy setup:

sudo apt-get install curl
\curl -sSL https://get.rvm.io | bash
source /home/ubuntu/.rvm/scripts/rvm

The RVM tool has an awesome tool for installing all the various compilers and packages you’ll need to build Ruby and common libraries

Then install both Ruby 1.9.3 and 2.1
rvm install 1.9.3
rvm install 2.1

You can set either as your default Ruby. For 2.1
rvm use 2.1 --default
rvm use 1.9.3 --default

verify it:
which ruby
ruby -v

Rails’ Asset Pipeline needs a JavaScript runtime. There are several options, but let’s install NodeJS:
sudo apt-get install nodejs

http://tutorials.jumpstartlab.com/topics/vagrant_setup.html

No comments:

Post a Comment