Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Warbler - no such file to load zip/zip

I am trying to create a war file from my Rails Project using Warbler.

This is my Gemfile:

source 'https://rubygems.org'


ruby '1.9.3', :engine => 'jruby', :engine_version => '1.7.4'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0'

# Use mysql as the database for Active Record
#gem 'mysql2'
gem 'jdbc-mysql'
gem 'activerecord-jdbcmysql-adapter'


# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'


# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'

# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'

# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'
gem 'jquery-ui-rails'


# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'

# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.2'

group :doc do
  # bundle exec rake doc:rails generates the API under doc/api.
  gem 'sdoc', require: false

end

gem 'haml-rails'
gem 'chosen-rails'
gem "compass-rails", "~> 2.0.alpha.0"

gem 'twitter-bootstrap-rails'
gem 'less-rails'
#gem 'therubyracer'
gem 'therubyrhino'

gem 'rails-erd'
gem 'faker'
gem 'devise'
gem 'cancan'
gem 'kaminari'
gem 'paperclip'
gem 'remotipart', '~> 1.0'
gem 'cancan'
gem 'rails_admin'

gem 'puma'
gem 'rubyzip', :require => 'zip/zip'
gem 'warbler'


# Use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# Use unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano', group: :development

# Use debugger
# gem 'debugger', group: [:development, :test]
gem 'gibberish'
# gem 'jquery-turbolinks'
gem "paper_trail", "~> 3.0.0.beta1"

The application runs successfully on the Puma server (before adding warbler).

I just installed warbler using

gem install warbler

Then I ran warble. But I got the error:

LoadError: no such file to load -- zip/zip
  require at org/jruby/RubyKernel.java:1054
   (root) at /home/stever/.rvm/gems/jruby-1.7.4/gems/warbler-1.3.8/lib/warbler/jar.rb:8
  require at org/jruby/RubyKernel.java:1054
   (root) at /home/stever/.rvm/gems/jruby-1.7.4/gems/warbler-1.3.8/lib/warbler/task.rb:1
  require at org/jruby/RubyKernel.java:1054
   (root) at /home/stever/.rvm/gems/jruby-1.7.4/gems/warbler-1.3.8/lib/warbler/task.rb:11
  require at org/jruby/RubyKernel.java:1054
   (root) at /home/stever/.rvm/gems/jruby-1.7.4/gems/warbler-1.3.8/lib/warbler.rb:1
     load at org/jruby/RubyKernel.java:1073
   (root) at /home/stever/.rvm/gems/jruby-1.7.4/gems/warbler-1.3.8/lib/warbler.rb:35
     eval at org/jruby/RubyKernel.java:1093
   (root) at /home/stever/.rvm/gems/jruby-1.7.4/bin/ruby_noexec_wrapper:14

Then I tried adding it to Gemfile as above. Even then I get error. I am not able to start my Puma server as well now.

I do have rubyzip installed.

like image 500
Steve Robinson Avatar asked Sep 11 '13 08:09

Steve Robinson


2 Answers

RubyZip version 1.0.0 changed several class names and the location of the file to require. This has introduced problems when one of your project dependencies relies on the v1.0.0 interface, while another on the v0.9.9 interface. To ease this problem try adding the zip-zip gem to your project. It provides a simple adapter for your dependencies using the v0.9.9 interface allowing you to upgrade to RubyZip v1.0.0.

like image 167
orien Avatar answered Nov 11 '22 20:11

orien


this is fixed in warbler 1.4.0.beta2

like image 43
Gregory Ostermayr Avatar answered Nov 11 '22 20:11

Gregory Ostermayr