Problem with git gems #132

Open
ejmm320 opened this Issue Jan 13, 2013 · 7 comments

Projects

None yet

5 participants

@ejmm320
ejmm320 commented Jan 13, 2013 edited

This is a possible duplicate (#42, #47)... but the problem still remains alive.

I have jruby 1.7.2 and rails 3.2.11, my aṕp uses rails_admin gem, when i warble it (Warbler 1.3.6) and therefore try to deploy over Tomcat 7.0.34 i get this error:

org.jruby.exceptions.RaiseException: (GitError) https://github.com/sferik/rails_admin.git (at master) is not checked out. Please run `bundle install`
    at RUBY.load_spec_files(/opt/apache-tomcat-7.0.34/webapps/continuity/WEB-INF/gems/gems/bundler-1.2.3/lib/bundler/source.rb:801)
    at RUBY.local_specs(/opt/apache-tomcat-7.0.34/webapps/continuity/WEB-INF/gems/gems/bundler-1.2.3/lib/bundler/source.rb:381)
    at RUBY.specs(/opt/apache-tomcat-7.0.34/webapps/continuity/WEB-INF/gems/gems/bundler-1.2.3/lib/bundler/source.rb:774)
    at Bundler::LazySpecification.__materialize__(/opt/apache-tomcat-7.0.34/webapps/continuity/WEB-INF/gems/gems/bundler-1.2.3/lib/bundler/lazy_specification.rb:53)
    at RUBY.materialize(/opt/apache-tomcat-7.0.34/webapps/continuity/WEB-INF/gems/gems/bundler-1.2.3/lib/bundler/spec_set.rb:86)
    at org.jruby.RubyArray.map!(org/jruby/RubyArray.java:2393)
    at RUBY.materialize(/opt/apache-tomcat-7.0.34/webapps/continuity/WEB-INF/gems/gems/bundler-1.2.3/lib/bundler/spec_set.rb:83)
    at RUBY.specs(/opt/apache-tomcat-7.0.34/webapps/continuity/WEB-INF/gems/gems/bundler-1.2.3/lib/bundler/definition.rb:113)
    at RUBY.specs_for(/opt/apache-tomcat-7.0.34/webapps/continuity/WEB-INF/gems/gems/bundler-1.2.3/lib/bundler/definition.rb:158)
    at RUBY.requested_specs(/opt/apache-tomcat-7.0.34/webapps/continuity/WEB-INF/gems/gems/bundler-1.2.3/lib/bundler/definition.rb:147)
    at RUBY.requested_specs(/opt/apache-tomcat-7.0.34/webapps/continuity/WEB-INF/gems/gems/bundler-1.2.3/lib/bundler/environment.rb:23)
    at RUBY.setup(/opt/apache-tomcat-7.0.34/webapps/continuity/WEB-INF/gems/gems/bundler-1.2.3/lib/bundler/runtime.rb:11)
    at RUBY.setup(/opt/apache-tomcat-7.0.34/webapps/continuity/WEB-INF/gems/gems/bundler-1.2.3/lib/bundler.rb:116)
    at RUBY.(root)(/opt/apache-tomcat-7.0.34/webapps/continuity/WEB-INF/gems/gems/bundler-1.2.3/lib/bundler/setup.rb:17)
    at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:1027)
    at RUBY.(root)(jar:file:/opt/apache-tomcat-7.0.34/webapps/continuity/WEB-INF/lib/gems-gems-jruby-jars-1.7.2-lib-jruby-stdlib-1.7.2.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/custom_require.rb:1)
    at RUBY.require(jar:file:/opt/apache-tomcat-7.0.34/webapps/continuity/WEB-INF/lib/gems-gems-jruby-jars-1.7.2-lib-jruby-stdlib-1.7.2.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/custom_require.rb:60)
    at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:1027)
    at RUBY.(root)(/opt/apache-tomcat-7.0.34/webapps/continuity/WEB-INF/config/boot.rb:6)
    at RUBY.(root)(jar:file:/opt/apache-tomcat-7.0.34/webapps/continuity/WEB-INF/lib/gems-gems-jruby-jars-1.7.2-lib-jruby-stdlib-1.7.2.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/custom_require.rb:1)
    at RUBY.require(jar:file:/opt/apache-tomcat-7.0.34/webapps/continuity/WEB-INF/lib/gems-gems-jruby-jars-1.7.2-lib-jruby-stdlib-1.7.2.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/custom_require.rb:36)
    at RUBY.load_environment(file:/opt/apache-tomcat-7.0.34/webapps/continuity/WEB-INF/lib/gems-gems-jruby-rack-1.1.12-lib-jruby-rack-1.1.12.jar!/jruby/rack/rails/environment3.rb:21)

