Installing ROR app


I wanted to find out how to install a custom ROR app and to do so I followed the tutorial
Unfortunately I did not go to far as the command “rails test_app --database=mysql --freeze” already gave me an error:

ERROR: While executing gem … (Gem::FilePermissionError)
You don’t have write permissions into the /usr/lib/ruby/gems/1.8 directory.

I try to find the answer to this error but to no avail. It there a way of installing gems in a directory I have the right access permission?

Any help will be great.

Thank you,


Modify your .bash_profile and add the following

export GEM_HOME="$HOME/.gems"
export GEM_PATH="$GEM_HOME:/usr/lib/ruby/gems/1.8"
export PATH="$HOME/.gems/bin:$PATH"

Then run “source .bash_profile”

you can then install the gems into your home path.

In your environment.rb file add (change USERNAME to your username)

ENV[‘GEM_PATH’] = ‘/home/USERNAME/.gems:usr/lib/ruby/gems1.8/’