Problem migrating from rails 2.1.2 to 2.2.2

Hello

My setup:

  • Rails application generated with jRuby 1.1.5, Bort and Rails 2.1.2
  • Upgraded Rails to 2.2.2
  • Changed AASM, rspec, rspec-rails plugins to gems
  • Upgraded jruby to 1.1.5 (ruby 1.8.6 patchlevel 114) (2008-12-02 rev
  1. [i386-java]

I have a model:
class Sample < ActiveRecord::Base
include Java
import ‘java.util.HashMap’
end

In the config/environments/production.rb commented this line:
#config.action_view.cache_template_loading = true

“jruby -S rake spec” runs fine, no errors. But rake tasks with
RAILS_ENV=production fails with error:
No such file to load – /Users/milep/projects/eebu/netbeans/eebu/
java.util.HashMap

eg.
mlemacbook:eebu milep$ jruby -S rake war RAILS_ENV=production --trace
(in /Users/milep/projects/eebu/netbeans/eebu)
** Invoke environment (first_time)
** Execute environment
rake aborted!
No such file to load – /Users/milep/projects/eebu/netbeans/eebu/
java.util.HashMap
/usr/local/jruby-trunk/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:
1598:in load' /usr/local/jruby-trunk/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb: 1598:inload’
/usr/local/jruby-trunk/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:
2413:in load_imports' /usr/local/jruby-trunk/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb: 2356:inraw_load_rakefile’
/usr/local/jruby-trunk/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:
1985:in load_rakefile' /usr/local/jruby-trunk/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb: 2036:instandard_exception_handling’
/usr/local/jruby-trunk/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:
1984:in load_rakefile' /usr/local/jruby-trunk/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb: 1969:inrun’
/usr/local/jruby-trunk/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:
2036:in standard_exception_handling' /usr/local/jruby-trunk/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb: 1967:inrun’
/usr/local/jruby-trunk/lib/ruby/gems/1.8/gems/rake-0.8.3/bin/rake:31
/usr/local/jruby-trunk/lib/ruby/gems/1.8/gems/rake-0.8.3/bin/rake:
19:in `load’
/usr/local/jruby/bin/rake:19

If I uncomment the config.action_view.cache_template_loading, rake
tasks works again. But the war file with production environment wont
work.

In the rails app created with 2.2.2, the java import works.

Does anyone have any pointers where to look? Thanks!

Regards,
Miika Leppänen

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Can you try changing ‘import’ to ‘java_import’? This may be the
naming conflict that both jruby and rake define Object.import.

-Tom

On Tue, Dec 2, 2008 at 4:59 AM, Miika Leppänen [email protected]
wrote:

class Sample < ActiveRecord::Base
/Users/milep/projects/eebu/netbeans/eebu/java.util.HashMap
`load’
/usr/local/jruby-trunk/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1984:in
/usr/local/jruby/bin/rake:19

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


Blog: http://www.bloglines.com/blog/ThomasEEnebo
Email: [email protected] , [email protected]


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Yes, thanks, that was it.

-Miika

On 2.12.2008, at 16.26, Thomas E Enebo wrote:

  • Rails application generated with jRuby 1.1.5, Bort and Rails 2.1.2
    end
    mlemacbook:eebu milep$ jruby -S rake war RAILS_ENV=production --trace
    rake.rb:1598:in
    /usr/local/jruby-trunk/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/
    `standard_exception_handling’
    tasks

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Hi,

I experienced exactly the same problem when requiring the image_voodoo
gem in my environment for overriding purposes. Any rake tasks that load
the environment will fail with “uninitialized constant
ImageVoodoo::<java_class_name>”. It took me a while before I stumbled
upon this post, but good to know what the cause is. Any chance this may
be resolved in a future update?

Alex

ouch…ok. Good to know.

-Tom

On Tue, Dec 2, 2008 at 8:31 AM, Miika Leppänen [email protected]
wrote:

rake aborted!
`load_imports’
/usr/local/jruby-trunk/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1984:in
/usr/local/jruby-trunk/lib/ruby/gems/1.8/gems/rake-0.8.3/bin/rake:31


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


Blog: http://www.bloglines.com/blog/ThomasEEnebo
Email: [email protected] , [email protected]


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email