"rescue in const_missing" error with Ruby 1.9.1, Rails 2.3.2, and jrails 0.4
Asked Answered
T

1

6

I recently started a project where the team decided we'd like to use jQuery rather than Prototype/Scriptaculous for our javascript needs. We set our project up, and began the switch. The plugin was installed via these instructions, and all went according to plan. Shortly after, when trying to run "./script/server", we get the following error:

=> Rails 2.3.2 application starting on http://0.0.0.0:3000
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:105:in `rescue in const_missing': uninitialized constant ActionView::Helpers::JavaScriptElementProxy::ActionView (NameError)
    from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:94:in `const_missing'
    from /home/company/Development/project/vendor/plugins/jrails/lib/jrails.rb:229:in `<class:JavaScriptElementProxy>'
    from /home/company/Development/project/vendor/plugins/jrails/lib/jrails.rb:226:in `<module:Helpers>'
    from /home/company/Development/project/vendor/plugins/jrails/lib/jrails.rb:2:in `<module:ActionView>'
    from /home/company/Development/project/vendor/plugins/jrails/lib/jrails.rb:1:in `<top (required)>'
    from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
    from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `block in require'
    from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
    from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
    from /home/company/Development/project/vendor/plugins/jrails/init.rb:6:in `block in evaluate_init_rb'
    from /usr/local/lib/ruby/gems/1.9.1/gems/rails-2.3.2/lib/rails/plugin.rb:146:in `eval'
    from /usr/local/lib/ruby/gems/1.9.1/gems/rails-2.3.2/lib/rails/plugin.rb:146:in `block in evaluate_init_rb'
    from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
    from /usr/local/lib/ruby/gems/1.9.1/gems/rails-2.3.2/lib/rails/plugin.rb:142:in `evaluate_init_rb'
    from /usr/local/lib/ruby/gems/1.9.1/gems/rails-2.3.2/lib/rails/plugin.rb:48:in `load'
    from /usr/local/lib/ruby/gems/1.9.1/gems/rails-2.3.2/lib/rails/plugin/loader.rb:38:in `block in load_plugins'
    from /usr/local/lib/ruby/gems/1.9.1/gems/rails-2.3.2/lib/rails/plugin/loader.rb:37:in `each'
    from /usr/local/lib/ruby/gems/1.9.1/gems/rails-2.3.2/lib/rails/plugin/loader.rb:37:in `load_plugins'
    from /usr/local/lib/ruby/gems/1.9.1/gems/rails-2.3.2/lib/initializer.rb:348:in `load_plugins'
    from /usr/local/lib/ruby/gems/1.9.1/gems/rails-2.3.2/lib/initializer.rb:163:in `process'
    from /usr/local/lib/ruby/gems/1.9.1/gems/rails-2.3.2/lib/initializer.rb:113:in `run'
    from /home/company/Development/project/config/environment.rb:9:in `<top (required)>'
    from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
    from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `block in require'
    from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
    from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
    from /usr/local/lib/ruby/gems/1.9.1/gems/rails-2.3.2/lib/commands/server.rb:84:in `<top (required)>'
    from script/server:3:in `require'
    from script/server:3:in `<main>'

I've done exensive searching, and can't find the reason for this error, or any documentation regarding version compatibility issues. Any help you guys can give will be greatly appreciated.

Thanks,

Mike Trpcic

Tien answered 22/6, 2009 at 18:39 Comment(1)
I use the same plugin and it works fine with Ruby 1.8.6 and 1.8.7. I never tested it with Ruby 1.9.1.Offhand
R
4

Looks like it's been patched to work with Ruby 1.9, try grabbed it from this git repo instead of the main site: http://github.com/cheald/jrails/tree/master

Rudd answered 22/6, 2009 at 18:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.