Skip to content

Instantly share code, notes, and snippets.

@imathis
Created July 25, 2011 16:49

Revisions

  1. imathis revised this gist Aug 8, 2011. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -14,7 +14,7 @@ If that returns a blank line, you've done it right. Now we're back with a clean

    Reinstall ruby, using gcc as the compiler temporarily:

    CC=/usr/bin/gcc-4.2 rvm install ruby 1.9.2
    CC=/usr/bin/gcc-4.2 rvm install ruby-1.9.2

    After that, you should be able to

  2. imathis revised this gist Jul 28, 2011. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@ First, you need to install XCode 4.x, which is now a free (though hefty!) downlo

    Next, what you need to do is clear out your rvm ruby and the associated gems (make sure you are cd'd into your octopress repository then do:

    rvm remove ruby 1.9.2 --gems --archive
    rvm remove ruby-1.9.2 --gems --archive

    which will clear everything out so that you can start from scratch. Obviously, if you have other stuff you've installed for other purposes using RVM, be careful with this. If you previously had the export CC line in your shell file, remove it, source the script (or restart Terminal), and then check that CC is no longer set by doing:

  3. imathis created this gist Jul 25, 2011.
    24 changes: 24 additions & 0 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,24 @@
    The segfault problem with posix_spawn is indeed caused by Lion's compiler being LLVM and not GCC by default. However, when I installed RVM, the notes suggested that on Lion you need to add `export CC=/usr/bin/gcc-4.2` to your shell startup file (`.bashrc` or `.zshrc` as appropriate). I did that, but it seems that's what caused problems: while ruby 1.9.2 needs you to use GCC to install it, using the same compiler for the gems apparently causes breakage.

    First, you need to install XCode 4.x, which is now a free (though hefty!) download from the Mac App Store. Without that, you have no gcc, so you won't get anywhere ;-)

    Next, what you need to do is clear out your rvm ruby and the associated gems (make sure you are cd'd into your octopress repository then do:

    rvm remove ruby 1.9.2 --gems --archive

    which will clear everything out so that you can start from scratch. Obviously, if you have other stuff you've installed for other purposes using RVM, be careful with this. If you previously had the export CC line in your shell file, remove it, source the script (or restart Terminal), and then check that CC is no longer set by doing:

    echo $CC

    If that returns a blank line, you've done it right. Now we're back with a clean slate.

    Reinstall ruby, using gcc as the compiler temporarily:

    CC=/usr/bin/gcc-4.2 rvm install ruby 1.9.2

    After that, you should be able to

    gem install bundler
    bundle install

    and all will be well!