On 27 Jan 2009, at 21:38, Joseph Pecoraro wrote: > This is the perfect opportunity for me to ask about this. > I always thought it would be good to hardcode to the default > system ruby interpreter because you are: > > 1. sure that it exists
Unfortunately this is not the case in practice. Lots of users delete their default ruby, some because they blindly follow tutorials about how to install cutting edge ruby/rails, others because they (presumably) do not fully understand PATH setup but want everything to use their custom ruby install. > 2. it is the version that you expect it to be (unless a root > user changed it). On Leopard, yes. But on Panther the default ruby is 1.6, which we do not support, so a user running TextMate on Panther will need to do his own install of ruby 1.8 and setup PATH appropriately (that said, recently Panther support was officially dropped, as I have problems building a Panther compatibile binary with latest developer tools). There is also something to be said about detecting problems with new versions as soon as possible (while only few users are affected), so in that sense, it is practical to have TM use “latest ruby on the system”. > However, I typically use /usr/bin/env ruby in my scripts. > Are there situations where it is better to use one of these > over the others? > > 1. ruby (which may be defined by the user's path) > 2. /usr/bin/ruby (system default) > 3. /usr/bin/env ruby (doesn't rely on the shell to look in path) In general, use #1, for a shebang though no PATH searching is done (so absolute path is required), this is why #3 is used (so the system actually executes the ‘env’ shell command, which then executes ‘ruby’ and searches the locations listed in the PATH variable). A minor concern is that TextMate support files (like commands) are used by other editors on other platforms, so here ruby might not be in /usr/bin. _______________________________________________ textmate-dev mailing list [email protected] http://lists.macromates.com/listinfo/textmate-dev
