0

I'm developing a Ruby 1.9.2 / Rails 3.2.2 app and recently I had to buy a mac and now I migrating all my work from Ubuntu to Lion 10.7.3 Yesterday I finally got Rails installed through a very painful process due to compilation errors of Ruby. This command solves my installation:

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

During the various attempts, I had to install XCode 4.2 too and if I understand right, XCode is useless for ruby 1.9.2... isn't it?

So does anybody know if I can uninstall Xcode 4.2 without troubles ?

6 Answers 6

1

What you have now is the best set of tools for compiling rubies recomended by RVM.

Removing it will have few implications:

  1. You will not be able to install new rubies
  2. You will not be able to install new gems with native extesnions

If you want to remove Xcode 4.2 you will lose possibility for installing some software

  1. nodejs
  2. some gems like rb-fsevent
1
  • and so is better if I leave all in its place ;)
    – Sabre
    Mar 12, 2012 at 19:29
0

I wouldn't say that XCode is entirely useless for Ruby, just depends on what you're looking for. Syntax highlighting is decent, autocomplete w/o code hinting, and the repo tools are pretty solid. I've used it without too much complaint, but I tend to rotate through IDE / editor phases and keep a few flavors around. YMMV.

Aside from the IDE and SDKs, XCode provides gcc on OS X systems (which is why you installed it in the first place). There are other ways to accomplish this, but there's really no harm in having XCode lurking about and not using it.

2
  • Except for 5+ gigs of wasted drive space :) Mar 7, 2012 at 15:25
  • What I'm looking for is just working with Rails on OSX.. and Aptana is my favourite IDE for now... The point was that I don't like having some useless stuff running(or not) in my system...and in this case was 4-5 Gb o.O
    – Sabre
    Mar 12, 2012 at 19:32
0

I would upgrade to XCode 4.3 and install the CLI-Tools (compiler stuff etc.) than it should be save to remove XCode from your machine, since the compiler is separated and wont be uninstalled.

if you just remove XCode 4.2 (not the app itself but the developer tools) you wont be able to install some gems (gems with C extensions which need to be compiled) because it removes the compilers too.

lazy way: just keep how it is now :)

0
0

I have not done it, but you should be able to install GCC from here and get rid of xcode

https://github.com/kennethreitz/osx-gcc-installer

personally, I would leave xcode installed, unless drive space is an issue

1
  • drive space luckly is not an issue...so I think I'm going to leave all in its place
    – Sabre
    Mar 12, 2012 at 19:38
0

If you want a safe option downgrade to XCode 4.1. Do not upgrade to XCode 4.3 or you will start having random crashes on some compiled gems.

The best option for ruby development on OS X Lion is XCode 4.1 and exporting

CC=/usr/bin/gcc-4.2
in your .bashrc or .zshenv

This will allow you to compile ruby from 1.8.7 to 1.9.3 and all the gems you want.

1
  • During the installation process I was thinking to downgrade to 4.1 but finally I'm going to leave the 4.2 version.
    – Sabre
    Mar 12, 2012 at 19:40
0

As many people wrote, Xcode 4.3 seems to have issues, so better avoid this at least at this moment.

Additional note: Building Ruby 1.9.3 with Xcode 4.3, or clang compiler cause various problem. This is due to:

https://bugs.ruby-lang.org/issues/6080

This issue is resolved in development branch already.

I'm staying with Xcode 4.2.1, but I don't' recommend to set CC=gcc-4.2 in shell profiles. Instead, you can:

CC=gcc-4.2 ./configure

to configure, or

CC=gcc-4.2 rvm install 1.9.2

if you use RVM.

1
  • Additional Note: If you just need to make ruby to be built with Xcode 4.3.1, Change set mentioned in above link solves the issue. For convenience, I made a patch for RVM and it was merged. So if you happen to use RVM, get master branch of RVM and you can build with Xcode 4.3.1. (not on stable branch yet)
    – shigeya
    Mar 9, 2012 at 7:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.