I get the following error when trying to install rubygems version 1.3.7
~/Downloads/rubygems-1.3.7
$ ruby setup.rb
ERROR: While executing gem ... (Errno::EACCES)
Permission denied - /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/gem
Any idea what is cause this. I've previously installed RVM.
Thanks
Run the command
sudo !!
Rather than mess with your system installation of Ruby, consider using RVM to manage your Ruby installation(s). RVM will install multiple Rubies on demand, allow you to create various gem sets, copy them between versions of Ruby, all while sandboxing your Ruby installation in ~/.rvm.
Installing RVM
Related
I am facing a issue with RVM and installed ruby debian/ubuntu package.
As long as I have only installed RVM every works fine. I can use the ruby version which is provided/installed by RVM. Also if I install a gems package compass everything works fine. The RVM is installed as recommended by RVM as single user.
As soon as I install a ruby ubuntu package (which is mandatory for some other ubuntu packages and I have not a option to remove it) my RVM configuration is broken. I cannot execute anymore the compass (command not found) also trying to install it once again with
gem install compass
I am getting
ERROR: While executing gem ... (Errno::EACCES)
Permission denied - /var/lib/gems
Also
which ruby
which gem
Points to /usr/bin and not to my home?!?
Even if I have set
PATH=/home/rocky/.nvm/v0.10.38/bin:/home/rocky/.rvm/bin:...
I have no clue where to take a look since I am very new to ruby and to RVM. Hope someone can help me?
I am getting Permission denied - /var/lib/gems
/var/lib/gems is owned by root therefore you need to do:
sudo gem install compass
which ruby Points to /usr/bin and not to my home?!? Even if I have
set
This is probably because rvm is not running. Try this:
source ~/.rvm/scripts/rvm
which ruby
Note: Once rvm is loaded correctly, which ruby will point to different location and first question may no longer persist (and so do using sudo).
I am trying to install a ruby gem in My Machine using xcode where I call a shell script.
cd "/Users/Desktop/gemfolder"
gem install somegem.gem
I am getting an error like this:
While executing gem ... (Errno::EACCES)
Permission denied - /Library/Ruby/Gems/1.8
Any workaround for it I am a newbie to ruby so don't know what to do anyhelp will highly appreciated.
Being sudo might fix your problem, however when you are installing gems , its not a good idea to install them as sudo, so the preferred way of installing ruby on any machine is to install rvm (Ruby Version Manager) first and then install your ruby version.
Main advantages of having a ruby version manager are,
1 - allows you to install multiple ruby versions side by side
2 - allows you to install gems for each ruby version (via gemsets)
So to install rvm in your mac, check here
list of ruby version managers
Trying to install Ruby Gems (actually sinatra) on iMac-
Get these error messages
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions into the /Library/Ruby/Gems/1.8 directory
rubygems-2.1.11 mark$ gem install sinatra
rubygems-2.1.11 mark$ ruby setup.rb
ERROR: While executing gem ... (Errno::EACCES)
Permission denied - /Library/Ruby/Site/1.8/gauntlet_rubygems.rb
Any easy solutions?
Thanks!!
The easy solution is to not try to modify the version of Ruby that Apple installed for their own use.
Instead, use rbenv or RVM to install Ruby in a sandbox in your home directory where you can fold, spindle and mutilate it all you want.
If you go with RVM, take the time to read the entire installation page before beginning your install. Failure to do that is the #1 cause for problems using RVM. RBEnv on the other hand, is simpler but not as "feature-packed". Personally, I use and recommend the later.
I uninstalled RVM and re-installed using a single user installation using:
\curl -L https://get.rvm.io | bash -s stable
When I do bundle, it prompts for:
Enter your password to install the bundled RubyGems to your system:
I tried using the answer in "ERROR: While executing gem … (Gem::FilePermissionError)" which did not fix it.
Then, while trying to install the gem manually, I got:
Gem::InstallError: nokogiri requires Ruby version >= 1.9.2.
An error occurred while installing nokogiri (1.6.0), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.6.0'` succeeds before bundling.
then running gem install nokogiri -v '1.6.0' returned:
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions into the /Library/Ruby/Gems/1.8 directory.
I checked all the similar posts on SO, but they didn't solve the problem. What am I missing?
I spent a lot of time fixing this issue on my MacBook. The gem update --system does not work for me.
At last, putting the following code in the ~/.zshrc file and create a new zsh session works for me.
export GEM_HOME="$HOME/.gem"
export GEM_PATH="$HOME/.gem"
after you install RVM you still need few more steps:
Load RVM to the current shell:
source ~/.rvm/scripts/rvm
Usually this would not be needed if you close and open your terminal again
Install ruby:
rvm install ruby
Use ruby:
rvm use ruby
The last step is very important as your error message mentioned system ruby not the one controlled by RVM.
Make sure to update your system rubygems with this command : sudo gem update --system --no-user-install.
bundler use it instead your local version and your bundler version could be incompatible with your system rubygems.
It works for me ;)
When attempting to run any rake, rails or bundle commands, I get following error:
/home/username/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': libcrypto.so.1.0.0: cannot open shared object file: No such file or directory - /home/username/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/x86_64-linux/digest/sha1.so
I have tried rvm pkg install openssl, rvm remove 1.9.3, rvm reinstall 1.9.3, reinstall bundler and all gems. I read on another forum that I may have to uninstall rvm, ruby and rails and start from scratch. Ugh - really?
Thanks in advance.
you need to read and follow the instructions displayed with:
rvm requirements
then remove the rvm installed openssl:
rm -rf $rvm_path/usr/
and reinstall ruby:
rvm reinstall 1.9.3-p194