Gem install rails ERROR: when executing gem ... (Errno :: EACCES)

I somehow messed up my $ PATH. (changed it) and my ruby ​​and rail stones didn't work. What I did to fix this was reinstalling the RVM. Now my ruby ​​works fine in the Terminal. When running gem install rails this welcomes me:

Permission denied - /Users/emKaro/.rvm/gems/ruby-2.0.0-p247/gems/atomic-1.1.13/test/test_atomic.rb

When I try to install rails via sudo gem install rails , I get this error:

ERROR: while executing gem ... (Errno :: EACCES)

I have Xcode installed with command line tools installed. I even went ahead to install GCC, but get the same error when I try to install rails.

This is a complete error message.

 ERROR: While executing gem ... (Errno::EACCES) Permission denied - /Users/emKaro/.rvm/gems/ruby-2.0.0-p247/gems/atomic-1.1.13/test/test_atomic.rb emmanuels-imac:~ siaW$ sudo gem install rails Password: Building native extensions. This could take a while... ERROR: Error installing rails: ERROR: Failed to build gem native extension. /Users/emKaro/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/Users/emKaro/.rvm/rubies/ruby-2.0.0-p247/bin/ruby --with-atomic_reference-dir --without-atomic_reference-dir --with-atomic_reference-include --without-atomic_reference-include=${atomic_reference-dir}/include --with-atomic_reference-lib --without-atomic_reference-lib=${atomic_reference-dir}/ /Users/emKaro/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/mkmf.rb:434:in `try_do': The compiler failed to generate an executable file. (RuntimeError) You have to install development tools first. from /Users/emKaro/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/mkmf.rb:519:in `try_link0' from /Users/emKaro/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/mkmf.rb:817:in `try_run' from extconf.rb:24:in `<main>' Gem files will remain installed in /Users/emKaro/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/gems/2.0.0/gems/atomic-1.1.13 for inspection. Results logged to /Users/emKaro/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/gems/2.0.0/gems/atomic-1.1.13/ext/gem_make.out 

I am the administrator of my computer and am running Mac OS 10.8.3. I would appreciate help installing the rails.

EDIT: Thanks @Christoph The only code that helped was to delete the RVM folder using sudo rm -rf ~/.rvm/ I tried only uninstal and it didn't work. Therefore, deleting the folder and then reinstalling the RVM does the job.

+7
ruby-on-rails gem
source share
3 answers

As Dave pointed out there, there should be no need to sue any Gem installation. You can try reset permissions in your RVM directory:

 sudo chown -R emKaro: ~/.rvm/ 

and try to install Gem again. If this does not work, you should consider removing your RVM installation and starting with it:

 sudo rm -rf ~/.rvm/ # remove your RVM directory 

In any case, it should not be necessary to use sudo.

+16
source share

I am running 10.8.5 OSX and trying to install Rails with Ruby 1.9.3-p448 - so I don’t know if this problem was the same, but looking in the mkmf.rb code where it failed, I found that the problem is that the main CC command was not launched. For some reason, he needed to look for folders in / usr / local, and for some reason / usr / local, 740 permissions were installed for my installation (which I got from someone else, so I'm not sure what he did earlier to my car.)

So, after I did chmod +x /usr/local , everything worked fine.

+3
source share

I had this problem in Ubuntu, but it was because I did not install rvm with the command “Run as a login shell”, after installing rvm they talked about this and a link to find information to include in ubuntu. Here's the link: https://rvm.io/integration/gnome-terminal

For RVM to work properly, you need to select the "Run the command as an input panel" checkbox on the "Name and command" tab in the gnome-terminal Edit ▸ "Profile Settings" dialog box, if there is no menu, right-click the terminal application and select Profiles "▸" Profile Settings. "

0
source share

All Articles