How do I fix the “You don't have write permissions into the /usr/bin directory” error when installing Rails?

后端 未结 9 1768
滥情空心
滥情空心 2020-12-07 07:56

I\'m trying to install Rails 3 on a brand new MacBook Pro running OS X 10.6.3, Ruby 1.8.7, and Rails 2.3.5 and I\'m wondering if I\'ve hosed myself. So far, I\'ve run these

相关标签:
9条回答
  • 2020-12-07 08:00

    On macOS High Sierra, this solved my issue:

    sudo gem update --system -n /usr/local/bin/gem
    
    0 讨论(0)
  • 2020-12-07 08:01

    use -n parameter to install like for cocoapods:

    sudo gem install cocoapods -n /usr/local/bin
    
    0 讨论(0)
  • 2020-12-07 08:05

    You can use sudo gem install -n /usr/local/bin cocoapods

    This works for me.

    0 讨论(0)
  • 2020-12-07 08:08

    This Error hit me after installing RVM correctly. Solution: re-boot Terminal.

    Reference RailsCast's RVM Install tutorial.

    0 讨论(0)
  • 2020-12-07 08:10
    sudo gem install cocoapods --pre -n /usr/local/bin
    

    This works for me.

    0 讨论(0)
  • 2020-12-07 08:13

    For me, something different worked, that I found in on this answer from a similar question. Probably won't help OP, but maybe someone like me that had a similar problem.

    You should indeed use rvm, but as no one explained to you how to do this without rvm, here you go:

    sudo gem install tzinfo builder memcache-client rack rack-test rack-mount \
      abstract erubis activesupport mime-types mail text-hyphen text-format   \
      thor i18n rake bundler arel railties rails --prerelease --force
    
    0 讨论(0)
提交回复
热议问题