From: "Shot (Piotr Szotkowski)" Date: 2009-12-13T07:58:36+09:00 Subject: Re: Is it possible to force a Ruby program to run as a proc name different than "ruby"? --Nq2Wo0NMKNjxTN9z Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable I=C3=B1aki Baz Castillo: > However in /proc/PID/status I still have the same described > issues: "Name: ruby1.9", so I cannot do "killall rb_program". > This can be solved by using: > #!/usr/local/bin/ruby1.9 > rather than: > #!/usr/bin/env ruby1.9 > but of course hardcoding the location of ruby is not very good > approach (specially when you want your code to run on any Linux > system). I was wondering about exactly this problem recently. I=E2=80=99m using hand-rolled Ruby 1.9.1 and 1.8.7 versions in ~/opt =E2=80=93 and once I fin= ally got to rolling my own gem I found out that when RubyGems install an executable, they put a wrapper script in the given Ruby installation path, with the hashbang hardcoded to that interpreter=E2=80=99s binary. In other words =E2=80=93 while the executables in my repo start with =E2=80=98#!/usr/bin/env ruby=E2=80=99 (and so pick up the =E2=80=98current= =E2=80=99 Ruby interpreter), once I roll and install a gem RubyGems create a custom executable wrappers for them, and the ones installed with Ruby 1.9.1 start with =E2=80=98#!/home/shot/opt/ruby-1.9.1-p376/bin/ruby=E2=80=99 (and if I link = them from my ~/bin I don=E2=80=99t even need to do any $PATH munging to get them runn= ing through a given Ruby binary). Hence, my conclusion is that if you turned your code into a gem prior to installing it, you could still keep the =E2=80=98#!/usr/bin/env ruby1.9= =E2=80=99 hashbang in your repo (and for testing), but once you want to get a given version into =E2=80=98production=E2=80=99, RubyGems will turn that = into =E2=80=98#!/usr/local/bin/ruby1.9=E2=80=99 upon the gem=E2=80=99s installat= ion. =E2=80=94 Shot --=20 I should like to find the person who decided that since =E2=80=98bookmarks=E2=80=99 and =E2=80=98history=E2=80=99 were both lists o= f URLs they ought to be integrated in a single database. I should like to shake him warmly by the throat until his head comes off. [Roger Burton West on Firefox, hates-software] --Nq2Wo0NMKNjxTN9z Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkskH14ACgkQi/mCfdEo8Ur7IQCgoJZuNRj8yT+ERRcfPgBhtcuO M38AnRlgEz8p0802CTQV/NCUv4ivPJ8V =U7ko -----END PGP SIGNATURE----- --Nq2Wo0NMKNjxTN9z--