I'm trying to install Rails using Gem and did the following from the terminal:
sudo apt-get install ruby-full build-essential
sudo apt-get install rubygems
export PATH=/var/lib/gems/1.8/bin:$PATH
gem install rails
Then I get the following message:
ERROR: While executing gem ... (Errno:EACCES) Permission denied - /var/lib/gems
I've followed the instruction from Ubuntu Help Guide & I'm using Oracle VM VirtualBox to run Ubuntu under Windows 7 and have RubyGems v1.8.15.
You need to prefix the gem
command with sudo
because /var/lib/gems
is owned by root
. You could also take a look at RVM which allows really easy installation and management of gems and Ruby versions. Best part, it's all in your home dir!
EDIT: per @AndrewMarshall's comment bellow, rbenv is an alternative to RVM.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With