Rails 3 on Mac OSX Snow Leopard
I used to work with rails 2.3.8 and I wanted to know all the buzz around Rails 3, everybody knows that it’s a new development beast.
So I decided to install it and after a lot of digging on the internet, I managed it to install it, one requirement for me its that I *need* both RoR running, so I go with the RVM approach, and even without this requirement, it’s the recommended approach (not by me but recommended by a good friend and a real ruby/ror expert).
Why RVM ? for certain gems you will need ruby version 1.9.2 (1.9.1 has known bugs, and rails will throw you a warning if you choose this), and the snow leopard version is 1.8.7, so you will need this. Explaining RVM goes beyond the scope of this tutorial, so I will recommend you to read the basics from the RVM page and also this tutorial of a good friend.
1. Before you start be sure that you have the xcode tools at least on version 3.2.1 (1613) you won’t be able to do anything without this, so go ahead to developer.apple.com and grab it, its a little big (2.9 gb the current version), so you better start right now.
2. You will need git and curl, so I recommend you to use macports, but you can also install it from different sources
3. Install RVM, the instructions are very strightforward and almost a copy & paste from this page, but I will wrote the commands here, just to make it as complete as possible
- bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )
4. Configure RVM, this is open your .profile (this is the apple recommended, but if you override this, and used bashrc you will add it there), and then write this line at the end of the file (if you are a linux user and you are here for coincide please see the RETURN issue on the install page, specially ubuntu/debian ones)
- [[ -s "$HOME/.rvm/scripts/rvm" ]] && source “$HOME/.rvm/scripts/rvm” # This loads RVM into a shell session
After adding this, you know the steps, load a new console, and you can test it whit this command
- type rvm | head -n1
It *have* to return “rvm is a function” otherwise, please refer to the troubleshooting section of the RVM install page.
5. Now, time to install ruby 1.9.2.
- rvm install 1.9.2
6. Once is installed you can switch to this version with this command
- rvm 1.9.2
you can check the installed version with
- ruby –version
7. Create a new gemset (read more about gemsets here)
- rvm gemset create ror3
Switch to this gemset
- rvm gemset use ror3
8. Before installing the rails gem, you need 2 gems, rdoc and rubytree, otherwise the installation will fail
- gem install rdoc rubytree
9. Now install rails
- gem install rails
10. Bonus track, some commands don’t work well without this gem, install it also
- gem install sqlite3-ruby
And you are done!!! Happy coding
.
08.4.10Jailbreaking iOS4, the good, the bad and the ugly
Finally after waiting, and waiting the expected jailbreak for iOS4 came, the problem was I had a 3.1.3 “spirited” iPhone, so, the pwned version wont work for me. But thanx to @comex (et al) the great jailbreakme came, and I can join the iOS4 party.
The good:
Fast, I can’t believe its my old 3GS, is blazing fast, even with some “background jobs” its faster than 3.1.3. Another good things are folders, I used to have about 6 pages of apps, now I only had 2
The bad:
I can’t get to enable the “tethering” option on preferences, you can use the program tether (I kind of dislike it because its actually a socks proxy, not a NAT or something more native), or you can use MyWi4 , I used to like this on 3.1.3 but 2 things made me think about it, 1. you can not enable bluetooth tethering anymore, you can do USB tethering and wifi, but for example for my linux laptop I can no longer use bluetooth
, 2. When you install MyWi4 it depends on a package mobilesubstrate, and this breaks a lot of things (and I’m not blaming anyone, I’m just saying this breaks things), for example, the “always on” functionality on skype, no longer works. check update, this is now working
Update: ( http://twitter.com/saurik/status/20294560499 )
The ugly:
I really hate that even applications that system preferences stays working on background, I might be wrong here (can be only showing the icon for example), but almost every app stays on this “taskbar” (the one you get when you doble click on the home button), and yes, the battery suffers even with only the skype running.
Well, anyway, I can’t go back , so I hope the hacking team can get the tether toggle enabled again. Consider this post a big thanks to the jailbreak team
.
07.31.10Playing with geektool (first the lyrics)
I always work with music, and I sometimes like to sing, so I want to see the lyrics of the current song, without opening itunes, and then the properties, so I use the Geektool project (a little old, but it works wih 64bits kernel), this app, will enable you to run commands and put the output on the wallpaper, you can see a lot cool screenshots on the developer site.
I will stick on the basics, I only want my lyrics (and some ps ax info).
So this scripts will help you to do this, there are 3, “itunes_artist_lyrics.sh” will get you both artist name/title and lyrics, and “itunes_artist.sh” will get you only the artist name/title, and itunes_lyrics.sh will get you the lyrics (if you want to run it on different output windows). By the way, this script don’t open itunes if it’s not running .
You can download it here -> (or download the git repository)
http://github.com/warstories/Geektool-Scripts
If you don’t want to clone the git repository, I added you a zip on github:
Download release 1.0 from git
This is a screenshot on how I show the lyrics, may be simple, but It works :
(you can se the lyrics on the left, some process information on the center, and the day on the right just above the watermark)
Next time I will try to load the artist cover and get it on the desktop with geektool, but for now, lets just listen to Arctic Monkeys, 505 (I can’t stop listening this song).
02.19.10iPhone USB tethering, error 0xE800006B, OSX 64Bit Kernel
Yeah thats right!, It took me too long to realize that, but its true.
You CAN NOT do usb tethering with a 64Bit Snow Leopard Kernel, I guess the drivers are still 32Bits.
You will not find this info on apple because, first tethering is not available on many countries (yes I have a jailbroken iPhone I’m not ashamed of that), and second the 64bit kernel is still targeted to servers, not users.
But I guess you are a power user
, so don’t waste more time trying via usb, and do the tether stuff with bluetooth, it works great
.
Update Aug 2 / 2010, Today I updated to itunes 9.2.1 the usb tethering is now working on 64 bit kernel
.
09.21.09Psychedelic process
I really like this process, To bad is not 64 bit xD

lsd process in snow leopard
Flex 3 / SVN plugin (subclipse) / change credentials / OS X
For a complex reason I couldn’t understand the SVN plugin of eclipse don’t have an interface for delete/update users for repositories, so if you want to change you current user you actually have to delete the “keyring”, that is a special file where eclipse saves all the login information of your repositories… yes… all the passwords.
So after a search in google with no luck, I found that the location of the configuration files:
@user.home/Documents/Flex Builder 3/configuration
BUT BEWARE READER….
All the configuration files are stored in hidden files, and I mean the filename starts with a “.” dot, if you go to the finder you will find nothing… apparently… you actually had to dig in your terminal skills (or configure the finder to show hidden files), and delete the damn file:
.keyring
And eclipse will ask for passwords again…
The worst thing… you had to enter ALL your passwords again.
09.14.09CDU-680 + Snow Leopard
Well the short answer, it works, but in the 32 bit kernel, it only gets the red led on 64 bit kernel.
I have searched around google and the Franklin Wireless page and found nothing, so I decided to install, ( I had a clean snow leopard), and it works.
I searched here:
http://www.fklt.com/support.php
There’s nothing in the forums or in the page about snow leopard support, so I think the 64 future is uncertain, only time can tell.
So if you are willing to sacrifice the great 64 bit performance for 3G connectionm go ahead, it will work
09.9.09Mysql 5.1.38 No mountable file systems / Snow Leopard 64bit Kernel
So… you finally decide to search in google about this problem, it took me 5 tries, before doing it.
So the short answer… the image for mysql is UDF, and appears like the UDF driver is still 32 bits, and I guess if you are here, is because you are running on the 64bit kernel…
Well this is the price for early adopters, you have to boot in 32 bits kernel to be able to mount it on snow leopard
Long history, and a linux workaround (?):
http://forums.mysql.com/read.php?11,278794,278794#msg-278794
09.6.09OSX Firewire external hard drive disconnecting
Most of the Mac users did a brave thing last week, we all upgrade our OS to the latest and snowiest leopard in town… some of us with mixed luck…
The thing that I had troubles with, is a beautiful firewire 800 external disk drive (a gift from a very good friend), appears since I upgraded begun to disconnect randomly, but with a twist, when it was connected via USB, nothing happen.
I had to tell that I did a clean install of snow leopard (yes you can do it with the upgrade disk).
When I remember that setting, I realize that all my setting were wiped, so I look into the energy preference panel, and there was my answer, the option “Put the hard disk(s) to sleep when possible” was selected, seems like its a firewire disk it actually sends the sleep command.
I disable it for the battery and power adapter profile and my problem was fixed.
Hope this helps to save some time for someone in google.
07.16.09MultiSafari (not a multiple-zoo)
During the stage of css/html testing you have to test with multiple web browsers and operating systems.
Unfortunately in Mac OS X its a little difficult to have multiple Safari versions, since the Webkit framework is what is updated and webkit is system-wide, you can’t have both at the same time…
Until I discover this clever man, who embed the webkit in an app, so you can have your own safari 3 and safari 4 running on your mac… so you can test everything … go and download it, you will never regret it:

| Posted in RoR, development, osx | 1 Comment »