Why can't I install Rails on Lion using RVM?

后端 未结 14 1285
孤独总比滥情好
孤独总比滥情好 2020-11-29 16:40

I\'m running into issues trying to install Rails on OS X Lion using RVM.

So far, I have done the following:

  1. Installed Mac OS X Lion Version 10.7 (Build
相关标签:
14条回答
  • 2020-11-29 17:06

    If that still doesn't work add --force. So this becomes:

    CC=/usr/bin/gcc-4.2 rvm install ruby-1.8.7 --force

    0 讨论(0)
  • 2020-11-29 17:07

    Fixed it!

    The answer was actually on one of the links I posted above. Before installing a version of ruby (rvm install 1.8.7) I needed to run "export CC=/usr/bin/gcc-4.2". With that in place, everything ran smoothly.

    If you don't want to have CC permanently exported, you can do CC=/usr/bin/gcc-4.2 rvm install 1.8.7

    If you have already installed ruby 1.8.7. Just do CC=/usr/bin/gcc-4.2 rvm reinstall 1.8.7

    0 讨论(0)
  • 2020-11-29 17:10

    This is not related to RVM, but if what you are looking for is a local development environment for Lion you may want to give a try to RubyStack It is a free, open source all-in-one installer for Apache, MySQL, Ruby, Rails, etc. It does not require compilation and it is self-contained so if you do not like it you can simply remove the installation directory and you are done. Disclaimer: I'm one of the RubyStack developers :)

    0 讨论(0)
  • 2020-11-29 17:12

    My solution was to override the /usr/bin/gcc symlink in the terminal. Here's how I did it:

    https://plus.google.com/101970693023462019144/posts/eYVLvMCqTmc

    This not only fixed my RVM installation, but also made sure that installing gems with native extensions (like rmagick) work.

    0 讨论(0)
  • 2020-11-29 17:15

    CC=/usr/bin/gcc-4.2 rvm install 1.8.7 did not work for me, I used CC=/usr/bin/gcc rvm install 1.8.7 and it did (checking with "which gcc")

    0 讨论(0)
  • 2020-11-29 17:19

    Instead of "export CC=/usr/bin/gcc-4.2" do "export CC=gcc" (xCode 4.2.x should be installed).

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