Jruby and jQuery don't play well together

Hello

Hello I am currently using:

* Mac Os X 10.6.5
* Netbeans 6.9.1 (with embedded JRuby 1.5.1)
* JDK6u17
* GlassFish Gem 1.0.2
* Rails 3.0.3

I want to user jQuery and CKeditor in my project.

After I install jquery-rails gem and ran command
“rails g jquery:install”
somethings go wrong.

Output:

  remove  public/javascripts/controls.js
  remove  public/javascripts/dragdrop.js
  remove  public/javascripts/effects.js
  remove  public/javascripts/prototype.js
fetching  jQuery (1.4.3)

identical public/javascripts/jquery.js
identical public/javascripts/jquery.min.js
fetching jQuery UJS adapter (github HEAD)
/Applications/NetBeans/NetBeans
6.9.1.app/Contents/Resources/NetBeans/ruby/jruby-1.5.1/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in
require': load error: rails/commands/generate -- java.lang.NoSuchMethodError: org.jruby.Ruby.getSelectorPool()Lorg/jruby/util/io/SelectorPool; (LoadError) from /Applications/NetBeans/NetBeans 6.9.1.app/Contents/Resources/NetBeans/ruby/jruby-1.5.1/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:inrequire’
from /Applications/NetBeans/NetBeans
6.9.1.app/Contents/Resources/NetBeans/ruby/jruby-1.5.1/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:225:in
load_dependency' from /Applications/NetBeans/NetBeans 6.9.1.app/Contents/Resources/NetBeans/ruby/jruby-1.5.1/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:596:innew_constants_in’
from /Applications/NetBeans/NetBeans
6.9.1.app/Contents/Resources/NetBeans/ruby/jruby-1.5.1/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:225:in
load_dependency' from /Applications/NetBeans/NetBeans 6.9.1.app/Contents/Resources/NetBeans/ruby/jruby-1.5.1/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:inrequire’
from /Applications/NetBeans/NetBeans
6.9.1.app/Contents/Resources/NetBeans/ruby/jruby-1.5.1/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/commands.rb:17
from /Applications/NetBeans/NetBeans
6.9.1.app/Contents/Resources/NetBeans/ruby/jruby-1.5.1/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/commands.rb:6:in
`require’
from script/rails:6

Any idea how to fix that?

I would be grateful for the help.

can you try the latest jruby? 1.6 RC2 is out I think…

Jay

Jay McGaffigan wrote in post #982296:

can you try the latest jruby? 1.6 RC2 is out I think…

Jay

It works with GlassFish Gem or Warbler?
When there will be stable version?
Is there an alternative way to install jQuery on JRuby?

I use 1.6 RC2 with warbler and it works just fine.

AS to the stable version… I think/hope it’s imminent but the Jruby
core team would know better.

At the very least you could use the latest 1.5 release:
http://jruby.org/download
1.5.6 which I’ve used with warbler… I haven’t used Glassfish in a long
while.

Jay

Konstantinos P. wrote in post #982442:

Hi,

You could avoid installing the gem, and put in your project the rails.js
and
jquery.min-VERSION.js manually.
The following page https://github.com/rails/jquery-ujs has all the
information you need to install everything manually.

Cheers,
Konstantinos

Ok. I just installed manually jquery and jquery-ui. I also followed
“Manual installation” guide from github. Problem fixed.

Hi,

You could avoid installing the gem, and put in your project the rails.js
and
jquery.min-VERSION.js manually.
The following page https://github.com/rails/jquery-ujs has all the
information you need to install everything manually.

Cheers,
Konstantinos

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs