Bug 1025713

Summary: Unable to run bundle install on a ruby-1.8 app
Product: OpenShift Online Reporter: Chris Ryan <cryan>
Component: ContainersAssignee: Michal Fojtik <mfojtik>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: high    
Version: 2.xCC: dmcphers, jhonce, mfojtik, pruan, tdawson, wsun, zhewang
Target Milestone: ---Keywords: UpcomingRelease
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-24 03:28:29 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:
Embargoed:

Description Chris Ryan 2013-11-01 11:09:59 UTC
Description of problem:
When running "bundle install" against a Gemfile on ruby-1.8, the application will hang indefinitely. Bundle install performs correctly in ruby-1.9, however.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. Create a ruby-1.8 app
rhc create-app rubytest ruby-1.8
2. SSH into the app, create a simple Gemfile, and export the gem home directory.
rhc ssh rubytest
cd $OPENSHIFT_REPO_DIR
create a Gemfile with the following lines:
source 'https://rubygems.org'
gem 'rack'
export GEM_HOME=~/.gem
3.run 'bundle install' in the $OPENSHIFT_REPO_DIR

Actual results:
bundle install will hang indefinitely (or timeout, if using the client)

Expected results:
bundle install executes correctly

Additional info:

Comment 2 Michal Fojtik 2013-11-01 11:42:03 UTC
I was able to fix this bug by updating the 'bundler' gem:

[ruby01-mfojtik.dev.rhcloud.com repo]\> gem update bundler
Updating installed gems
Updating bundler
Successfully installed bundler-1.3.5
Gems updated: bundler

Then:

[ruby01-mfojtik.dev.rhcloud.com repo]\> bundle 
Fetching gem metadata from https://rubygems.org/..........
Resolving dependencies...
Using rack (1.5.2) 
Using bundler (1.3.5) 
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.

I would suggest to update the rubygem-bundler to 1.3.5, currently we have 1.0.21.

Comment 4 Michal Fojtik 2013-11-01 12:36:17 UTC
I can reproduce this bug also in PROD:

[ruby-mfojtik.rhcloud.com repo]\> bundle
Fetching source index for https://rubygems.org/
[get stuck here...]

Comment 6 Michal Fojtik 2013-11-06 23:20:17 UTC
Just FYI, I set this bug to high priority, because all ruby-1.8 cartridges in PROD  are currently affected by this and thus they are not usable.

Comment 7 Troy Dawson 2013-11-06 23:22:54 UTC
I'll get our rubygem-bundler updated.

Comment 8 Troy Dawson 2013-11-07 21:26:36 UTC
rubygem-bundler has been updated to version 1.3.5 and is able to be tested on devenv machines.
Please test to make sure this fixes the problem.

Comment 9 Chris Ryan 2013-11-08 15:03:14 UTC
I'm working with ami-id devenv_4008 (ami-73dc871a). After creating a ruby-1.8 app, and SSH'ing to the gear, I am still unable to perform any command using bundle. Any command (bundle install, bundle --version, bundle --install, etc.) returns: 

/usr/lib/ruby/gems/1.8/gems/bundler-1.3.5/lib/bundler/cli.rb:20: undefined method `stop_on_unknown_option!' for Bundler::CLI:Class (NoMethodError)
	from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
	from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
	from /usr/lib/ruby/gems/1.8/gems/bundler-1.3.5/bin/bundle:18
	from /usr/bin/bundle:19:in `load'
	from /usr/bin/bundle:19

Comment 10 Michal Fojtik 2013-11-08 15:19:24 UTC
Chris:

I can reproduce this as well:

[ruby03-mfojtik.dev.rhcloud.com 527cfa7af3f3dd8e160001c9]\> bundle
/usr/lib/ruby/gems/1.8/gems/bundler-1.3.5/lib/bundler/cli.rb:20: undefined method `stop_on_unknown_option!' for Bundler::CLI:Class (NoMethodError)
	from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
	from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
	from /usr/lib/ruby/gems/1.8/gems/bundler-1.3.5/bin/bundle:18
	from /usr/bin/bundle:19:in `load'
	from /usr/bin/bundle:19

