I’m very new with Ruby, and am going through Chris P.'s Learn to
Program at
the moment. For the hell of it, though, I went ahead and installed
pik/JRuby
so I could play around with an article I read, on building desktop
applications with
JRubyhttp://rubylearning.com/blog/2010/09/29/an-introduction-to-desktop-apps-with-ruby/
.
In the article on desktop apps it tells you to install JRuby through
RVM,
which I can’t. But, since I’m on Windows and just discovered pik, I took
that route, thinking I’d get the same result.
Well I noticed that I had to run my scripts typing jruby
scriptname.rb whereas
the writer could do it with ruby scriptname.rb, still. I asked how he
does
this and got the response below:
If you are using RVM it creates a ‘ruby’ symlink to jruby (see
~/.rvm/rubies/jruby-1.5.2/). I’m guessing in your case you installed JRuby
by itself which won’t have created the symlink.
I would have thought that pik would do something similar, but I guess
not.
My other problem is that I can’t use jruby at all unless I go into
command
prompt and type *pik use jruby. *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™ 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™ 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™ 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?
Jared Miller