This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 142166 - [65cat] [other] Unable to generate a WAR file using Warbler
Summary: [65cat] [other] Unable to generate a WAR file using Warbler
Status: RESOLVED FIXED
Alias: None
Product: ruby
Classification: Unclassified
Component: Rails (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Erno Mononen
URL:
Keywords: UI
Depends on:
Blocks:
 
Reported: 2008-07-29 23:49 UTC by esmithbss
Modified: 2008-10-03 14:41 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description esmithbss 2008-07-29 23:49:10 UTC
[ BUILD # : 200807290201 ]
[ JDK VERSION : 1.6.0_07 ]

When creating a new Ruby On Rails application I am asked if I want to
install Warbler to create a WAR file.  I selected Yes.

Now that I am ready to create a War file, there is no way to run
warbler against my project within the IDE.

If I switch to CLI and try to run warbler, the shebang at the top of
the Warbler file attempts to use a native ruby installation.  Since
warbler is not installed in the native installation, the following
error is generated.

/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require': no such file to load -- warbler (LoadError)
	from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require'
	from
/home/esmith/Apps/netbeans-dev-200807290201/ruby2/jruby-1.1.3/lib/ruby
/gems/1.8/gems/warbler-0.9.10/bin/warble:11
Comment 1 Erno Mononen 2008-07-30 15:15:56 UTC
> Now that I am ready to create a War file, there is no way to run
warbler against my project within the IDE.

If you checked the 'Add Rake Targets to Support App Server Deployment' checkbox in the new project wizard, you should 
have the warbler rake tasks available in the rake runner dialog, i.e. war, war:app etc. I guess the problem here is 
that you created the project using JRuby (without selecting the checkbox), and then tried to use Warbler with native 
Ruby from the command line. 

From the command line you can run 'jruby -S warble' in the project directory (assuming you have jruby in PATH -- 
otherwise '<netbeans install dir>/ruby2/jruby-1.1.3/bin/jruby -S warble'). Selecting the checkbox is equivalent to 
running 'jruby -S warble pluginize', which you can do also from the command line after creating the project (that 
enables the warbler rake tasks in the project).

In any case there seems to be a usability problem in the IDE, either the checkbox should be enabled for MRI too or the 
install warbler button should be disabled for MRI.
Comment 2 Erno Mononen 2008-09-12 10:33:13 UTC
I think it'd be best to enable the checkbox for MRI too (and get rid of the 'if using JRuby' label above the check 
box). Probably too late for 6.5 though. Chris, let me know if you think this can still be fixed; otherwise I'll fix 
this after 6.5 is out. 
Comment 3 Chris Kutler 2008-09-16 16:47:39 UTC
This UI change is ok for me.
Comment 4 Chris Kutler 2008-09-16 18:21:29 UTC
I have a question for esmithbss.

When I run warble from the command line, I cd to the project's root folder and use 

jruby -S warble <pluginize, config or whatever>

How are you doing it? What is the exact command that you used and what folder were you in when you did it?
Comment 5 Chris Kutler 2008-09-16 18:29:30 UTC
I have another question for esmithbss

I am confused by "When creating a new Ruby On Rails application I am asked if I want to
install Warbler to create a WAR file.  I selected Yes."

I assume you were using the NetBeans IDE's New Project wizard. When were you asked if you wanted to install Warbler?
There is an Add Rake Targets to Support App Server Deployment checkbox on the first step. And there is an Install
Warbler button on the last step, but I am not aware of a dialog box asking if you want to install warbler. Can you tell
me more about this?

Also, why did you go to the command line to enter warble commands? As Erno noted, if you checked the Add Rake Targets to
Support App Server Deployment checkbox, the war rake commands should be available in the rake runner? For the creation
of the config file, there should be a warble entry in the Generate drop down list. Perhaps this was not intuitive?
Comment 6 esmithbss 2008-09-16 18:53:24 UTC
In response to the posed questions:

1) the Warble script is actually a fully executable script under the Linux platform so when I went to the CLI to execute
the script, I changed to my project's top level directory and issued the command

    "warble"

which is the command used to generate a war file as documented here
:http://blog.nicksieger.com/articles/2007/09/04/warbler-a-little-birdie-to-introduce-your-rails-app-to-java

At the time, I didn't find any documentation indicating that I needed to run warble on the command line using "jruby -S
..." instead.

