Why does Rails generate the script/server, public/dispatch.*, etc. scripts with #!/usr/binruby1.8 on my machine (debian linux)? Why not #!/usr/bin/env ruby? Every time I create a new rails structure, I have to go through and change all those lines.
Joe Van Dyk wrote:> Why does Rails generate the script/server, public/dispatch.*, etc. scripts with > #!/usr/binruby1.8 > on my machine (debian linux)? Why not #!/usr/bin/env ruby? > > Every time I create a new rails structure, I have to go through and > change all those lines.Or, you could simply make a symlink to your ruby binary in the location that Rails is expecting it... -Brian
On Sunday 28 August 2005 12:22, Joe Van Dyk wrote:> Why does Rails generate the script/server, public/dispatch.*, etc. > scripts with #!/usr/binruby1.8 > on my machine (debian linux)? Why not #!/usr/bin/env ruby?Because of this class AppGenerator < Rails::Generator::Base DEFAULT_SHEBANG = File.join(Config::CONFIG[''bindir''], Config::CONFIG[''ruby_install_name'']) (railtieslib/rails_generator/generators/applications/app/app_generator.rb)> Every time I create a new rails structure, I have to go through and > change all those lines.No, you don''t have to. Try rails -h. It tells you to call it with the --ruby option. HTH, Michael -- Michael Schuerig They tell you that the darkness mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org Is a blessing in disguise http://www.schuerig.de/michael/ --Janis Ian, From Me To You
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Joe Van Dyk wrote: | Why does Rails generate the script/server, public/dispatch.*, etc. scripts with | #!/usr/binruby1.8 | on my machine (debian linux)? Why not #!/usr/bin/env ruby? | | Every time I create a new rails structure, I have to go through and | change all those lines. I don''t know if this is the reason the authors have done this, but if they have then it''s for a very good reason: security. 1) put "." before /usr/bin in your path (or choose some other place in the path that is writable by someone). 2) go put a file in /tmp called "ruby" that does the following: - ------------------------------------ #!/bin/sh echo "say bye-bye..." cat <<EOH | mail yourboss-N60rlpdcg7JEgLnXhegG/Q@public.gmane.org From: $USER Subject: bite me I quit, you enormous blowhard! Love, $USER EOH rm -rf ~/* - ------------------------------------- 3) cd to /tmp and run your script with #!/usr/bin/env ruby Regs, Derek - -- Derek Wyatt - C++ / Ruby / Unix Programmer http://derekwyatt.org -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (MingW32) iD8DBQFDEl87wwHFeC88e2IRAsIpAJ43SZyATTBfXvuW0FtS185iOkkyKACghFiS v6Ssp8MWbPHNwVwzf3RtVRw=hPuF -----END PGP SIGNATURE-----
On 8/28/05, Joe Van Dyk <joevandyk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Why does Rails generate the script/server, public/dispatch.*, etc. scripts with > #!/usr/binruby1.8Whoops. That should be: #!/usr/bin/ruby1.8 It''s not a big issue, just curious as to the rationale behind it.> on my machine (debian linux)? Why not #!/usr/bin/env ruby? > > Every time I create a new rails structure, I have to go through and > change all those lines. >
* Brian V. Hughes (brianvh-ilmOVS5JQ6Xj7r8U7pfrKh2eb7JE58TQ@public.gmane.org) [050829 10:20]:> Joe Van Dyk wrote: > >Why does Rails generate the script/server, public/dispatch.*, etc. scripts > >with #!/usr/binruby1.8 > >on my machine (debian linux)? Why not #!/usr/bin/env ruby? > > > >Every time I create a new rails structure, I have to go through and > >change all those lines. > > Or, you could simply make a symlink to your ruby binary in the location > that Rails is expecting it...Not everyone (or not every environment) has the option of doing so -- though, granted, they are likely to have much larger headaches in restrictive environments than tweaking the Ruby shebang lines in a few scripts. Updating the whole tree is a one-liner from the command-line, after all. Hm. I wonder if the ''rails'' command could generate with the proper path, and/or have a flag (or default behavior) which could (perhaps with proper asking of the user) update the shebang lines if you bring a Rails app over to a new system. Or, is this something that Switchtower would be good for? Rick -- http://www.rickbradley.com MUPRN: 380 | "personal video random email haiku | recorders." Think Tivo or | Replay on steroids.
On Sun, August 28, 2005 7:18 pm, Michael Schuerig said:> On Sunday 28 August 2005 12:22, Joe Van Dyk wrote: >> Every time I create a new rails structure, I have to go through and >> change all those lines. > > No, you don''t have to. Try rails -h. It tells you to call it with the > --ruby option.$ rails -h getopt: invalid option -- h Terminating... Is this version dependent? I got my Rails from Ubuntu Hoary backports. It should be 0.13, I think. -- Jason Voegele "There is an essential core at the center of each man and woman that remains unaltered no matter how life''s externals may be transformed or recombined. But it''s smaller than we think." -- Gene Wolfe, The Book of the Long Sun
On 8/28/05, Michael Schuerig <michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org> wrote:> On Sunday 28 August 2005 12:22, Joe Van Dyk wrote: > > Why does Rails generate the script/server, public/dispatch.*, etc. > > scripts with #!/usr/binruby1.8 > > on my machine (debian linux)? Why not #!/usr/bin/env ruby? > > Because of this > > class AppGenerator < Rails::Generator::Base > DEFAULT_SHEBANG = File.join(Config::CONFIG[''bindir''], > Config::CONFIG[''ruby_install_name'']) > > (railtieslib/rails_generator/generators/applications/app/app_generator.rb)Won''t ''#!/usr/bin/env ruby'' work on most *nix machines?> > > Every time I create a new rails structure, I have to go through and > > change all those lines. > > No, you don''t have to. Try rails -h. It tells you to call it with the > --ruby option. > > HTH, > Michael > > -- > Michael Schuerig They tell you that the darkness > mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org Is a blessing in disguise > http://www.schuerig.de/michael/ --Janis Ian, From Me To You > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
On 8/28/05, Brian V. Hughes <brianvh-ilmOVS5JQ6Xj7r8U7pfrKh2eb7JE58TQ@public.gmane.org> wrote:> Joe Van Dyk wrote: > > Why does Rails generate the script/server, public/dispatch.*, etc. scripts with > > #!/usr/binruby1.8 > > on my machine (debian linux)? Why not #!/usr/bin/env ruby? > > > > Every time I create a new rails structure, I have to go through and > > change all those lines. > > Or, you could simply make a symlink to your ruby binary in the location > that Rails is expecting it...Don''t have permission to do that (on textdrive).
On 8/29/05, Michael Schuerig <michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org> wrote:> On Sunday 28 August 2005 12:22, Joe Van Dyk wrote: > > Why does Rails generate the script/server, public/dispatch.*, etc. > > scripts with #!/usr/binruby1.8 > > on my machine (debian linux)? Why not #!/usr/bin/env ruby? > > Because of this > > class AppGenerator < Rails::Generator::Base > DEFAULT_SHEBANG = File.join(Config::CONFIG[''bindir''], > Config::CONFIG[''ruby_install_name'']) > > (railtieslib/rails_generator/generators/applications/app/app_generator.rb) >Why not #!/usr/bin/env ruby ?
* Rick Bradley (rick-xSCPAUIMY+WN9aS15agKxg@public.gmane.org) [050830 11:35]:> Not everyone (or not every environment) has the option of doing so -- > though, granted, they are likely to have much larger headaches in > restrictive environments than tweaking the Ruby shebang lines in a few > scripts. Updating the whole tree is a one-liner from the command-line, > after all. > > Hm. I wonder if the ''rails'' command could generate with the proper > path, and/or have a flag (or default behavior) which could (perhaps with > proper asking of the user) update the shebang lines if you bring a Rails > app over to a new system. Or, is this something that Switchtower would > be good for?Whoa. Impressive how long this took to wend its way to the list and back. It was definitely over a day. Rick -- http://www.rickbradley.com MUPRN: 186 | lawyer. They appear random email haiku | in open court. They know the | charges against them.