Reputation: 497
I am using Warbler to generate a WAR file for my ruby on rails application. I don't use anything special in my application, and i only run the "warble war" command.
In the WAR generation i am getting those 2 warnings
warning: skipping minitest
warning: skipping json
Upon the importing of the WAR in eclipse, the project can't be built and it says
Archive for required library: '/WebContent/WEB-INF/lib/gems-gems-warbler-1.4.1-spec-sample_war-some.jar'cannot be read or is not a valid ZIP file
I tried to follow some workarounds from https://github.com/jruby/warbler/issues/199 but without any clue. I am using Rails version 4.0.2 and warbler version 1.4.1 .I am new to deployment so i would be grateful if somebody can help me. Thanks
Upvotes: 1
Views: 1676
Reputation: 2753
A better way to exclude the offending file : the warble config.
Generate the configuration with
warble config
Then uncomment the following line to fix it :
config.gem_excludes = [/^(test|spec)\//]
Upvotes: 2
Reputation: 2382
Let me warn you that this is a complete butcher job and I only used this because I was perplexed as to why I was also getting the same errors and Tomcat died when trying to deploy my jruby/rails application. Here's what I did:
$ ls -l /usr/local/opt/tomcat/libexec/webapps/workspace/WEB-INF/lib/*sample*
You will see some warbler sample jars there. gems-gems-warbler-1.4.1-spec-sample_war-some.jar has a size of 0. It's the problem, but I figure I don't really need any sample jars, thank you. So:
$ bundle show warbler
/PATH/.rvm/gems/jruby-1.7.10@rails4/gems/warbler-1.4.1
$ rm -rf /PATH/.rvm/gems/jruby-1.7.10@rails4/gems/warbler-1.4.1/spec/*sample*
$ bundle exec warble war
Deploy to Tomcat, and the context starts just fine. Less than ideal and probably there is a "correct" solution. This got me moving forward, tho.
Upvotes: 1