Additionally, there was (and may still be) an issue with Rake task menu refresh where it took 2 separate refreshes to
populate the list.  And since the warble command is a command line script, it is not intuitive that this would be the
proper location for executing the warble command.
Comment 7 esmithbss 2008-09-16 19:18:24 UTC
You are correct that I was describing the "New Projects Wizard" for a Ruby on Rails app.

Within this dialog, if you select "Y" to install Warbled, then cancel before reaching the last page of the wizard,
warbler isn't properly installed.  Apparently, if you checkmark the box on the first page to add the Rake tasks, then
click "Finish" on some versions, it didn't install warble.  <= This may be fixed now.

As far as the command line, when I couldn't find instructions on running warbler, I switched to the CLI and found
details on running warbler against my app to generate the war.

Unfortunately, I hadn't installed warbler into my native ruby installation yet, so when I attempted the same command
highlighted earlier, the shebang at the top took precedence.


Also, why did you go to the command line to enter warble commands? As Erno noted, if you checked the Add Rake Targets to
Support App Server Deployment checkbox, the war rake commands should be available in the rake runner? For the creation
of the config file, there should be a warble entry in the Generate drop down list. Perhaps this was not intuitive?
Comment 8 esmithbss 2008-09-16 19:23:30 UTC
Oops, Cut & Paste mistake.  Ignore the last paragraph of the last response.
Comment 9 Chris Kutler 2008-09-16 20:04:57 UTC
I uninstalled warbler from my JRuby platform. I created a new project and selected JRuby as my platform. I selected the
Add Rake Targets checkbox. The Finish button becomes disabled. I go to the last step and click Install Warbler. I never
got an opportunity to enter Y for installing warbler? How do I make this happen? Also, I am wondering how your button
was not disabled until you installed warbler? Your build is not as new as mine but I don't recall it happening as you
described on 8/29 either.
Comment 10 esmithbss 2008-09-18 08:50:24 UTC
It is possible that there have been some changes to the UI that affect the path I originally experienced.  I'll need to
go back and check.

As for the CLI performance issue:

1) Install the Native platform version of Ruby.  For my Linux distro, I have downloaded the source, built, and installed
it.  Make sure you can run ruby from the CLI, and that it shows as Ruby and not JRuby.

2) Install NB with JRuby support.

3) Install the Warbler gem through the NB interface into the JRuby environment.  Preferrably while creating a new JRuby
on Rails project.

4) Go to the CLI and run "warble".  At this point, your native Ruby installation should be executing the warble command
based on the shebang at the top of the file.  If not, then it may attempt to use jruby from the default jruby
installation location (which is not .../netbeans-dev-xxxxxxxxxxxx/rubyxxx/jrubyxxxxxxxx
Comment 11 Chris Kutler 2008-09-18 17:05:14 UTC
esmithbss wrote:

"Go to the CLI and run "warble".  At this point, your native Ruby installation should be executing the warble command
based on the shebang at the top of the file.  If not, then it may attempt to use jruby from the default jruby
installation location (which is not .../netbeans-dev-xxxxxxxxxxxx/rubyxxx/jrubyxxxxxxxx"

If you have both MRI ruby and JRuby installations, what command gets run when you use the warble command from the
command line depends on the order of your 2 installations in the path. If JRuby is first, then it runs the jruby warble
executable. If jruby is not in your path, then it will run the MRI executable.

The best thing to do when you have both MRI ruby and JRuby is to use "ruby -S warble" or "jruby -S warble" depending on
which one you intended to run, just to make sure you run the one you intended to run. 

Note: If you have a project already and you wan to add the plugin, go to the top folder for the project and run 
jruby -S warble pluginize (or ruby -S warble pluginize depending on your project).
Comment 12 Erno Mononen 2008-09-30 15:09:35 UTC
Fixed in #327faaf85fbc, the check box is now enable for MRI too. Chris, please note the UI change (the 'if using JRuby' 
label is now removed). Will push the fix to the main repo tomorrow.
Comment 13 Quality Engineering 2008-10-03 14:41:53 UTC
Integrated into 'main-golden', will be available in build *200810031107* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/327faaf85fbc
User: Erno Mononen <emononen@netbeans.org>
Log: #142166: [65cat] [other] Unable to generate a WAR file using Warbler