I posted Reinstalling JRuby on Wednesday, 2 January, 2008

Post java jruby ruby

Reinstalling JRuby

I’m still getting everything back together after the iMac upgrade fiasco. JRuby, my favorite Ruby implementation, is still missing. I think I’ll fix that now.

  • Grab the binary of 1.03 from the JRuby site.
  • cd /usr/local
  • sudo tar xfvz ~/jruby-bin-1.0.3.tar.gz
  • sudo ln -s /usr/local/jruby-1.0.3/ /usr/local/jruby
  • Add JRuby details to my (somewhat busy) bash profile
# ~/.bash_profile
export JRUBY_HOME="/usr/local/jruby"</strong>
# OS X is normally conservative about paths, while I am generous about them.
export LOCALBINS=/usr/local/bin:/opt/local/bin:/opt/local/sbin:/usr/X11R6/bin

if [ -r ~/.bashrc ]; then
    . ~/.bashrc

Source the file and test my path …

$ . ~/.bash_profile
$ which jruby
$ which gem

Test with the sample code from Getting Started on the JRuby wiki.

require "java"

include_class "java.util.TreeSet"

puts "Hello from JRuby"
set = TreeSet.new()
set.add( "foo" )
set.add( "Bar" )
set.add( "baz" )
set.each { |v| puts "value: #{v}" }

Run it.

$ jruby call_java.rb

Wait a very long time (why does Java startup have to be so slow on our Mac and how the heck can I make it faster? It’s one thing that’s significantly worse on our Mac compared to my PC). Eventually see:

$ jruby call_java.rb
Hello from JRuby
value: Bar
value: baz
value: foo

Excellent, it worked. It’s 2:46 now. I better post this and go to bed.

Indieweb Social

Did you mention this somewhere? I'd love it if you sent me the link!

disclaimer about timing

Mentions are sent to webmention.io. I fetch the latest mentions when building the site, so I may not see your feedback right away. Especially if my site's broken, which is often the case.

Public replies and mentions might be shared on the site, but I try to do a little quality check first.

Site Links