开发者

JRuby and jQuery don't play well together

开发者 https://www.devze.com 2023-02-11 07:06 出处:网络
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

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 use 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:in `require'
    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:in `new_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:in `require'
    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? Is there an alternative way to install jQuery on Jruby?

I would be grateful for the help.


try to update the gem ...https://github.com/rails/jquery-ujs , the link also include docs for a "manual" install

0

精彩评论

暂无评论...
验证码 换一张
取 消