fnando/i18n-js — Issue #64: NoMethodError: undefined method `assets' during set up with JRuby/Rails 3.0.10
Author: buruzaemon
Created: 2011-10-18 05:20:13+00:00
State: open

When attempting to run `rake i18n:js:setup` on JRuby 1.6.4, the following error is occurring:

C:\Temp\foobar>jruby -S rake i18n:js:setup --trace
** Invoke i18n:js:setup (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
undefined method `assets' for #
org/jruby/RubyKernel.java:238:in `method_missing'
C:/skunkworx/jruby/jruby-1.6.4/lib/ruby/gems/1.8/gems/railties-3.0.10/lib/rails/railtie/configuration.rb:77:in `method_missing'
C:/skunkworx/jruby/jruby-1.6.4/lib/ruby/gems/1.8/gems/i18n-js-2.1.0/lib/i18n-js/railtie.rb:9:in `Railtie'
....

I believe that this error is stemming from an assumption that the gem is being used with Rails 3.1.
Please see line 9 in `lib/i18n-js/railtie.rb`:

app.config.middleware.use(Middleware) if Rails.env.development? && !Rails.configuration.assets.enabled

... where `Rails.configuration.assets` is present in Rails 3.1, but not present in versions lower than 3.1.

Here are my ruby and gem details:

C:\Temp\foobar>jruby -v
jruby 1.6.4 (ruby-1.8.7-p330) (2011-08-23 17ea768) (Java HotSpot(TM) Client VM 1.6.0_13) [Windows XP-x86-java]

C:\Temp\foobar>jruby -S gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.5.1
- RUBY VERSION: 1.8.7 (2011-08-23 patchlevel 330) [java]
- INSTALLATION DIRECTORY: C:/skunkworx/jruby/jruby-1.6.4/lib/ruby/gems/1.8
- RUBY EXECUTABLE: C:/skunkworx/jruby/jruby-1.6.4/bin/jruby.exe
- EXECUTABLE DIRECTORY: C:/skunkworx/jruby/jruby-1.6.4/bin
- RUBYGEMS PLATFORMS:
- ruby
- universal-java-1.6
- GEM PATHS:
- C:/skunkworx/jruby/jruby-1.6.4/lib/ruby/gems/1.8
- C:/Documents and Settings/6008895/.gem/jruby/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- "install" => "--no-rdoc --no-ri --env-shebang"
- "update" => "--no-rdoc --no-ri --env-shebang"
- REMOTE SOURCES:
- http://rubygems.org/

C:\Temp\foobar>jruby -S gem li

*** LOCAL GEMS ***

abstract (1.0.0)
actionmailer (3.0.10)
actionpack (3.0.10)
activemodel (3.0.10)
activerecord (3.0.10)
activeresource (3.0.10)
activesupport (3.0.10)
arel (2.0.10)
bouncy-castle-java (1.5.0146.1)
builder (2.1.2)
bundler (1.0.21)
erubis (2.6.6)
i18n (0.6.0, 0.5.0)
i18n-js (2.1.0)
jruby-openssl (0.7.4)
json (1.6.1 java)
mail (2.2.19)
mime-types (1.16)
polyglot (0.3.2)
rack (1.2.4)
rack-mount (0.6.14)
rack-test (0.5.7)
rails (3.0.10)
railties (3.0.10)
rake (0.9.2, 0.8.7)
rdoc (3.11)
sources (0.0.1)
thor (0.14.6)
treetop (1.4.10)
tzinfo (0.3.30)