Note, that this happens ONLY when I use the RHEL rubygem-bundler. If I do 'gem update bundler' or 'gem reinstall bundler' manually I can't hit this issues.

Comment 11 Michal Fojtik 2013-11-08 15:25:30 UTC
Problem identified: It is the old version of 'rubygem-thor'. When I run 'gem update thor' in a gear, I get rid of this error.

Comment 12 Troy Dawson 2013-11-08 16:23:54 UTC
I have created an updated rubygem-thor.
https://brewweb.devel.redhat.com/buildinfo?buildID=309440
I have verified that it fixes this problem.  I am running this package through our general tests to make sure it doesn't break anything.  If it doesn't I'll get it into the candidate repo so regular devenv's can use it.

Comment 13 Troy Dawson 2013-11-08 19:56:14 UTC
rubygem-thor-0.18.1-1.el6oso has passed out tests and is in the candidate repo.  It is now able to be tested on the devenv's.

Comment 14 Peter Ruan 2013-11-09 01:13:20 UTC
still seeing problems with devenv_4009

[17:05:46] INFO> GET https://ec2-54-234-81-69.compute-1.amazonaws.com/broker/rest/application/527d8a447708038c8a000006/gear_groups {} [200]
      [17:05:47] INFO> Remote cmd: `cd $OPENSHIFT_REPO_DIR; echo "source \"http://rubygems.org\"" >> ./Gemfile; echo "gem \"rack\"" >> ./Gemfile; export GEM_HOME=~/.gem/; bundle install` @ssh://527d8a447708038c8a000006.rhcloud.com
      /usr/lib/ruby/gems/1.8/gems/bundler-1.3.5/lib/bundler/cli.rb:20: undefined method `stop_on_unknown_option!' for Bundler::CLI:Class (NoMethodError)
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from /usr/lib/ruby/gems/1.8/gems/bundler-1.3.5/bin/bundle:18
        from /usr/bin/bundle:19:in `load'
        from /usr/bin/bundle:19
      [17:05:48] INFO> Exit Status: 1

Comment 15 Chris Ryan 2013-11-11 16:41:38 UTC
Tried again today with the newest devenv ( devenv_4017 (ami-61dd8708) ) after following the steps in Comment #1, and running bundle install, the error was:

bundle install
Could not load OpenSSL.
You must recompile Ruby with OpenSSL support or change the sources in your Gemfile from 'https' to 'http'.
Instructions for compiling with OpenSSL using RVM are available at rvm.io/packages/openssl.

Comment 16 Chris Ryan 2013-11-11 16:46:16 UTC
As a follow up, the bundle install command works if the Gemfile has an http url (http://rubygems.org/), as the error message helpfully points out.

Comment 17 Chris Ryan 2013-11-11 16:48:19 UTC
The bundle install will hang indefinitely (or timeout, if using the client) as before.

Comment 18 Michal Fojtik 2013-11-11 19:50:39 UTC
Chris: Thanks for testing this. The rubygem-bundler is not compiled with:

BuildRequires: openssl-devel

Comment 19 Michal Fojtik 2013-11-12 11:16:47 UTC
So the issue turns out into missing Requires: rubygem-net-http-persistent. The problem should be fixed now on latest devenv.

Comment 20 Michal Fojtik 2013-11-12 11:21:13 UTC
*** Bug 1029306 has been marked as a duplicate of this bug. ***

Comment 21 Zhe Wang 2013-11-13 01:57:37 UTC
Verified this bug in devenv_4025

remote: Fetching gem metadata from https://rubygems.org/..........
remote: Installing rack (1.5.2) 
remote: Installing ref (1.0.5) 
remote: Installing thread-dump (0.0.5) 
remote: Using bundler (1.3.5) 
remote: Your bundle is complete!