Ruby.bat?

Any chance of jruby also naming itself ruby? Then things like
pik run ruby install gem_name

would work on windows [currently it works for everything except jruby,
which must be special cased].
Thanks!
-r

Hi Roger,

On Mon, Nov 2, 2009 at 9:46 PM, Roger P. [email protected] wrote:

Any chance of jruby also naming itself ruby? Then things like
pik run ruby install gem_name

would work on windows [currently it works for everything except jruby,
which must be special cased].

You could create ruby.bat file with the following content:

@“%~dp0j%~n0.exe” %*

and put it into JRuby’s bin directory.

And if JRuby’s bin directory is earlier in the PATH than the MRI one,
you’ll be executing jruby when type ruby.

But, honestly, this could be very confusing. :slight_smile:

Thanks,
–Vladimir

P.S. Renaming of jruby.exe to ruby.exe is not currently supported.

P.P.S. What’s pik?


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

You could create ruby.bat file with the following content:

@“%~dp0j%~n0.exe” %*

Excellent. I will do that.

and put it into JRuby’s bin directory.

And if JRuby’s bin directory is earlier in the PATH than the MRI one,
you’ll be executing jruby when type ruby.

But, honestly, this could be very confusing. :slight_smile:

Yeah pik is a utility to use to go between different ruby versions in
windows. It basically ensures that only the one you select is in the
current path, so then running ruby -v is consistent [there can be only
one].
I didn’t create it so I don’t get credit there :slight_smile:

Thanks.

Roger P. wrote:

You could create ruby.bat file with the following content:

@“%~dp0j%~n0.exe” %*

Excellent. I will do that.

Sorry, I’m late to the party, but I just found this thread.

This shouldn’t be necessary. Pik uses the Pik::Which [1] module for
determining the ruby, gem, rake and irb executables. For ruby, it will
look for:

['ruby.exe', 'ir.exe', 'jruby.exe', 'jruby.bat']

jruby.exe gets preference over jruby.bat. The rest of the order is
irrelevant because there should only ever be one implementation in the
path at a time.

You have to use ‘pik ruby’, ‘pik gem’ and ‘pik rake’. The ‘pik run’
command is only there for running non-rubyish commands that shouldn’t
change between implementations. An example of ‘pik ruby’[2]

[1] pik/lib/pik/which.rb at master · vertiginous/pik · GitHub
[2] gist:233871 · GitHub

Hi Gordon,

I just wanted to say big THANK YOU for the pik! :slight_smile: It is a true
life-saver on Windows, especially since I have to work with 9
different versions of MRI and JRuby. So, switching between the
versions is trivial now. Plus, I can install the gems in all versions
with the same command, and I could run the tests against all versions
at once. Sweeeeet :slight_smile:

Thanks,
–Vladimir

On Fri, Nov 13, 2009 at 3:55 PM, Gordon T. [email protected]
wrote:

You have to use ‘pik ruby’, ‘pik gem’ and ‘pik rake’. The ‘pik run’

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

I just wanted to say big THANK YOU for the pik!

I agree pik totally rocks.
-r