daveray / familiar

Use Clojure goodness from Ruby
14 stars 1 forks source link

JRuby 1.6.5 and Ruby 1.9.2? #1

Open devn opened 13 years ago

devn commented 13 years ago

Hi Dave,

This library looks really cool but I'm having some issues playing with it. I tried to get it set up on jruby-head (the stable 1_6 branch) using ruby 1.9.2. Could you comment on whether this library was meant to be used with 1.9, whether you're using rvm, etc.

Thanks, Devin

devn commented 13 years ago

To clarify a bit:

I am having issues using bundler to point at the github repo for the gem. It is unclear why it is failing to be added to my rvm gemset.

daveray commented 13 years ago

Hey Devin,

I'll start by admitting I'm pretty clueless about bundler and gemspecs and everything. I haven't even used Ruby much in a while (Clojuring). Anyway, it looks like by naming the file familiar.gemspec rather than just .gemspec I confused bundler. I've changed that and it seems like it works:

In Gemfile:

gem "familiar", :git => "git://github.com/daveray/familiar.git"

... and then:

$ jruby --1.9 --version
jruby 1.6.4 (ruby-1.9.2-p136) (2011-08-23 17ea768) 
(Java HotSpot(TM) 64-Bit Server VM 1.6.0_26) [darwin-x86_64-java]

$ jruby --1.9 -S bundle install
Using familiar (0.0.0) from git://github.com/daveray/familiar.git (at master) 
Using bundler (1.0.21) 
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

$ jruby --1.9 -S bundle show familiar
/Users/dave/Apps/jruby-1.6.4/lib/ruby/gems/1.8/bundler/gems/familiar-45f751d9e1da

$ jruby --1.9 -S jirb
irb(main):001:0> require "rubygems"
=> false
irb(main):002:0> require "bundler/setup"
=> true
irb(main):003:0> require "familiar"
=> true
irb(main):004:0>  Familiar[:inc].invoke(1)
=> 2

I've been using a vanilla download of JRuby 1.6.4 as well as a custom build from master while fiddling with STM issues.

Give this a try and let me know how it goes. Cheers :)

daveray commented 13 years ago

Oh, and it seems to work in 1.9 mode, but I've mostly been running in 1.8. I'm not particular though, so if 1.9 is better for someone interested in the project, that's fine with me :)