Bug 997778 - Unable to install pg gem on ruby app
Summary: Unable to install pg gem on ruby app
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Containers
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: ---
: ---
Assignee: Dan McPherson
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-08-16 08:19 UTC by Oleg Fayans
Modified: 2016-12-01 00:27 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-08-29 12:51:51 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
sample Gemfile (62 bytes, text/plain)
2013-08-16 08:19 UTC, Oleg Fayans
no flags Details
Gemfile.lock (121 bytes, text/plain)
2013-08-19 10:40 UTC, Oleg Fayans
no flags Details

Description Oleg Fayans 2013-08-16 08:19:10 UTC
Created attachment 787196 [details]
sample Gemfile

Description of problem:


When I add a Gemfile with pg to a ruby app, the app fails to start

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


How reproducible:
Always

Steps to Reproduce:
1. rhc app create myapp ruby-1.8
2. rhc cartridge add postgresql-8.4 -a myapp
3. git add Gemfile && git commit -am "added gemfile" && git push

Actual results:
The app does not start. When you start it manually with rhc app-start myapp,
the homepage of the app shows an error:
Could not find pg-0.16.0 in any of the sources (Bundler::GemNotFound)

At the same time if you ssh into app and do bundle install, pg installs ok and has the correct version


Expected results:


Additional info:
reproduces on int and devenv instances

Comment 1 Hiro Asari 2013-08-16 18:38:18 UTC
Are you using Windows to develop locally? If so, please consult https://gist.github.com/bbrowning/6215393 for a workaround.

If not, please attach your Gemfile and Gemfile.lock.

Comment 2 Oleg Fayans 2013-08-19 10:40:00 UTC
Created attachment 787989 [details]
Gemfile.lock

Comment 3 Oleg Fayans 2013-08-19 10:40:42 UTC
I am developing on Linux. The Gemfile and Gemfile.lock are attached

Comment 4 Hiro Asari 2013-08-19 12:36:47 UTC
Did you commit Gemfile.lock to your git repo?

I cannot reproduce this on devenv_3672.

$ bx bin/rhc app create rackapp ruby-1.9 postgresql-9.2
Application Options
-------------------
  Namespace:  fooooooooooo
  Cartridges: ruby-1.9, postgresql-9.2
  Gear Size:  default
  Scaling:    no

Creating application 'rackapp' ... done

⋮

Cloning into 'rackapp'...
Warning: Permanently added 'rackapp-fooooooooooo.dev.rhcloud.com,67.202.28.124' (RSA) to the list of known hosts.
Checking connectivity... done

Your application 'rackapp' is now available.

⋮

$ cd rackapp
$ cat > Gemfile
source 'http://rubygems.org'

gem 'pg', '>=0.16.0'
gem 'rack'

$ bundle install
Fetching gem metadata from http://rubygems.org/..........
Resolving dependencies...
Using pg (0.16.0)
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.

$ git add Gemfile*
$ git commit -am 'Add Gemfile*'
[master c3f82ff] Add Gemfile*
 2 files changed, 16 insertions(+)
 create mode 100644 Gemfile
 create mode 100644 Gemfile.lock

$ git push
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 480 bytes | 0 bytes/s, done.
Total 4 (delta 1), reused 0 (delta 0)
remote: Stopping Ruby cartridge
remote: Waiting for stop to finish
remote: waiting for server to shut down.... done
remote: server stopped
remote: Stopping Postgres cartridge
remote: Building Ruby cartridge
remote: Bundling RubyGems based on Gemfile/Gemfile.lock to repo/vendor/bundle with 'bundle install --deployment'
remote: Fetching gem metadata from http://rubygems.org/..........
remote: Installing pg (0.16.0) with native extensions ...........
remote: .................
remote: ..
remote:
remote: Installing rack (1.5.2)
remote: Using bundler (1.1.4)
remote: Your bundle is complete! It was installed into ./vendor/bundle
remote: Starting application rackapp
remote: Starting Postgres cartridge
remote: server starting
remote: Postgres started
remote: Starting Ruby cartridge
To ssh://52120f0e8b1c4a0cff000001.rhcloud.com/~/git/rackapp.git/
   82fcc5b..c3f82ff  master -> master

Comment 5 congqiyuan 2013-08-20 02:45:57 UTC
I can't reproduce the bug on devenv_3676

Steps to Reproduce:
1. rhc app create app1 ruby-1.8
2. cd into app1'repo
3.cat > Gemfile
source 'http://rubygems.org'
gem 'pg', '>=0.16.0'
gem 'rack'
4. bundle intall
5.git push 

Actual Results:
remote: Stopping Ruby cartridge
remote: Waiting for stop to finish
remote: Building Ruby cartridge
remote: Bundling RubyGems based on Gemfile/Gemfile.lock to repo/vendor/bundle with 'bundle install --deployment'
remote: Fetching source index for http://rubygems.org/
remote: which: no sudo in (/var/lib/openshift/5212d487c0f9fe0ac6000001/.gem/bin:/bin:/usr/bin:/usr/sbin)
remote: Installing pg (0.16.0) with native extensions 
remote: Installing rack (1.5.2) 
remote: Using bundler (1.0.21) 
remote: Your bundle is complete! It was installed into ./vendor/bundle
remote: Starting application app1
remote: Starting Ruby cartridge
To ssh://5212d487c0f9fe0ac6000001.rhcloud.com/~/git/app1.git/
   bb64505..0743b0f  master -> master

Comment 6 Qiushui Zhang 2013-08-21 10:58:45 UTC
Tested on devenv_3680.

1. rhc app create myapp ruby-1.8
2. rhc cartridge add postgresql-8.4 -a myapp
3. cd myapp
4. Add "Gemfile":
source 'http://rubygems.org'

gem 'pg', '>=0.16.0'
gem 'rack'
5. bundle install
6. git add . && git commit -am "this is a comment" && git push
7. Check the webpage http://myapp-qiuzhang.dev.rhcloud.com/
   Check the app status. It is OK

So mark it as verified.


Note You need to log in before you can comment on or make changes to this bug.