How to get RVM to set correct gem path

后端 未结 3 516
囚心锁ツ
囚心锁ツ 2020-12-05 14:54

On a clean Mac OS X \"Snow Leopard\" install, I have a problem with RVM: It sets the Ruby path correctly but doesn\'t set the gem path. When I start a Rails server it mixes

相关标签:
3条回答
  • 2020-12-05 15:31

    Make sure you're always 'using' your Ruby version. (Ugh. RVM can be so annoying).

    rvm use 1.9.3 --default
    

    Also what does your .gemrc look like? I had to take out --user from mine.

    0 讨论(0)
  • 2020-12-05 15:34

    So after 1 1/2 days of torture, reading through at least 50 posts, and installing RVM, Ruby and Rails multiple times, I am finally able to use Rails in my RVM install.

    This was the last series of events that I did after installing RVM and Ruby the last time and then it worked:

    I removed these from .gemrc so back up your file if you do this:

    • gemhome: /home/[user]/ruby/gems
    • gempath: []
    • --remote

    then use

    rvm use 1.9.3 --default
    

    then

    gem install rails
    

    It seems the trick was:

    1. Change the .gemrc file.
    2. Do not create and use a gemset (rvm use 1.9.3@rails3) before installing Rails.
    0 讨论(0)
  • 2020-12-05 15:55

    Make sure you do a gem install rails after setting the default Ruby version:

      rvm use 1.9.2-head
      gem install rails
    

    and then check again with which rails.

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