Description of problem: Some common operations with bundler will throw an error. I'm completely willing to accept that this may not actually be a bug, if it's not close it as wontfix How reproducible: Every time Steps to Reproduce: 1. Create a ruby 1.9 install 2. Throw a valid Gemfile on the filesystem 3. Run bundle install Actual results: [fun-happytimes.rhcloud.com repo]\> bundle install Unfortunately, a fatal error has occurred. Please see the Bundler troubleshooting documentation at http://bit.ly/bundler-issues. Thanks! /opt/rh/ruby193/root/usr/share/ruby/fileutils.rb:247:in `mkdir': Permission denied - /var/lib/stickshift/a66f44ef6d0d4e9099f597b5ae240abf/.gem (Errno::EACCES) from /opt/rh/ruby193/root/usr/share/ruby/fileutils.rb:247:in `fu_mkdir' from /opt/rh/ruby193/root/usr/share/ruby/fileutils.rb:221:in `block (2 levels) in mkdir_p' from /opt/rh/ruby193/root/usr/share/ruby/fileutils.rb:219:in `reverse_each' from /opt/rh/ruby193/root/usr/share/ruby/fileutils.rb:219:in `block in mkdir_p' from /opt/rh/ruby193/root/usr/share/ruby/fileutils.rb:205:in `each' from /opt/rh/ruby193/root/usr/share/ruby/fileutils.rb:205:in `mkdir_p' from /opt/rh/ruby193/root/usr/share/ruby/pathname.rb:514:in `mkpath' from /opt/rh/ruby193/root/usr/share/gems/gems/bundler-1.1.4/lib/bundler/installer.rb:19:in `run' from /opt/rh/ruby193/root/usr/share/gems/gems/bundler-1.1.4/lib/bundler/installer.rb:12:in `install' from /opt/rh/ruby193/root/usr/share/gems/gems/bundler-1.1.4/lib/bundler/cli.rb:220:in `install' from /opt/rh/ruby193/root/usr/share/gems/gems/thor-0.15.4/lib/thor/task.rb:27:in `run' from /opt/rh/ruby193/root/usr/share/gems/gems/thor-0.15.4/lib/thor/invocation.rb:120:in `invoke_task' from /opt/rh/ruby193/root/usr/share/gems/gems/thor-0.15.4/lib/thor.rb:275:in `dispatch' from /opt/rh/ruby193/root/usr/share/gems/gems/thor-0.15.4/lib/thor/base.rb:425:in `start' from /opt/rh/ruby193/root/usr/share/gems/gems/bundler-1.1.4/bin/bundle:13:in `<top (required)>' from /opt/rh/ruby193/root/usr/bin/bundle:23:in `load' from /opt/rh/ruby193/root/usr/bin/bundle:23:in `<main>'
Configure hook enhanced to create ~/.gem directories code will be pushed once repositories are open for business.
https://github.com/openshift/origin-server/pull/620
Tested on devenv_2301 Steps: 1. Create a ruby-1.9 app 2. ssh into app, cd $OPENSHIFT_REPO_DIR 3. Create a valid Gemfile under $OPENSHIFT_REPO_DIR [r19-2301t.dev.rhcloud.com repo]\> cat Gemfile [r19-2301t.dev.rhcloud.com repo]\> cat Gemfile source "http://rubygems.org" gem "rack" 4. Run 'bundle install' [r19-2301t.dev.rhcloud.com repo]\> bundle install Using rack (1.4.1) Using bundler (1.1.4) Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed. Repeat above steps for ruby-1.8 apps For ruby-1.8, I caught this error: [r18-2301t.dev.rhcloud.com repo]\> bundle install Fetching source index for http://rubygems.org/ which: no sudo in (/usr/libexec/openshift/cartridges/ruby-1.8/info/bin/:/usr/libexec/openshift/cartridges/abstract-httpd/info/bin/:/usr/libexec/openshift/cartridges/abstract/info/bin/:/sbin:/usr/sbin:/bin:/usr/bin) Gem::Exception: Cannot load gem at [/usr/lib/ruby/gems/1.8/cache/rack-1.4.1.gem] in /var/lib/openshift/dfe1250e6b20441d85887c6cabd469ef/app-root/runtime/repo An error occured while installing rack (1.4.1), and Bundler cannot continue. Make sure that `gem install rack -v '1.4.1'` succeeds before bundling.
You need to set GEM_HOME to point to ~/.gem. Otherwise, bundler will attempt to install into the system directories as you demonstrated in comment#3
Verified on devenv_2303 For ruby-1.8, need to set GEM_HOME to point to ~/.gem, and bundle install will work. [ruby18-2303t.dev.rhcloud.com ~]\> export GEM_HOME=/var/lib/openshift/5555b0bfab3b4447b9d1b438e250af24/.gem/ [ruby18-2303t.dev.rhcloud.com repo]\> cat Gemfile source "http://rubygems.org" gem "rack" [ruby18-2303t.dev.rhcloud.com repo]\> bundle install Fetching source index for http://rubygems.org/ which: no sudo in (/usr/libexec/openshift/cartridges/ruby-1.8/info/bin/:/usr/libexec/openshift/cartridges/abstract-httpd/info/bin/:/usr/libexec/openshift/cartridges/abstract/info/bin/:/sbin:/usr/sbin:/bin:/usr/bin) Installing rack (1.4.1) Using bundler (1.0.21) Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.