gem install rails ERROR: While executing gem … (Errno::EACCES)

前端 未结 3 775
暗喜
暗喜 2021-01-12 09:47

I somehow messed my $PATH up. (changed it) and my ruby and rails gems weren\'t working. What I did in efforts to fix this was to reinstall RVM. Now my ruby works fine in the

相关标签:
3条回答
  • 2021-01-12 10:00

    I had this problem in Ubuntu, but it was because I didn't installed the rvm with "Run command as a login shell", after the installation of rvm they told about this, and the link to look for the information to enable in ubuntu. Here's the link: https://rvm.io/integration/gnome-terminal

    For RVM to work properly, you have to check the 'Run command as login shell' checkbox on the Title and Command tab of gnome-terminal's Edit ▸ Profile Preferences menu dialog, in case the menu is missing right click the terminal app and navigate Profiles ▸ Profile Preferences.

    0 讨论(0)
  • 2021-01-12 10:08

    I'm running 10.8.5 OSX and was trying to install Rails with Ruby 1.9.3-p448 - so I don't know if it's exactly the same problem, but by looking in the mkmf.rb code where it failed, I found that the problem was that the basic CC command wasn't running. For some reason, it needed to search for the folders in /usr/local, and for some reason, /usr/local was set to 740 permissions on my install (which I had gotten from someone else so not sure what he had done prior to my getting the machine.)

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

    0 讨论(0)
  • 2021-01-12 10:11

    Like Dave pointed out up there, there should be no need to sudo any Gem installation. You could try to reset the permissions on your RVM directory:

    sudo chown -R emKaro: ~/.rvm/
    

    and try your Gem instllation again. If that doesn't work out, you should consider removing your RVM installation and start over:

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

    There should really be no need for using sudo in any of this.

    0 讨论(0)
提交回复
热议问题