News for hackers. Stuff that matters.
Re:Using /usr/local by jayferd on Wednesday September 12, 2012 @04:04AM (#4509634)
+1.

At a previous job, I spent hours rebuilding a ruby gem where someone had carelessly hard-coded "#!/usr/local/bin/ruby" into all of their executables.

Even if it looks like it works, don't do it! Stick to "#!/usr/bin/env ruby" for maximum compatibility, please.

Re:Using /usr/local by thwest on Wednesday September 12, 2012 @11:05AM (#4510982)
Coming from a c and python perspective, I'm amazed that you even can specify which ruby to run it with. Either its a compiled binary, or you call the interpreter with the code object as an argument. What is the design impetus for mixing scripting and executable styles this way?
Re:Using /usr/local by jayferd on Wednesday September 12, 2012 @11:29AM (#4511093)
Shebangs (#!) have been around for quite a long time. It's actually really handy to be able to write a script that you can execute as a command. See https://en.wikipedia.org/wiki/Shebang_(Unix)
Re:Using /usr/local by masklinn on Wednesday September 12, 2012 @12:59PM (#4511634)
> Coming from a c and python perspective, I'm amazed that you even can specify which ruby to run it with.

Erm... you can do the exact same thing in Python, you know...

Re:Using /usr/local by alexchamberlain on Wednesday September 12, 2012 @04:18AM (#4509668)
Was this a publicly available gem? Did you pass your feedback upstream?
Re:Using /usr/local by jayferd on Wednesday September 12, 2012 @07:07AM (#4510082)
It was an obsolete gem that our obsolete code still depended on. There's reasons I don't work for that company anymore :)