Forum: JRuby Problem migrating from rails 2.1.2 to 2.2.2

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Miika Leppänen (Guest)
on 2008-12-02 13:00
(Received via mailing list)
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
8242) [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:in `load'
/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:in `raw_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:in `standard_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:in `run'
/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:in `run'
/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
Thomas E Enebo (Guest)
on 2008-12-02 16:27
(Received via mailing list)
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 
<removed_email_address@domain.invalid>
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: removed_email_address@domain.invalid , 
removed_email_address@domain.invalid

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
Miika Leppänen (Guest)
on 2008-12-02 16:37
(Received via mailing list)
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
Thomas E Enebo (Guest)
on 2008-12-02 16:43
(Received via mailing list)
ouch...ok.  Good to know.

-Tom

On Tue, Dec 2, 2008 at 8:31 AM, Miika Leppänen 
<removed_email_address@domain.invalid>
wrote:
>>
>>> 8242)
>>>
>>> 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: removed_email_address@domain.invalid , 
removed_email_address@domain.invalid

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
Alex B. (Guest)
on 2009-03-31 18:45
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
This topic is locked and can not be replied to.