Bug 965322

Summary: when creating a ruby-1.8 app, the ruby version created under vendor is showing as 1.9.1 instead of 1.8.7
Product: OpenShift Online Reporter: Peter Ruan <pruan>
Component: ContainersAssignee: Jhon Honce <jhonce>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 2.xCC: bmeng
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-06-11 04:06:51 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 Peter Ruan 2013-05-20 23:18:50 UTC
Description of problem:
  when creating a ruby-1.8 app, the ruby version created under vendor is showing as 1.9.1 instead of 1.8.7

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

AMI: devenv_3249

How reproducible:
always

Steps to Reproduce:
1. rhc app create app1 ruby-1.8
2. add the Gemfile and Gemfile.lock files into the local repo
3. do git commit and push 
4. cd /var/lib/openshift/<app_name>/app-root/repo/vendor/bundle/ruby/, you will see that it's 1.9.1 instead of 1.8

Actual results:
    ======
    Gemfile
    ======
    source 'http://rubygems.org'
     
    gem 'pg'
    gem 'rack'
    gem 'thread-dump'
     
    =========
    Gem.lock
    =========
    GEM
      remote: http://rubygems.org/
      specs:
        pg (0.14.1)
        rack (1.4.5)
        thread-dump (0.0.5)
     
    PLATFORMS
      ruby
     
    DEPENDENCIES
      pg
      rack
      thread-dump
     
     
     
    ============
    error output
    ============
     
     
    [pruan@homer-linux <DEV> app1]# git push
    Counting objects: 4, done.
    Delta compression using up to 4 threads.
    Compressing objects: 100% (3/3), done.
    Writing objects: 100% (3/3), 384 bytes, done.
    Total 3 (delta 1), reused 0 (delta 0)
    remote: Stopping Ruby cart
    remote: httpd (no pid file) not running
    remote: Running build on Ruby cart
    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.14.1) with native extensions .........
    remote: ............
    remote: ..
    remote:
    remote: Installing rack (1.4.5)
    remote: Installing thread-dump (0.0.5) with native extensions
    remote: .......
    remote:
    remote: Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
    remote:
    remote:         /opt/rh/ruby193/root/usr/bin/ruby extconf.rb
    remote: creating Makefile
    remote:
    remote: make
    remote: gcc -I. -I/opt/rh/ruby193/root/usr/include/x86_64-linux -I/opt/rh/ruby193/root/usr/include/ruby/backward -I/opt/rh/ruby193/root/usr/include -I.   -fPIC -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -mtune=generic -fPIC -m64 -o thread_dumper.o -c thread_dumper.c
    remote: In file included from thread_dumper.c:1:
    remote: thread_dumper.h:2:17: error: env.h: No such file or directory
    remote: thread_dumper.h:3:18: error: node.h: No such file or directory
    remote: In file included from thread_dumper.h:4,
    remote:                  from thread_dumper.c:1:
    remote: /opt/rh/ruby193/root/usr/include/ruby/backward/st.h:2:2: warning: #warning use "ruby/st.h" instead of bare "st.h"
    remote: In file included from thread_dumper.c:1:
    remote: thread_dumper.h:10: warning: parameter names (without types) in function declaration
    remote: thread_dumper.c:6: error: expected ')' before 'th'
    remote: thread_dumper.c: In function 'dump':
    remote: thread_dumper.c:44: error: dereferencing pointer to incomplete type
    remote: make: *** [thread_dumper.o] Error 1
    remote:
    remote:
    remote: Gem files will remain installed in /var/lib/openshift/519aa3de13ce5808d8000003/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/thread-dump-0.0.5 for inspection.
    remote: Results logged to /var/lib/openshift/519aa3de13ce5808d8000003/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/thread-dump-0.0.5/ext/gem_make.out
    remote: An error occured while installing thread-dump (0.0.5), and Bundler cannot continue.
    remote: Make sure that `gem install thread-dump -v '0.0.5'` succeeds before bundling.
    remote: An error occured executing the 'postreceive' command. For more details about the problem, try running the command again with the '--trace' option.
    To ssh://519aa3de13ce5808d8000003.rhcloud.com/~/git/app1.git/


Expected results:


Additional info:

Comment 1 Jhon Honce 2013-05-21 02:52:32 UTC
Fixed in https://github.com/openshift/origin-server/pull/2568

Comment 2 openshift-github-bot 2013-05-21 04:50:24 UTC
Commits pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/a0a9c6e278dbe41e3b4cef20adf125f1e96ef361
Bug 965322 - Ruby always building 1.9.3 environment

* Only bundle using SCL 1.9.3 if configured Ruby version is 1.9

https://github.com/openshift/origin-server/commit/7c7d41256aa26b0bc05358a0173b396df177f24e
Bug 965322 - Use expected version of ruby to start httpd

Comment 3 Meng Bo 2013-05-21 10:51:17 UTC
Checked this issue on devenv_3253, issue has been fixed.

[root@ip-10-60-53-75 openshift]# ls ruby18-bmengdev/app-root/repo/vendor/bundle/ruby/
1.8
[root@ip-10-60-53-75 openshift]# ls ruby19-bmengdev/app-root/repo/vendor/bundle/ruby/
1.9.1

Comment 4 Peter Ruan 2013-05-21 17:42:32 UTC
verified with the latest devenv.  The gem build step is working now.