Mac OS X Mountain Lion “Rails is not currently installed on this system.”

后端 未结 11 1746
悲哀的现实
悲哀的现实 2021-02-01 08:42

I am on a fresh install of OS X Mountain Lion. I have installed rails via:

sudo gem install rails

Everything seems to install correctly, but wh

相关标签:
11条回答
  • 2021-02-01 09:14

    After a new

    gem install rails

    do

    rbenv rehash

    It worked for me.

    0 讨论(0)
  • 2021-02-01 09:15

    If you're using rbenv, don't forget to rbenv rehash after installing/updating ruby.

    0 讨论(0)
  • 2021-02-01 09:19

    Actually, /usr/bin/rails script is just a

    # Stub rails command to load rails from Gems or print an error if not installed.

    (Comment quoted from the very script's source)

    If Rails is installed, then it is loaded. Else, the script will throw the error you pasted in your question.

    0 讨论(0)
  • 2021-02-01 09:22

    I had the same problem.

    After typing:

    sudo gem install rails
    

    and installing rails correctly, just close the Terminal window and open again. Then type:

    ~ $ rails -v
    Rails 4.0.2
    

    So, reseting the Terminal window fix the problem.

    0 讨论(0)
  • 2021-02-01 09:25

    Our company uses a script to setup each new machine with a Rails dev environment:

    We've open source it, give it a try: https://github.com/platform45/let-there-be-light

    0 讨论(0)
  • 2021-02-01 09:27

    Use RVM http://rvm.io or rbenv to install newer Rails versions than what come pre-installed with OS X.

    Follow examples on the site https://rvm.io/rvm/install/ but basically:

    Install RVM: $ \curl -L https://get.rvm.io | bash -s stable

    You can then $rvm list known to see what Rubies are available to you (lots). And simply $rvm install 1.9.3 to get the most current version of Ruby (which as of this writing is ruby-1.9.3-p327)

    Set that ruby as your default $rvm --default use 1.9.3

    Create a default gemset to store your gems $rvm use 1.9.3@mygemset --create --default

    Then install Rails $ gem install rails will get you current which today is same as typing gem install rails -v 3.2.9

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