Gemfile:

gem "rails_admin", :git => "https://github.com/sferik/rails_admin.git"

Gemfile.lock

GIT
  remote: https://github.com/sferik/rails_admin.git
  revision: 7abe9b2574c7e15620653fd61892a109c9ea1f52
  specs:
    rails_admin (0.4.0)
      bootstrap-sass (~> 2.1)
      builder (~> 3.0)
      coffee-rails (~> 3.1)
      font-awesome-sass-rails (~> 3.0, >= 3.0.0.1)
      haml (~> 3.1)
      jquery-rails (~> 2.1)
      jquery-ui-rails (~> 3.0)
      kaminari (~> 0.14)
      nested_form (~> 0.2)
      rack-pjax (~> 0.6)
      rails (~> 3.1)
      remotipart (~> 1.0)
      sass-rails (~> 3.1)

Any solution for this? maybe the problem is the location, this gem is under .../WEB-INF/gems/bundler/gems instead of .../WEB-INF/gems/gems...

Please any help will be appreciated. Thanks in advance.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@csgui
JRuby Team member

Hello @ejmm320,

I've tried to reproduce the error and didn't happen. Rails_Admin works perfectly.

I've used the same stack that you've pointed (JRuby 1.7.2, Rails 3.2.11, deploying in a Tomcat 7.0.34).

The only difference was the rails_admin version (0.4.1) as you can see below.

GIT
  remote: https://github.com/sferik/rails_admin.git
  revision: 0183a83d9fc5026f78c50365491ad9970726bb24
  specs:
    rails_admin (0.4.1)
      bootstrap-sass (~> 2.1)
      builder (~> 3.0)
      coffee-rails (~> 3.1)
      font-awesome-sass-rails (~> 3.0, >= 3.0.0.1)
      haml (~> 3.1)
      jquery-rails (~> 2.1)
      jquery-ui-rails (~> 3.0)
      kaminari (~> 0.14)
      nested_form (~> 0.2)
      rack-pjax (~> 0.6)
      rails (~> 3.1)
      remotipart (~> 1.0)
      sass-rails (~> 3.1)

Please, try to update rails_admin and run your application again.

Cheers.

@ejmm320

Thanks @csgui for your quick answer but my problem isn't related to rails_admin version only, i have other project with a frozed rails_admin revision (older), also other git dependent gems with older versions (rails_admin, simple_form, jstree-rails, wicked_pdf, etc) and i need get this to work (Running under jRuby on Tomcat).

Please point me in the right direction.

Thanks a lot!

@Xylakant

You can hack around this by checking out the gem in another place and then use a path dependency or just build the gem and install it from there. Another solution is to build the gem and use your own gem-server, gem-in-a-box for example.

@crawlik

We run into the same problem and use gem-in-a-box to host such gems.

@ejmm320

Yes, @crawlik we have to package our gems locally and install our own version of each gem and remove the ":git =>" part from Gemfile to get this working. But i'm still think that this should be fixed without doing that.

@bjeanes

FWIW, I'm also having this problem. All my gems that are using :git are completely absent from the gem.jar file. The suggestion by @Xylakant seems in conflict with the current readme, which states:

Warbler supports Bundler for gems and git repositories, but not for plain path components. Warbler will warn when a :path component is found in the Gemfile and will refuse to include it in the archive.

According to earlier issues and their comments, it seems like this should work and once upon a time did. I'm using the master branch of warbler (ironically using :git in my Gemfile) at the moment, because the latest gem is quite old and missing some things I need want.

@bjeanes

It seems like this may just be an expectation mismatch. I think my :git gems are being put in my app.war, just not in the gem.jar inside it...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment