Forum: JRuby Create the war file

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.
8d083e133c99dc6123a97baefd0c0480?d=identicon&s=25 Ze lo (zelo)
on 2009-04-23 10:55
Hi everybody,
I am trying to build a new Jruby application thanks to an old ruby
application
So I modified files environment.rb and database.yml
I installed warble but I am not able to create the war file.
I obtain an error :
rake aborted!
You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.split
C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake/
repaired_system.rb:109
:in `find_runnable'
(See full trace by running task with --trace)

I don't know what to do ?

I also try to create war file thanks to Goldspike but I can't install it
:
C:\jrails_apps\EPFWiki>jruby script/plugin install
http://jruby-extras.rubyforge.org/sv...gins/goldspike
Plugin not found:
["http://jruby-extras.rubyforge.org/svn/trunk/rails-...]

And if I retry this command :
C:\jrails_apps\EPFWiki>jruby script/plugin install
http://jruby-extras.rubyforge.org/sv...gins/goldspike
already installed: goldspike
(http://jruby-extras.rubyforge.org/sv...gins/goldspike). pass --force to
reinstall

Naturly I can't create war file :
C:\jrails_apps\EPFWiki>jruby -S rake create_war
(in C:/jrails_apps/EPFWiki)
rake aborted!
Don't know how to build task 'create_war'

(See full trace by running task with --trace)

Thanks for you help
8d083e133c99dc6123a97baefd0c0480?d=identicon&s=25 Ze lo (zelo)
on 2009-04-24 15:20
Ze lo wrote:
> Hi everybody,
> I am trying to build a new Jruby application thanks to an old ruby
> application
> So I modified files environment.rb and database.yml
> I installed warble but I am not able to create the war file.
> I obtain an error :
> rake aborted!
> You have a nil object when you didn't expect it!
> You might have expected an instance of Array.
> The error occurred while evaluating nil.split
> C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake/
> repaired_system.rb:109
> :in `find_runnable'
> (See full trace by running task with --trace)
>
> I don't know what to do ?
>

Ok I found the problem:
JRuby wasn't able to evaluate my "PATH"
So I update the method find_runnable in file repaired_system.rb:

    def find_runnable(file)
      if file =~ RUNNABLE_PATTERN
        file
      else
        ENV["PATH"]="C:\jruby-1.2.0\bin;"
    [nil, ".", *ENV["PATH"].split(";")].each { |path|
          RUNNABLE_EXTS.each { |ext|
            test = (path ? "#{path}/" : "") + "#{file}.#{ext}"
            if File.exist?(test)
              return test
            end
          }
        }
        nil
      end
    end

Then I xopy the war file in tomcat webapps folder, and it almost work
I have a problem wy all link (css, javascript and hyperlink dosn't work)

I hope you will be able to me
439a9cebe73c87771d06723f6027bfed?d=identicon&s=25 Norman Smith (smithno)
on 2009-05-16 20:27
Ze lo wrote:
> Hi everybody,
> I am trying to build a new Jruby application thanks to an old ruby
> application
> So I modified files environment.rb and database.yml
> I installed warble but I am not able to create the war file.
> I obtain an error :
> rake aborted!
> You have a nil object when you didn't expect it!
> You might have expected an instance of Array.
> The error occurred while evaluating nil.split
> C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake/
> repaired_system.rb:109
> :in `find_runnable'
> (See full trace by running task with --trace)

I basically have the same problem. The suggested patch seems to work. At
least the WAR file is created. Haven't gotten it to run in JBoss yet.

Anybody know if a Warbler update is in the plans?
439a9cebe73c87771d06723f6027bfed?d=identicon&s=25 Norman Smith (smithno)
on 2009-05-16 20:29
Norman Smith wrote:
> Anybody know if a Warbler update is in the plans?

I ment Rake update?
Fb919dfe6c759e4b079f9ab1d5a274b3?d=identicon&s=25 Ales Bukovsky (abukovsky)
on 2009-05-18 17:24
I had the same problem until upgrading Rake to recent (0.8.6) version.

HTH

-A-
This topic is locked and can not be replied to.