From: Matt Mongeau Date: 2013-04-06T10:49:35+09:00 Subject: Re: How do you know what the main file in Ruby Projects is? --001a11c29c6054fb7404d9a76aa2 Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: quoted-printable > Interesting. How do they get added to the shell path, so you can execute them? Or do you have to write /usr/local/lib/ruby/gems/1.9.3/gems/foo/lib/foo-cli.rb or whatever to actually run them? My system ruby installs them into /usr/bin. So I get /usr/bin/rails. When using ruby version managers they install them into more sane locations. On Fri, Apr 5, 2013 at 9:44 PM, Matthew Kerwin wrote= : > On 6 April 2013 09:44, Bartosz Dziewo=F1ski wrote: > >> On Sat, 06 Apr 2013 01:16:15 +0200, Matthew Kerwin >> wrote: >> >> Question: why does a gem have a shebang line at all? Aren't gems always >>> only ever required by other ruby scripts? >>> >> >> Some gems include executable scripts. Examples would be Ocra or >> ruby_parser. >> >> You can use `gem install --env-shebang ` to fix this for >> yourself. >> >> > Interesting. How do they get added to the shell path, so you can execute > them? Or do you have to write > /usr/local/lib/ruby/gems/1.9.3/gems/foo/lib/foo-cli.rb or whatever to > actually run them? > > -- > Matthew Kerwin, B.Sc (CompSci) (Hons) > http://matthew.kerwin.net.au/ > --001a11c29c6054fb7404d9a76aa2 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
>=C2=A0Interesting.=C2=A0 How do they get added to the shell path, so = you can execute them?=C2=A0 Or do you have to write /usr/local/lib/ruby/gem= s/1.9.3/= gems/foo/lib/foo-cli.rb or whatever to actually run them?

My= system ruby installs them into=C2=A0

On Fri,= Apr 5, 2013 at 9:44 PM, Matthew Kerwin <matthew@kerwin.net.au>= wrote:
On 6 April 2013 09:44, Bartosz= Dziewo=C5=84ski <matma.rex@gmail.com> wrote:
On Sat, 06 Apr 2013 01:16:15 +0200, Mat= thew Kerwin <= matthew@kerwin.net.au> wrote:

Question: why does a gem have a shebang line at all? Aren't gems always= only ever required by other ruby scripts?

Some gems include executable scripts. Examples would be Ocra or ruby_parser= .

You can use `gem install --env-shebang <gemname>` to fix this for you= rself.


Interesting.=C2=A0 How do they get added to the shell path, so you can= execute them?=C2=A0 Or do you have to write /usr/local/lib/ruby/gems/1.9.3= /gems/foo/lib/foo-cli.rb or whatever to actually run them?

--
=C2=A0 Matthew Kerwin, B.Sc = (CompSci) (Hons)
=C2=A0 http://matthew.kerwin.net.au/

--001a11c29c6054fb7404d9a76aa2--