Starting a few weeks ago I after updating to a more recent version of JRuby-HEAD I started to notice the following error:
"NameError: ActiveRecord is not missing constant Base!"[1]
The error happens during the loading of one of my Gems, and also with at least one third-party gem (see stacktraces below). With JRuby 1.6 and MRI it works without problems.
I was able to bisect it to the commit 20632af6e1fa511fd9b762beda2a60d39bf3c859. Reverting this commit fixes the problem.
I'm not sure if this something specific to my environment, it well might be. Still I mark it as a release blocker as it a) it's hard to debug and b) makes, at least in my case, jruby unusable for rails.
Thank you!
Reto Schüttel
[1] Stacktrace and files
NameError: ActiveRecord is not missing constant Base!
load_missing_constant at vendor/bundle/jruby/1.8/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:494
const_missing at vendor/bundle/jruby/1.8/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:192
each at org/jruby/RubyArray.java:1611
const_missing at vendor/bundle/jruby/1.8/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:190
(root) at vendor/bundle/jruby/1.8/gems/meta_search-1.1.3/lib/meta_search.rb:55
require at org/jruby/RubyKernel.java:982
(root) at jruby-devel/lib/ruby/gems/shared/gems/bundler-1.1.3/lib/bundler/runtime.rb:1
each at org/jruby/RubyArray.java:1611
require at jruby-devel/lib/ruby/gems/shared/gems/bundler-1.1.3/lib/bundler/runtime.rb:68
each at org/jruby/RubyArray.java:1611
require at jruby-devel/lib/ruby/gems/shared/gems/bundler-1.1.3/lib/bundler/runtime.rb:66
require at jruby-devel/lib/ruby/gems/shared/gems/bundler-1.1.3/lib/bundler/runtime.rb:55
require at jruby-devel/lib/ruby/gems/shared/gems/bundler-1.1.3/lib/bundler.rb:119
require at org/jruby/RubyKernel.java:982
(root) at /path/to/project/config/application.rb:46
require at org/jruby/RubyKernel.java:982
(root) at vendor/bundle/jruby/1.8/gems/railties-3.2.3/lib/rails/commands/runner.rb:1
require at org/jruby/RubyKernel.java:982
(root) at script/rails:6
vendor/bundle/jruby/1.8/gems/meta_search-1.1.3/lib/meta_search.rb
50 require 'meta_search/searches/active_record'
51 require 'meta_search/helpers'
52
53 I18n.load_path += Dir[File.join(File.dirname(__FILE__), 'meta_search', 'locale', '*.yml')]
54
55 ActiveRecord::Base.send(:include, MetaSearch::Searches::ActiveRecord)
56 ActionView::Helpers::FormBuilder.send(:include, MetaSearch::Helpers::FormBuilder)
57 ActionController::Base.helper(MetaSearch::Helpers::UrlHelper)
58 ActionController::Base.helper(MetaSearch::Helpers::FormHelper)
/path/to/project/config/application.rb
44 if defined?(Bundler)
45 # If you precompile assets before deploying to production, use this line
46 Bundler.require(*Rails.groups(:assets => %w(development test)))
47 # If you want your assets lazily compiled in production, use this line
48 # Bundler.require(:default, :assets, Rails.env)
49 end
|