Tuesday, May 8, 2012

RVM + Ruby + Rails Installation In Ubuntu

Step1: Install GCC and Other Tools
You need the C compiler and the Make utility. So this is the first package called build-essential that should be installed. To install run the following in your terminal

$ sudo apt-get install build-essential


Step2: Install Curl
 RVM will need curl to download files. should be installed. Run the following



$ sudo apt-get install curl

Step3: Install Libraries
You need the following libraries;
  • readline, which lets you edit lines of text in bash or IRB
  • zlib, which Rubygems will need to function
  • OpenSSL
  • LibXML
So run the following to install

$ sudo apt-get install zlib1g-dev libreadline-dev libssl-dev libxml2-dev

Step4: Install RVM
Now that you're all set up, install RVM itself. To install run

$ bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
 Append the following line to your ~/.bashrc file.

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # This loads RVM

And then reload your bash environment (or close the terminal window and open a new one).

$ source ~/.bashrc



Step5: Test your RVM
If installation was successful, RVM should now load whenever you open a new shell. This can be tested by executing the following command which should output 'rvm is a function' as shown below.

$ type rvm | head -n 1


Step6: Install Ruby
To install ruby 1.9.3 run the following command.

$ rvm install 1.9.3 

The last part of the command above is the version of ruby, so if you want to install other version of ruby just change that e.g, 1.8.7, 1.9.2 e.t.c


Step6: Install Rails
To install rails run the following command

$ gem install rails

Step6: You are done
Though you are done I would recommend you use gemsets to manage your gems.
For more informations about this visit https://rvm.io/gemsets/. Fill free to drop a comment if you need any assistance.

References;
Welcome to Ruby Community:)
Banta

How To Enable Hibernation On Ubuntu 12.04

Step1: You need to check whether hibernation works in your comp. Run the following command in your terminal to test.

$ sudo pm-hibernate

If you are able to hibernate and startup your machine then you can go to the next sptep.

Step2: Run the following command in your terminal to start editing.

$ sudo gedit /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla

Fill the editor with this


[Re-enable hibernate by default]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultActive=yes


Then save and exit.


Step3: Restart your machine. You should hibernation.:)

Tuesday, May 8, 2012

RVM + Ruby + Rails Installation In Ubuntu

Step1: Install GCC and Other Tools
You need the C compiler and the Make utility. So this is the first package called build-essential that should be installed. To install run the following in your terminal

$ sudo apt-get install build-essential


Step2: Install Curl
 RVM will need curl to download files. should be installed. Run the following



$ sudo apt-get install curl

Step3: Install Libraries
You need the following libraries;
  • readline, which lets you edit lines of text in bash or IRB
  • zlib, which Rubygems will need to function
  • OpenSSL
  • LibXML
So run the following to install

$ sudo apt-get install zlib1g-dev libreadline-dev libssl-dev libxml2-dev

Step4: Install RVM
Now that you're all set up, install RVM itself. To install run

$ bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
 Append the following line to your ~/.bashrc file.

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # This loads RVM

And then reload your bash environment (or close the terminal window and open a new one).

$ source ~/.bashrc



Step5: Test your RVM
If installation was successful, RVM should now load whenever you open a new shell. This can be tested by executing the following command which should output 'rvm is a function' as shown below.

$ type rvm | head -n 1


Step6: Install Ruby
To install ruby 1.9.3 run the following command.

$ rvm install 1.9.3 

The last part of the command above is the version of ruby, so if you want to install other version of ruby just change that e.g, 1.8.7, 1.9.2 e.t.c


Step6: Install Rails
To install rails run the following command

$ gem install rails

Step6: You are done
Though you are done I would recommend you use gemsets to manage your gems.
For more informations about this visit https://rvm.io/gemsets/. Fill free to drop a comment if you need any assistance.

References;
Welcome to Ruby Community:)
Banta

How To Enable Hibernation On Ubuntu 12.04

Step1: You need to check whether hibernation works in your comp. Run the following command in your terminal to test.

$ sudo pm-hibernate

If you are able to hibernate and startup your machine then you can go to the next sptep.

Step2: Run the following command in your terminal to start editing.

$ sudo gedit /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla

Fill the editor with this


[Re-enable hibernate by default]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultActive=yes


Then save and exit.


Step3: Restart your machine. You should hibernation.:)