Originally published at Lost Entropy. Please leave any comments there.
Rails on Mac OS X 10.5 (Leopard to most people), is fantastic. It’s already there, and it just works. From the very second Leopard finishes installing, you can run rails yourAppName
in a terminal, and boom, it gives you a default Rails app. Move into the directory that just got created with cd yourAppName
, and start Mongrel running with script/server
. Fire up Safari, head on over to http://0.0.0.0:3000/, and you can see your app running. Awesome!
However, try and move this to a non OS X server, and it won’t work, because /public/dispatch.cgi
, /public/dispatch.fcgi
, and /public/dispatch.rb
all have the following line at the top:
#!/System/Library/Frameworks/Ruby.framew
ork/Versions/1.8/usr/bin/ruby
This line should say:
#!/usr/bin/ruby
This change that Apple have made isn’t necessary for Rails to run on OS X, as there’s already a symlink in /usr/bin/ruby
to make this extra code unnecessary. I’m a little confused by Apple’s motives here. A mistake? A mischevious way of increasing OS X Server sales, by making it harder for people to port their apps away from OS X? Either way, it’s an unneeded frustration. Fix it, Apple!