Bug 812696

Summary: Ruby cartridge - can't install a ruby project with an exploded gem because of bundler issue #1027
Product: OKD Reporter: Clayton Coleman <ccoleman>
Component: ContainersAssignee: Troy Dawson <tdawson>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: high    
Version: 1.xCC: pruan, rmillner, tdawson
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-04-27 20:46:25 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Clayton Coleman 2012-04-16 01:40:32 UTC
We're using bundler 1.0.10 which has bug:

https://github.com/carlhuda/bundler/pull/1027

If your Gemfile uses gemspec (so someone developing a Rails engine gem, like the Console team), when you deploy to OpenShift and run 'bundler install --deployment' it chokes and dies with an error about the source changing.  The gems don't get installed and the app won't start.  I think a few users have hit this as well if they had local gems they were installing.

remote: Bundling RubyGems based on Gemfile/Gemfile.lock to repo/vendor/bundle with 'bundle install --deployment'
remote: You have modified your Gemfile in development but did not check
remote: the resulting snapshot (Gemfile.lock) into version control
remote: 
remote: You have added to the Gemfile:
remote: * source: source at /var/lib/stickshift/d742ae50e0ee4ef8a648be189bb00380/console/runtime/repo
remote: 
remote: You have deleted from the Gemfile:
remote: * source: source at .
remote: Precompiling with 'bundle exec rake assets:precompile'
remote: Could not find rake-0.9.2.2 in any of the sources
remote: Running .openshift/action_hooks/build
remote: Running .openshift/action_hooks/deploy

SSH into the remote machine, run bundle install --deployment from the repo dir, and see:

[console-claytondev.rhcloud.com repo]\> bundle install --deployment
You have modified your Gemfile in development but did not check
the resulting snapshot (Gemfile.lock) into version control

You have added to the Gemfile:
* source: source at /var/lib/stickshift/d742ae50e0ee4ef8a648be189bb00380/console/runtime/repo

You have deleted from the Gemfile:
* source: source at .

Gemfile:
source 'http://rubygems.org'

gemspec

console.spec:
$:.push File.expand_path("../lib", __FILE__)

Gem::Specification.new do |s|
...
s.add_dependency ...
end

Since proper functioning of bundler is so critical to Ruby cartridges, we should upgrade to at least 1.0.12 (which fixes this) or a much newer rev (to get the latest).  We should be fairly aggressive with bundler updates.

Comment 1 Clayton Coleman 2012-04-16 01:40:54 UTC
Need this to be fixed to execute on some of the opensource strategy, or have a workaround.

Comment 2 Troy Dawson 2012-04-16 13:27:42 UTC
From what I read of the error message, it looks like bundler is behaving properly, but you haven't updated your Gem.lock file.  What you need to do is this

git commit -m "updating my gem.lock file" Gemfile.lock
git push

See if that fixes the problem.

Comment 3 Troy Dawson 2012-04-16 14:18:58 UTC
I might have jumped the gun on that.  (Although thus far everytime someone has brought a similar bug to me, what I suggested above has fixed their problem).
Can you give me a more solid example.  Is there something I can pull down and run to duplicate this problem on openshift?

Comment 4 Troy Dawson 2012-04-16 16:04:14 UTC
Clayton has gotten me an example, and I am now able to reproduce the problem.
I am working on updating bundler on both the client and server machine, to see if it fixes the problem.

Comment 5 Troy Dawson 2012-04-16 20:49:53 UTC
I have updated bundler to 1.0.21 and everything appears to be working now.  This should be available to the dev machine's tonight during the normal repo update.

One thing to note.  I updated to version 1.0.22 and everything kept hanging.  I never could figure out why, but when I went to version 1.0.21, everything worked fine.

Comment 6 Clayton Coleman 2012-04-22 20:39:02 UTC
Ugh - looked at this further: https://github.com/carlhuda/bundler/issues/1565 is also blocking me.  It's only fixed in 1.0.22, and I was using add_development_dependency.  Development dependencies are pretty common in gemspecs.

I'll try 1.0.22 in the devenv and see I can figure out what is going on.  That's really the only fix in 1.0.22 at this point, and there hasn't been a lot of traffic since October mostly because of bundle 1.1 dev.

Comment 7 Clayton Coleman 2012-04-22 20:40:33 UTC
I can remove the add_development_dependency for now and get unblocked.

Comment 8 Troy Dawson 2012-04-25 19:12:13 UTC
Talked with Clayton.  Version 1.0.21 is ok.  Moving it on to QA.

Comment 9 Peter Ruan 2012-04-26 21:08:19 UTC
verified on STG & DEVENV