Today is Leopard day!

Posted by David October 26, 2007 @ 08:46 PM

OS X 10.5 is shipping today under the Leopard moniker. Besides being a great upgrade to a wonderful operating system, it's also the first version of OS X that ships with Rails in the package. Apple has done a phenomenal job including all the good stuff from the Ruby and Rails world into the developer tools that come with the OS.

So out of the box you get Ruby 1.8.6, Rails 1.2.3 (which is just a "gem update rails" call away from being 1.2.5), Capistrano, SQLite-bindings, and so much more. No more need for compiling your own Ruby. It's great. See all the changes in What's New in Leopard.

The only minor snag is that in order to install the MySQL C bindings for Ruby, you have to be quite particular on the command line. Here's the cheat line you need to install (read more at macosforge):

sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config

So happy Leopard day, folks!

Posted in Sightings | 36 comments

Comments

  1. Animesh on 26 Oct 21:57:

    Fanboys!

    Can we get the tutorials in mp4 or mpeg format?

  2. Kevin Marsh on 26 Oct 22:12:

    Still having weird issues:

    $ irb -rrubygems -rmysql /Library/Ruby/Gems/1.8/gems/mysql-2.7/lib/mysql.bundle: dlopen(/Library/Ruby/Gems/1.8/gems/mysql-2.7/lib/mysql.bundle, 9): Library not loaded: /usr/local/mysql/lib/mysql/libmysqlclient.15.dylib (LoadError) Referenced from: /Library/Ruby/Gems/1.8/gems/mysql-2.7/lib/mysql.bundle Reason: image not found – /Library/Ruby/Gems/1.8/gems/mysql-2.7/lib/mysql.bundle from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:32:in `require’ from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/irb/init.rb:253:in `load_modules’ from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/irb/init.rb:251:in `each’ from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/irb/init.rb:251:in `load_modules’ from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/irb/init.rb:21:in `setup’ from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/irb.rb:54:in `start’ from /usr/bin/irb:13

  3. lrz on 26 Oct 23:07:

    I updated the instructions in http://trac.macosforge.org/projects/ruby/wiki/Troubleshooting#IcannotbuildrubymysqlonLeopardwithmysql.combinaries . Please give it a try. It is still unclear why Tiger is not affected, we will investigate more and post updates in the wiki page.

  4. Linux on 27 Oct 01:04:

    Linux FTW

  5. coolmenu on 27 Oct 05:51:

    thanks lrz,that’s ok

  6. Apple sucks on 27 Oct 06:00:

    Apple/Mac sucks

  7. Haters suck on 28 Oct 05:53:

    It’s easy to hate chocolate when all you’ve eaten is carob chips

  8. Martijn Engler on 28 Oct 10:09:

    Kevin: I’ve had that error too, even on Tiger. I was able to fix it with the following commands:

    cd /usr/local/mysql/lib sudo mkdir mysql cd mysql sudo ln -s /usr/local/mysql/lib/lib* .

    Good luck! :)

  9. stid on 28 Oct 13:17:

    There is a problem with “gem update—system” in leopard, if you do that, all the previously installed gem disappear. Probably this is something related to ENV path or similar. In any case my gem installation is just blow up.

    Very bad.

  10. Rutger on 28 Oct 14:59:

    Works like a charm, thanks for the valuable info!

  11. nicholas on 28 Oct 15:00:

    I’ve had the same issue as stid. I did a gem update—system, and gleefully watched it work it’s magic. Then i went to try and install a new rails app and it gave me an error. The issue is there are two gem repos in Leopard the one under /System/Frameworks/Ruby* and the user one (in your home /Library folder). I think to fix it you need to add the System repo back into the gem_path using an env variable??

    I have an apple discussion open for it here: http://discussions.apple.com/click.jspa?searchID=-1&messageID=5668663

  12. Nick on 28 Oct 17:56:

    You may need to install XCode on top of Leopard to get the mysql-ruby bridge. I ran into a ‘could not find ruby headers’ error and installing XCode solved my problems.

  13. Twogigglez on 29 Oct 06:56:

    I went the Mac Ports route.

    Something about messing around in /usr/bin and /usr/lib gave me the heebie-jeebies. (This may be n00b superstition.)

    In any case, there were some issues with compiling Ruby on Leopard, but the patches provided by Apple appear to have made their way into MacPorts. Worked without a hitch for me!

    That said, good on Apple for making Rails a first-class citizen in the new OS. :)

  14. pete on 29 Oct 13:58:

    java was a first class citizen as well, so don’t count too much on that…

  15. more on env variables on 30 Oct 02:10:

    If you did a gem update—system command you’ll probably find yourself up the creek with no paddles. The problem is the paths to the two repos get messed up when you update rubygems. To fix you can add the paths to your .profile and also add a ~/.MacOSX/environment.plist file to fix it for the MacOS login session. See the links below for details:

    http://discussions.apple.com/thread.jspa?threadID=1200950&tstart=0

    http://discussions.apple.com/thread.jspa?threadID=1202925&tstart=0

  16. virtual.office.vietnam on 30 Oct 09:59:

    Travel to Vietnam

    Specializing in custom-made Vietnam tours & Vietnam travel. We shall endeavor to make your Vietnam holiday a memorable one. Good quality and competitive prices is our motto, Join us and find out for yourself. We’ll respond within 24 hours! Please visit our site: http://www.vietnam-travelinfo.com Vietnam travel tours holiday operator

  17. lrz on 30 Oct 13:58:

    We received many questions, and decided to open a FAQ. Please check it out:

    http://trac.macosforge.org/projects/ruby/wiki/FAQ

  18. T on 30 Oct 14:58:

    dumb question, but how do I build a new application in Leopard? Can I use xCode, Coda?

  19. Michael Mahemoff on 30 Oct 21:02:

    The comments above are the main reason I’m not rushing to Leopard.

  20. Douglas F Shearer on 30 Oct 21:12:

    Thanks for this David, saved a lot of time playing with compile settings.

  21. Jaroslaw Zabiello on 31 Oct 10:27:

    Apple made a very stupid decision to exlude gem_server from embeded Ruby in Leopard. I had to remove this stupid Ruby installation and replace it with MacPorts’s version.

  22. Robert Walker on 31 Oct 16:46:

    Hey folks,

    I just noticed that the MySQL package downloads now include a universal binary for Mac OS X. Does this mean the above install note can be ignored and just use the standard gem install when using the universal build of MySQL?

  23. Robert Walker on 31 Oct 16:49:

    Wait, Sorry I just realized that it is a tar package that has a universal binary so ignore my last comment. I’d prefer just using the package format and using the posted install note.

  24. Peter M on 01 Nov 14:21:

    Is MacPorts safe on Leopard even though it doesn’t seem to have updated yet for it? I’m trying to figure out the best way to install mysql.

  25. Joannou Ng on 01 Nov 23:19:

    Migrating MySQL 5.0.45 to Mac OS X 10.5 Leopard http://blog.tomatocheese.com/archives/2007/11/1/migrating_mysql_to_mac_os_x_leopard/

  26. Apple sucks on 02 Nov 01:01:

    and fanbois sucks even more

  27. Markus Arike on 02 Nov 21:28:

    Why do so many people seem to depend on MacPorts for installation issue involving Ruby, MySQL, etc?

    Ruby compiled fine on Tiger and it should compile fine in Leopard. You don’t really need to “mess around” in /usr/bin. Make a directory in /usr/local to hold the src.

    Dan Benjamin’s step-by-step should work fine for Leopard. http://hivelogic.com/narrative/articles/ruby-rails-mongrel-mysql-osx

    As far as MySQL, there are usually MySQL binaries for OS X.

  28. Morten Matras on 03 Nov 22:03:

    Hmm… I’m still not convinced about moving to Ruby on Rails from Java.

    Is it worth it?

  29. pete on 05 Nov 13:30:

    Morten: before you should for example consider wicket (now even under apache.org)

    http://wicket.apache.org

    Especially I don’t like refactor support in ruby (if there is one?!)

    e.g., rename your controller from ‘UserController’ to ‘UsersController’, then have a dozen unit tests fail and change a 20-30 files manually (this really sucks bad :-)

    Also, java has about any 3rd party support library you could think about

  30. Daniela on 06 Nov 14:28:

    I am on leopard, but was one of the idiots who had FileVault on while upgrading, so ended up having to start from scratch. Since I now have ruby and rails and everything already installed, why would I have to install anything? Except mysql, that doesn’t seem to be there. Can anybody tell me how to do that? I don’t really understand this paths business and don’t want to dabble too much. Or where can I find out how to go about it? Thanks

  31. Nathan on 07 Nov 21:16:

    I did the gem update—system as well, but I used Timemachine to roll my /Library/Ruby folder back and now I am fine.

    Don’t do gem update—system.

  32. globtrotter on 08 Nov 23:56:

    Having problems with Ruby and Mac OS X ? Sounds familiar. Gentoo is the answer – enormous flexibility, control and stability – you’ll never look back.

  33. Duffman on 09 Nov 14:44:

    “Having problems with Ruby and Mac OS X ? Sounds familiar. Gentoo is the answer – enormous flexibility, control and stability – you’ll never look back.”

    If you are not able to do the trick explained in this article, don’t hope to be able to solve any problems with Rails even on a Gentoo.

    The problem is not the OS, it’s you …

    PS: anyway, I would much prefer to use Solaris instead of Linux

  34. me on 13 Nov 14:02:

    this is how i install mysql whenever i need to, lots of info, and dead simple.

    http://www.entropy.ch/software/macosx/mysql/

    and personally, who cares what the hell we all use, as long as we make working apps right?? i really couldn’t care less. and since this was an entry on leopard, if you hate mac so much, why bother reading it?

  35. tanyanka on 16 Nov 18:44:

    which version of mysql did people who got it installed successfully who also followed this recomendation use for lepoard? It gives the options to choose: mysql 2.7.3 (mswin32) mysqo2.7.1 (mswin32) mysql 2.7 (ruby) mysql 2.6 (ruby)

  36. Andreas Berg on 23 Nov 09:12:

    @Morten: Why don’t you go step by step – move to Grails first?