# Ruby-opengl gem uses ruby1.9, even from gem1.8

**URL:** <https://www.ruby-forum.com/t/ruby-opengl-gem-uses-ruby1-9-even-from-gem1-8/138846>\
**Category:** Ruby\
**Created:** [May 28, 2008, 10:15am UTC](https://www.ruby-forum.com/t/ruby-opengl-gem-uses-ruby1-9-even-from-gem1-8/138846 "2008-05-28T10:15:12Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dgm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/df788c/32.png) [@dgm](https://www.ruby-forum.com/u/dgm)\
**Post date:** [May 28, 2008, 10:15am UTC](https://www.ruby-forum.com/t/ruby-opengl-gem-uses-ruby1-9-even-from-gem1-8/138846/1 "2008-05-28T10:15:12Z")

</div>

This is on an Ubuntu Hardy system, on x86\_64. Both Ruby 1.8 and 1.9 are  
installed.

I was tracking down the lack of ruby.h, which surprised me, as  
ruby1.8-dev is  
installed. Scrolling up even further, though, and something just seems  
wrong  
about these three lines:

rake RUBYARCHDIR=/var/lib/gems/1.8/gems/ruby-opengl-0.60.0/lib  
RUBYLIBDIR=/var/lib/gems/1.8/gems/ruby-opengl-0.60.0/lib extension  
/usr/bin/ruby1.9 mkrf\_conf.rb  
(in /var/lib/gems/1.8/gems/ruby-opengl-0.60.0)

Why is ruby1.9 being used to run mkrf\_conf.rb? I am using a 1.8 gem –  
as you  
can see, it’s trying to install in a 1.8 path, and:

$ head -1 `which gem`  
#! /usr/bin/ruby1.8  
$ head -1 `which gem1.9`  
#!/usr/bin/ruby1.9

I am sure I was using ‘gem’, and not ‘gem1.9’.

Full log from /var/lib/gems/1.8/gems/ruby-opengl-0.60.0/gem\_make.out:

rake RUBYARCHDIR=/var/lib/gems/1.8/gems/ruby-opengl-0.60.0/lib  
RUBYLIBDIR=/var/lib/gems/1.8/gems/ruby-opengl-0.60.0/lib extension  
/usr/bin/ruby1.9 mkrf\_conf.rb  
(in /var/lib/gems/1.8/gems/ruby-opengl-0.60.0)  
rake  
cc -fPIC -fno-strict-aliasing -g -fPIC -Wall -DRUBY\_VERSION=190  
-I/usr/include/ruby-1.9.0 -I/usr/include/ruby-1.9.0/x86\_64-linux  
-I/usr/lib/ruby/1.9.0/x86\_64-linux -I/usr/local/lib/site\_ruby/1.9.0 -I.  
-c  
gl.c  
(in /var/lib/gems/1.8/gems/ruby-opengl-0.60.0/ext/gl)  
In file included from gl.c:18:  
…/common/common.h:25:18: error: ruby.h: No such file or directory  
In file included from …/common/common.h:51,  
from gl.c:18:  
…/common/gl-error.h:16: warning: parameter names (without types) in  
function  
declaration  
…/common/gl-error.h:18: error: expected â€˜=â€™, â€˜,â€™, â€˜;â€™, â€˜asmâ€™  
or â€˜\_\_attribute\_\_â€™ before â€˜error\_checkingâ€™  
…/common/gl-error.h:19: error: expected â€˜=â€™, â€˜,â€™, â€˜;â€™, â€˜asmâ€™  
or â€˜\_\_attribute\_\_â€™ before â€˜inside\_begin\_endâ€™  
In file included from …/common/common.h:54,  
from gl.c:18:  
…/common/conv.h: In function â€˜num2doubleâ€™:  
…/common/conv.h:55: error: expected declaration specifiers before  
â€˜VALUEâ€™  
…/common/conv.h:55: warning: implicit declaration of function  
â€˜FIXNUM\_Pâ€™  
…/common/conv.h:55: warning: implicit declaration of function  
â€˜FIX2LONGâ€™  
…/common/conv.h:55: warning: implicit declaration of function â€˜TYPEâ€™  
…/common/conv.h:55: error: â€˜T\_FLOATâ€™ undeclared (first use in this  
function)  
…/common/conv.h:55: error: (Each undeclared identifier is reported only  
once  
…/common/conv.h:55: error: for each function it appears in.)  
…/common/conv.h:55: warning: implicit declaration of function â€˜RFLOATâ€™  
…/common/conv.h:55: error: invalid type argument of â€˜-\>â€™  
…/common/conv.h:55: error: â€˜Qtrueâ€™ undeclared (first use in this  
function)  
…/common/conv.h:55: error: â€˜Qfalseâ€™ undeclared (first use in this  
function)  
…/common/conv.h:55: error: â€˜Qnilâ€™ undeclared (first use in this  
function)  
…/common/conv.h:55: warning: implicit declaration of function  
â€˜rb\_num2dblâ€™  
…/common/conv.h: In function â€˜num2intâ€™:  
…/common/conv.h:62: error: expected declaration specifiers before  
â€˜VALUEâ€™  
…/common/conv.h:62: error: â€˜T\_FLOATâ€™ undeclared (first use in this  
function)  
…/common/conv.h:62: error: invalid type argument of â€˜-\>â€™  
…/common/conv.h:62: error: â€˜Qtrueâ€™ undeclared (first use in this  
function)  
…/common/conv.h:62: error: â€˜Qfalseâ€™ undeclared (first use in this  
function)  
…/common/conv.h:62: error: â€˜Qnilâ€™ undeclared (first use in this  
function)  
…/common/conv.h:62: warning: implicit declaration of function  
â€˜NUM2LONGâ€™  
…/common/conv.h: In function â€˜num2uintâ€™:  
…/common/conv.h:63: error: expected declaration specifiers before  
â€˜VALUEâ€™  
…/common/conv.h:63: warning: implicit declaration of function  
â€˜FIX2ULONGâ€™  
…/common/conv.h:63: error: â€˜T\_FLOATâ€™ undeclared (first use in this  
function)  
…/common/conv.h:63: error: invalid type argument of â€˜-\>â€™  
…/common/conv.h:63: error: â€˜Qtrueâ€™ undeclared (first use in this  
function)  
…/common/conv.h:63: error: â€˜Qfalseâ€™ undeclared (first use in this  
function)  
…/common/conv.h:63: error: â€˜Qnilâ€™ undeclared (first use in this  
function)  
…/common/conv.h:63: warning: implicit declaration of function  
â€˜NUM2ULONGâ€™  
…/common/conv.h: At top level:  
…/common/conv.h:114: error: expected â€˜=â€™, â€˜,â€™, â€˜;â€™, â€˜asmâ€™ or  
â€˜\_\_attribute\_\_â€™  
before â€˜cond\_GLBOOL2RUBYâ€™  
…/common/conv.h:115: error: expected â€˜=â€™, â€˜,â€™, â€˜;â€™, â€˜asmâ€™ or  
â€˜\_\_attribute\_\_â€™  
before â€˜cond\_GLBOOL2RUBY\_Uâ€™  
…/common/conv.h:116: error: expected â€˜=â€™, â€˜,â€™, â€˜;â€™, â€˜asmâ€™ or  
â€˜\_\_attribute\_\_â€™  
before â€˜cond\_GLBOOL2RUBY\_LLâ€™  
…/common/conv.h:117: error: expected â€˜=â€™, â€˜,â€™, â€˜;â€™, â€˜asmâ€™ or  
â€˜\_\_attribute\_\_â€™  
before â€˜cond\_GLBOOL2RUBY\_ULLâ€™  
…/common/conv.h:118: error: expected â€˜=â€™, â€˜,â€™, â€˜;â€™, â€˜asmâ€™ or  
â€˜\_\_attribute\_\_â€™  
before â€˜cond\_GLBOOL2RUBY\_Fâ€™  
…/common/conv.h:119: error: expected â€˜=â€™, â€˜,â€™, â€˜;â€™, â€˜asmâ€™ or  
â€˜\_\_attribute\_\_â€™  
before â€˜cond\_GLBOOL2RUBY\_Dâ€™  
…/common/conv.h: In function â€˜ary2cintâ€™:  
…/common/conv.h:142: error: expected declaration specifiers before  
â€˜VALUEâ€™  
…/common/conv.h:142: warning: implicit declaration of function â€˜RARRAYâ€™  
…/common/conv.h:142: warning: implicit declaration of function  
â€˜rb\_Arrayâ€™  
…/common/conv.h:142: warning: assignment makes pointer from integer  
without a  
cast  
…/common/conv.h:142: error: dereferencing pointer to incomplete type  
…/common/conv.h:142: error: dereferencing pointer to incomplete type  
…/common/conv.h:142: error: dereferencing pointer to incomplete type  
…/common/conv.h:142: warning: implicit declaration of function  
â€˜rb\_ary\_entryâ€™  
…/common/conv.h:142: error: â€˜VALUEâ€™ undeclared (first use in this  
function)  
…/common/conv.h:142: error: expected â€˜)â€™ before â€˜aryâ€™  
…/common/conv.h: In function â€˜ary2cuintâ€™:  
…/common/conv.h:143: error: expected declaration specifiers before  
â€˜VALUEâ€™  
…/common/conv.h:143: warning: assignment makes pointer from integer  
without a  
cast  
…/common/conv.h:143: error: dereferencing pointer to incomplete type  
…/common/conv.h:143: error: dereferencing pointer to incomplete type  
…/common/conv.h:143: error: dereferencing pointer to incomplete type  
…/common/conv.h:143: error: â€˜VALUEâ€™ undeclared (first use in this  
function)  
…/common/conv.h:143: error: expected â€˜)â€™ before â€˜aryâ€™  
…/common/conv.h: In function â€˜ary2cbyteâ€™:  
…/common/conv.h:144: error: expected declaration specifiers before  
â€˜VALUEâ€™  
…/common/conv.h:144: warning: assignment makes pointer from integer  
without a  
cast  
…/common/conv.h:144: error: dereferencing pointer to incomplete type  
…/common/conv.h:144: error: dereferencing pointer to incomplete type  
…/common/conv.h:144: error: dereferencing pointer to incomplete type  
…/common/conv.h:144: error: â€˜VALUEâ€™ undeclared (first use in this  
function)  
…/common/conv.h:144: error: expected â€˜)â€™ before â€˜aryâ€™  
…/common/conv.h: In function â€˜ary2cubyteâ€™:  
…/common/conv.h:145: error: expected declaration specifiers before  
â€˜VALUEâ€™  
…/common/conv.h:145: warning: assignment makes pointer from integer  
without a  
cast  
…/common/conv.h:145: error: dereferencing pointer to incomplete type  
…/common/conv.h:145: error: dereferencing pointer to incomplete type  
…/common/conv.h:145: error: dereferencing pointer to incomplete type  
…/common/conv.h:145: error: â€˜VALUEâ€™ undeclared (first use in this  
function)  
…/common/conv.h:145: error: expected â€˜)â€™ before â€˜aryâ€™  
…/common/conv.h: In function â€˜ary2cshortâ€™:  
…/common/conv.h:146: error: expected declaration specifiers before  
â€˜VALUEâ€™  
…/common/conv.h:146: warning: assignment makes pointer from integer  
without a  
cast  
…/common/conv.h:146: error: dereferencing pointer to incomplete type  
…/common/conv.h:146: error: dereferencing pointer to incomplete type  
…/common/conv.h:146: error: dereferencing pointer to incomplete type  
…/common/conv.h:146: error: â€˜VALUEâ€™ undeclared (first use in this  
function)  
…/common/conv.h:146: error: expected â€˜)â€™ before â€˜aryâ€™  
…/common/conv.h: In function â€˜ary2cushortâ€™:  
…/common/conv.h:147: error: expected declaration specifiers before  
â€˜VALUEâ€™  
…/common/conv.h:147: warning: assignment makes pointer from integer  
without a  
cast  
…/common/conv.h:147: error: dereferencing pointer to incomplete type  
…/common/conv.h:147: error: dereferencing pointer to incomplete type  
…/common/conv.h:147: error: dereferencing pointer to incomplete type  
…/common/conv.h:147: error: â€˜VALUEâ€™ undeclared (first use in this  
function)  
…/common/conv.h:147: error: expected â€˜)â€™ before â€˜aryâ€™  
…/common/conv.h: In function â€˜ary2cbooleanâ€™:  
…/common/conv.h:148: error: expected declaration specifiers before  
â€˜VALUEâ€™  
…/common/conv.h:148: warning: assignment makes pointer from integer  
without a  
cast  
…/common/conv.h:148: error: dereferencing pointer to incomplete type  
…/common/conv.h:148: error: dereferencing pointer to incomplete type  
…/common/conv.h:148: error: dereferencing pointer to incomplete type  
…/common/conv.h:148: error: â€˜VALUEâ€™ undeclared (first use in this  
function)  
…/common/conv.h:148: error: expected â€˜)â€™ before â€˜aryâ€™  
…/common/conv.h: In function â€˜ary2cfloatâ€™:  
…/common/conv.h:149: error: expected declaration specifiers before  
â€˜VALUEâ€™  
…/common/conv.h:149: warning: assignment makes pointer from integer  
without a  
cast  
…/common/conv.h:149: error: dereferencing pointer to incomplete type  
…/common/conv.h:149: error: dereferencing pointer to incomplete type  
…/common/conv.h:149: error: dereferencing pointer to incomplete type  
…/common/conv.h:149: error: â€˜VALUEâ€™ undeclared (first use in this  
function)  
…/common/conv.h:149: error: expected â€˜)â€™ before â€˜aryâ€™  
…/common/conv.h: In function â€˜ary2cdoubleâ€™:  
…/common/conv.h:150: error: expected declaration specifiers before  
â€˜VALUEâ€™  
…/common/conv.h:150: warning: assignment makes pointer from integer  
without a  
cast  
…/common/conv.h:150: error: dereferencing pointer to incomplete type  
…/common/conv.h:150: error: dereferencing pointer to incomplete type  
…/common/conv.h:150: error: dereferencing pointer to incomplete type  
…/common/conv.h:150: error: â€˜VALUEâ€™ undeclared (first use in this  
function)  
…/common/conv.h:150: error: expected â€˜)â€™ before â€˜aryâ€™  
…/common/conv.h: In function â€˜ary2cmatdoubleâ€™:  
…/common/conv.h:176: error: expected declaration specifiers before  
â€˜VALUEâ€™  
…/common/conv.h:176: warning: implicit declaration of function  
â€˜rb\_funcallâ€™  
…/common/conv.h:176: warning: implicit declaration of function  
â€˜rb\_internâ€™  
…/common/conv.h:176: error: invalid type argument of â€˜-\>â€™  
…/common/conv.h:176: warning: implicit declaration of function  
â€˜rb\_raiseâ€™  
…/common/conv.h:176: error: â€˜rb\_eArgErrorâ€™ undeclared (first use in  
this  
function)  
…/common/conv.h: In function â€˜ary2cmatfloatâ€™:  
…/common/conv.h:177: error: expected declaration specifiers before  
â€˜VALUEâ€™  
…/common/conv.h:177: error: invalid type argument of â€˜-\>â€™  
…/common/conv.h:177: error: â€˜rb\_eArgErrorâ€™ undeclared (first use in  
this  
function)  
…/common/conv.h: In function â€˜ary2cmatdoublecountâ€™:  
…/common/conv.h:200: error: expected declaration specifiers before  
â€˜VALUEâ€™  
…/common/conv.h:200: warning: implicit declaration of function  
â€˜RARRAY\_LENâ€™  
…/common/conv.h:200: warning: implicit declaration of function â€˜xfreeâ€™  
…/common/conv.h:200: error: â€˜rb\_eArgErrorâ€™ undeclared (first use in  
this  
function)  
…/common/conv.h: In function â€˜ary2cmatfloatcountâ€™:  
…/common/conv.h:201: error: expected declaration specifiers before  
â€˜VALUEâ€™  
…/common/conv.h:201: error: â€˜rb\_eArgErrorâ€™ undeclared (first use in  
this  
function)  
In file included from gl.c:18:  
…/common/common.h: At top level:  
…/common/common.h:81: error: expected â€˜=â€™, â€˜,â€™, â€˜;â€™, â€˜asmâ€™ or  
â€˜\_\_attribute\_\_â€™  
before â€˜cProcâ€™  
…/common/common.h: In function â€˜glformat\_sizeâ€™:  
…/common/common.h:173: error: â€˜rb\_eArgErrorâ€™ undeclared (first use in  
this  
function)  
…/common/common.h: In function â€˜gltype\_glformat\_unit\_sizeâ€™:  
…/common/common.h:231: error: â€˜rb\_eArgErrorâ€™ undeclared (first use in  
this  
function)  
…/common/common.h: In function â€˜get\_uniform\_sizeâ€™:  
…/common/common.h:316: error: â€˜rb\_eTypeErrorâ€™ undeclared (first use in  
this  
function)  
…/common/common.h: At top level:  
…/common/common.h:338: error: expected declaration specifiers or â€˜…â€™  
before â€˜VALUEâ€™  
…/common/common.h: In function â€˜CheckDataSizeâ€™:  
…/common/common.h:344: warning: implicit declaration of  
function â€˜RSTRING\_LENâ€™  
…/common/common.h:344: error: â€˜dataâ€™ undeclared (first use in this  
function)  
…/common/common.h:345: error: â€˜rb\_eArgErrorâ€™ undeclared (first use in  
this  
function)  
…/common/common.h: At top level:  
…/common/common.h:349: error: expected â€˜=â€™, â€˜,â€™, â€˜;â€™, â€˜asmâ€™  
or â€˜\_\_attribute\_\_â€™ before â€˜allocate\_buffer\_with\_stringâ€™  
…/common/common.h: In function â€˜load\_gl\_functionâ€™:  
…/common/common.h:390: error: â€˜rb\_eNotImpErrorâ€™ undeclared (first use  
in this  
function)  
…/common/common.h: At top level:  
…/common/common.h:395: error: expected â€˜=â€™, â€˜,â€™, â€˜;â€™, â€˜asmâ€™  
or â€˜\_\_attribute\_\_â€™ before â€˜pack\_array\_or\_pass\_stringâ€™  
gl.c:20: error: expected â€˜=â€™, â€˜,â€™, â€˜;â€™, â€˜asmâ€™ or â€˜\_\_attribute\_\_â€™  
before â€˜moduleâ€™  
gl.c:22: warning: parameter names (without types) in function  
declaration  
gl.c:23: warning: parameter names (without types) in function  
declaration  
gl.c:24: warning: parameter names (without types) in function  
declaration  
gl.c:25: warning: parameter names (without types) in function  
declaration  
gl.c:26: warning: parameter names (without types) in function  
declaration  
gl.c:27: warning: parameter names (without types) in function  
declaration  
gl.c:28: warning: parameter names (without types) in function  
declaration  
gl.c:29: warning: parameter names (without types) in function  
declaration  
gl.c:30: warning: parameter names (without types) in function  
declaration  
gl.c:31: warning: parameter names (without types) in function  
declaration  
gl.c:32: warning: parameter names (without types) in function  
declaration  
gl.c:33: warning: parameter names (without types) in function  
declaration  
gl.c:34: warning: parameter names (without types) in function  
declaration  
gl.c:35: warning: parameter names (without types) in function  
declaration  
gl.c: In function â€˜GetOpenglVersionâ€™:  
gl.c:49: error: â€˜error\_checkingâ€™ undeclared (first use in this function)  
gl.c:49: error: â€˜Qtrueâ€™ undeclared (first use in this function)  
gl.c:49: error: â€˜inside\_begin\_endâ€™ undeclared (first use in this  
function)  
gl.c:49: error: â€˜Qfalseâ€™ undeclared (first use in this function)  
gl.c:51: warning: implicit declaration of function â€˜sscanfâ€™  
gl.c:51: warning: incompatible implicit declaration of built-in  
function â€˜sscanfâ€™  
gl.c: In function â€˜GetOpenglExtensionsâ€™:  
gl.c:79: error: â€˜error\_checkingâ€™ undeclared (first use in this function)  
gl.c:79: error: â€˜Qtrueâ€™ undeclared (first use in this function)  
gl.c:79: error: â€˜inside\_begin\_endâ€™ undeclared (first use in this  
function)  
gl.c:79: error: â€˜Qfalseâ€™ undeclared (first use in this function)  
gl.c:81: warning: implicit declaration of function â€˜strlenâ€™  
gl.c:81: warning: incompatible implicit declaration of built-in  
function â€˜strlenâ€™  
gl.c:82: warning: implicit declaration of function â€˜ALLOC\_Nâ€™  
gl.c:82: error: expected expression before â€˜GLcharâ€™  
gl.c:82: warning: assignment makes pointer from integer without a cast  
gl.c:83: warning: implicit declaration of function â€˜strcpyâ€™  
gl.c:83: warning: incompatible implicit declaration of built-in  
function â€˜strcpyâ€™  
gl.c: In function â€˜CheckExtensionâ€™:  
gl.c:106: warning: incompatible implicit declaration of built-in  
function â€˜strlenâ€™  
gl.c:107: error: expected expression before â€˜GLcharâ€™  
gl.c:107: warning: assignment makes pointer from integer without a cast  
gl.c:108: warning: incompatible implicit declaration of built-in  
function â€˜strcpyâ€™  
gl.c:112: warning: implicit declaration of function â€˜strstrâ€™  
gl.c:112: warning: incompatible implicit declaration of built-in  
function â€˜strstrâ€™  
gl.c: In function â€˜CheckVersionExtensionâ€™:  
gl.c:128: warning: incompatible implicit declaration of built-in  
function â€˜sscanfâ€™  
gl.c: At top level:  
gl.c:140: error: expected â€˜=â€™, â€˜,â€™, â€˜;â€™, â€˜asmâ€™ or â€˜\_\_attribute\_\_â€™  
before â€˜IsAvailableâ€™  
gl.c:142: error: expected identifier or â€˜(â€™ before â€˜{â€™ token  
gl.c: In function â€˜CheckBufferBindingâ€™:  
gl.c:175: error: â€˜rb\_eRuntimeErrorâ€™ undeclared (first use in this  
function)  
gl.c:179: error: â€˜error\_checkingâ€™ undeclared (first use in this  
function)  
gl.c:179: error: â€˜Qtrueâ€™ undeclared (first use in this function)  
gl.c:179: error: â€˜inside\_begin\_endâ€™ undeclared (first use in this  
function)  
gl.c:179: error: â€˜Qfalseâ€™ undeclared (first use in this function)  
gl.c: In function â€˜Init\_glâ€™:  
gl.c:185: error: â€˜VALUEâ€™ undeclared (first use in this function)  
gl.c:185: error: expected â€˜;â€™ before â€˜VERSIONâ€™  
gl.c:187: error: â€˜moduleâ€™ undeclared (first use in this function)  
gl.c:187: warning: implicit declaration of function â€˜rb\_define\_moduleâ€™  
gl.c:189: warning: implicit declaration of function â€˜rb\_define\_constâ€™  
gl.c:189: error: â€˜VERSIONâ€™ undeclared (first use in this function)  
gl.c:208: warning: implicit declaration of  
function â€˜rb\_define\_module\_functionâ€™  
gl.c:208: error: â€˜IsAvailableâ€™ undeclared (first use in this function)  
rake aborted!  
Command failed with status (1):  
[cc -fPIC -fno-strict-aliasing -g -fPIC …]  
/var/lib/gems/1.8/gems/ruby-opengl-0.60.0/ext/gl/Rakefile:29:in `block  
in \<top  
(required)\>’  
(See full trace by running task with --trace)  
rake aborted!  
Command failed with status (1): [rake…]

(See full trace by running task with --trace)

---

<div class="post-metadata">

**Author:** ![dgm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/df788c/32.png) [@dgm](https://www.ruby-forum.com/u/dgm)\
**Post date:** [May 28, 2008, 10:56am UTC](https://www.ruby-forum.com/t/ruby-opengl-gem-uses-ruby1-9-even-from-gem1-8/138846/2 "2008-05-28T10:56:37Z")

</div>

On May 28, 2008, at 01:14 AM, David M. wrote:

> rake RUBYARCHDIR=/var/lib/gems/1.8/gems/ruby-opengl-0.60.0/lib  
> $ head -1 `which gem1.9`  
> #!/usr/bin/ruby1.9

head -1 `which rake`

---

<div class="post-metadata">

**Author:** ![dgm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/df788c/32.png) [@dgm](https://www.ruby-forum.com/u/dgm)\
**Post date:** [May 28, 2008, 12:25pm UTC](https://www.ruby-forum.com/t/ruby-opengl-gem-uses-ruby1-9-even-from-gem1-8/138846/3 "2008-05-28T12:25:22Z")

</div>

On Wednesday 28 May 2008 03:55:32 Eric H. wrote:

> > #! /usr/bin/ruby1.8  
> > $ head -1 `which gem1.9`  
> > #!/usr/bin/ruby1.9
> 
> head -1 `which rake`

Ah. Thanks:

$ head -1 `which rake`  
#!/usr/bin/ruby1.9

After installing rake via gem1.8, I still get the same on rake and  
rake1.9 –  
but they are not the same file:

$ diff /usr/bin/rake /usr/bin/rake1.9  
1a2,4

> #–
> 
> # Copyright © 2003, 2004, 2005, 2006, 2007 Jim W.

## 3c6,11 \< # This file was generated by RubyGems.

> # Permission is hereby granted, free of charge, to any person obtaining a

copy

> # of this software and associated documentation files (the “Software”), to
> 
> # deal in the Software without restriction, including without limitation the
> 
> # rights to use, copy, modify, merge, publish, distribute, sublicense,

and/or

> # sell copies of the Software, and to permit persons to whom the Software is
> 
> # furnished to do so, subject to the following conditions:

## 5,6c13,14 \< # The application ‘rake’ is installed as part of a gem, and \< # this file is here to facilitate running it.

> # The above copyright notice and this permission notice shall be included in
> 
> # all copies or substantial portions of the Software.

7a16,23

> # THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> 
> # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> 
> # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL

THE

> # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> 
> # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> 
> # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER

DEALINGS

> # IN THE SOFTWARE.
> 
> #++  
> 9,15c25,29  
> \< require ‘rubygems’  
> \<  
> \< version = “\>= 0”  
> \<  
> \< if ARGV.first =~ /^_(.\*)_$/ and Gem::Version.correct? $1 then  
> \< version = $1  
> \< ARGV.shift

* * *

> begin  
> require ‘rake’  
> rescue LoadError  
> require ‘rubygems’  
> require ‘rake’  
> 17,19c31  
> \<  
> \< gem ‘rake’, version  
> \< load ‘rake’

* * *

---

<div class="post-metadata">

**Author:** ![dgm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/df788c/32.png) [@dgm](https://www.ruby-forum.com/u/dgm)\
**Post date:** [May 28, 2008, 10:39pm UTC](https://www.ruby-forum.com/t/ruby-opengl-gem-uses-ruby1-9-even-from-gem1-8/138846/4 "2008-05-28T22:39:11Z")

</div>

On Wednesday 28 May 2008 14:17:31 Eric H. wrote:

> They should have a different shebang line. Re-run `gem install rake`  
> again to make plain `rake` be the 1.8 one.

I just did, and it has a 1.9 shebang. I’m pretty sure I tried this  
before.

> You may want to add “install: --format-executable” to your ~/.gemrc to  
> make gem add 1.8 or 1.9 to gem executable names so that they don’t  
> step on each others’ toes.

Ok, guessing that will be in root’s homedir if I install gems via sudo?

And would there still be a default ‘rake’ command? If so, which would it  
use?  
(Configurable?)

---

<div class="post-metadata">

**Author:** ![dgm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/df788c/32.png) [@dgm](https://www.ruby-forum.com/u/dgm)\
**Post date:** [May 28, 2008, 9:32pm UTC](https://www.ruby-forum.com/t/ruby-opengl-gem-uses-ruby1-9-even-from-gem1-8/138846/5 "2008-05-28T21:32:00Z")

</div>

On May 28, 2008, at 03:24 AM, David M. wrote:

> > > rake RUBYARCHDIR=/var/lib/gems/1.8/gems/ruby-opengl-0.60.0/lib  
> > > $ head -1 `which gem1.9`  
> > > rake1.9 –  
> > > but they are not the same file:
> 
> $ diff /usr/bin/rake /usr/bin/rake1.9  
> 1a2,4
> 
> > #–
> > 
> > # Copyright © 2003, 2004, 2005, 2006, 2007 Jim W.

They should have a different shebang line. Re-run `gem install rake`  
again to make plain `rake` be the 1.8 one.

You may want to add “install: --format-executable” to your ~/.gemrc to  
make gem add 1.8 or 1.9 to gem executable names so that they don’t  
step on each others’ toes.

---

<div class="post-metadata">

**Author:** ![dgm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/df788c/32.png) [@dgm](https://www.ruby-forum.com/u/dgm)\
**Post date:** [May 29, 2008, 4:12am UTC](https://www.ruby-forum.com/t/ruby-opengl-gem-uses-ruby1-9-even-from-gem1-8/138846/6 "2008-05-29T04:12:06Z")

</div>

On May 28, 2008, at 13:19 PM, David M. wrote:

> On Wednesday 28 May 2008 14:17:31 Eric H. wrote:
> 
> > They should have a different shebang line. Re-run `gem install rake`  
> > again to make plain `rake` be the 1.8 one.
> 
> I just did, and it has a 1.9 shebang. I’m pretty sure I tried this  
> before.

Then does `gem env` report 1.9 as the ruby version?

> > You may want to add “install: --format-executable” to your ~/.gemrc  
> > to  
> > make gem add 1.8 or 1.9 to gem executable names so that they don’t  
> > step on each others’ toes.
> 
> Ok, guessing that will be in root’s homedir if I install gems via  
> sudo?

In `sudo ruby -e 'p ENV["HOME"]'`, which is the my homedir for me.

> And would there still be a default ‘rake’ command? If so, which  
> would it use?  
> (Configurable?)

No, you would have to make a symlink to whichever you wanted to be the  
default.
