These days Xcode is getting installed directly from Mac App Store. For installation of Ruby on Mac OS X we need a C compiler. It used to be installed with Xcode in previous versions. In Xcode 4.3 that needs to be installed from Preferences of Xcode in the Downloads section, the "Command Line Tools" bit. When you click [Install] button you will be asked for your Apple Developer ID you have registered with as Apple Developer. I have put a wrong AppleID and I could not find where to change it in Xcode preferences. But because Xcode asked me if I want to store this information in my Keychain, I could find that in the keychain under daw2.apple.com name. This way Xcode will ask for Apple Developer ID again.

So far so good, the 171.7MB of Command Lind Tools are downloading, although the note under that installation explains that those are not really necessary:

Before installing, note that from within Terminal you can use the XCRUN tool to launch compilers and other tools embedded within the Xcode application. Use the XCODE-SELECT tool to define which version of Xcode is active.  Type "man xcrun" from within Terminal to find out more.

Downloading this package will install copies of the core command line tools and system headers into system folders, including the LLVM compiler, linker, and build tools.


If you want to use the compiler without installing the "Command Line Tools" you need first to set the path to Xcode. Run that as super user:  
> sudo xcode-select -switch /Applications/Xcode.app/
This way you can find where is the compiler:  
> xcrun -find cc  
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
> xcrun -find gcc  /Applications/Xcode.app/Contents/Developer/usr/bin/gcc

All the above came from that I wanted to install Ruby 1.9.3 on Mac OS X 10.7.3 Lion using rvm:
> rvm install 1.9.3
The above command will fail as it needs to use another compiler. Thanks to zzaman who answered to similar problem on Stack Overflow I have specified the compiler, which works:
> rvm install 1.9.3 --with-gcc=clang



Now I have 1.9.3-p0 under rvm 1.10.2 and another problem. Setting a default gemset is not working. 
> rvm use 1.9.3@3.2 --default

But with help from ashleyconnor the suggestion to get the head version of rvm helped. Now with rvm 1.10.3 the default gemset is working. This resulted also in getting Ruby 1.9.3-p125. Here we are with:
> ruby -v
ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-darwin11.3.0]
> rails -v
Rails 3.2.2

 
After many months of postponing the upgrade from Snow Leopard to Lion, observing others using Lion, for office work and for web development work, finally I have decided to at least try the upgrade.

I've got myself a bigger HDD as the one in the laptop was already full. Friday night all the work for the week was finished, so if I could make it over the weekend and it worked, I could start on Monday working on Lion. The critical bit is to have the Ruby on Rails environment working. 

  1. I have cloned my disk with Carbon Copy Cloner into the new one. I left it over night, it took 5 hours for 300GB of data over USB.
  2. On Saturday morning I started installing Lion on the cloned drive. During the day I've run the Software Updates. At the evening I've logged into my account where I have the development set up. I checked if Pow was still running one of my applications locally. It didn't, but Webrick was enough and all rvm with different gem sets seemed to be fine. It was taking a while to convert emails (21GB) into the new Mail version. I left it overnight.
  3. Today morning I have looked into how the new Mail works. Finally I can read the email conversations normally. The Mail is splitting quoted parts of emails into separated emails within conversation and allows sorting it from oldest to newest and the other way round. I can now see the response under the quoted email even if the whole world is doing it in corporation style with responding above. Well done Apple!
  4. Suddenly Pow is working, no problem. I did not have to reinstall anything from my development workshop. I have decided to call it a day. I'm switching my work environment to Lion. 


Now onto swapping the drive inside the MacBook Pro...