Question regarding pik/ruby/jRuby

R

Roger Pack

If you are using RVM it creates a ‘ruby’ symlink to jruby (see
I would have thought that pik would do something similar, but I guess
not.

Yeah unfortunately it doesn't. You could, however, create a file
"ruby.bat" within your jruby\bin folder that just calls jruby, like:

jruby %*

Then you'd have it.
My other problem is that I can't use jruby at all unless I go into
command
prompt and type *pik use jruby.

Yeah you can only have one default, which is determined by your system's
PATH setting. If you were to add your jruby bin folder to the beginning
of your path, you would then have it by default (as jruby). Pik doesn't
do anything but switch *away* from the default. The default you must
manually set up (I think, anyway). Another way to set up jruby as a
default is to use their one click installer, and check the "setup my
path for me" button.

GL.
-r

*If I close command prompt, and open it
again, I have to do it all over. Below is just showing that I have to
*pik
use jruby* and once it's set to Jruby it won't recognize *ruby -v*.

C:\Users\Jared>ruby -v

ruby 1.9.2p0 (2010-08-18) [i386-mingw32]

C:\Users\Jared>jruby -v

'jruby' is not recognized as an internal or external command,

operable program or batch file.

C:\Users\Jared>pik list

153: jruby 1.5.3 (ruby 1.8.7 patchlevel 249) (2010-09-28 7ca06d7)
(Java
HotSpot(TM) Client VM 1.6.0_21)...

186: ruby 1.8.6 (2009-08-04 patchlevel 383) [i386-mingw32]

C:\Users\Jared>pik use jruby

C:\Users\Jared>pik list

* 153: jruby 1.5.3 (ruby 1.8.7 patchlevel 249) (2010-09-28 7ca06d7)
(Java
HotSpot(TM) Client VM 1.6.0_21)...

186: ruby 1.8.6 (2009-08-04 patchlevel 383) [i386-mingw32]

C:\Users\Jared>jruby -v

jruby 1.5.3 (ruby 1.8.7 patchlevel 249) (2010-09-28 7ca06d7) (Java
HotSpot(TM) Client VM 1.6.0_21) [x86-java]

C:\Users\Jared>ruby -v

'ruby' is not recognized as an internal or external command,

operable program or batch file.


Any thoughts, guys and gals?
 
D

Daniel G.

So you don't feel too left out, pik and RVM do similar things, but yes,
RVM is more powerful (in large part because the Bash command line
environment it lives in is much more powerful).

Both tools provide a method to switch from the default ruby on the
command-line, but outside of a command-line environment, the system
default will always be used, regardless of which tool or OS you're
using. As Roger suggested, you can edit the PATH variable in Windows to
alter which ruby gets called by default; Windows will execute the first
one it comes to in your PATH. For me, I'd just keep running 'jruby' on
Windows, instead of editing the PATH constantly.

Both RVM and pik provide a method for having multiple concurrent
versions of Ruby installed on your computer; both keep a set of gems per
version. However, RVM also provides "gemsets", which allow you to setup
a global set of gems as well as gems just for a particular project or
use-case. By including a one-line text file in a directory, RVM can be
told to automatically switch to this "gemset", which sets the default
version of ruby and loads the project-specific gems automatically.

RVM has many, many more features, and it just might be worth installing
an easy-to-use Linux distro just to give it a try.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top