U
Une Bévue
I'm working (on Mac OS X) with two installed ruby (apart from Apple
default one):
$ which ruby
/opt/local/bin/ruby
$ which ruby19
/opt/local/bin/ruby19
(all of the Ruby-1.9.0-0 bins have a "19" suffix)
when i try a simple script as :
----------------------------------------------------------------------
#! /usr/bin/env ruby19
require "appscript"
include Appscript
p app('Finder').home.folders.get
----------------------------------------------------------------------
i get the following :
----------------------------------------------------------------------
RubyMate r6354 running Ruby r1.9.0 (/opt/local/bin/ruby19)
/opt/local/lib/ruby/site_ruby/1.8/_aem/aemreference.rb:15:in `new' : Not
a four-char-code string. ( ArgumentError )
from /opt/local/lib/ruby/site_ruby/1.8/_aem/aemreference.rb:15:in
`pack_enum'
from /opt/local/lib/ruby/site_ruby/1.8/_aem/aemreference.rb:204:in
`<classositionSpecifier>'
from /opt/local/lib/ruby/site_ruby/1.8/_aem/aemreference.rb:193:in
`<module:AEMReference>'
from /opt/local/lib/ruby/site_ruby/1.8/_aem/aemreference.rb:44:in
`<top (required)>'
from /opt/local/lib/ruby/site_ruby/1.8/_aem/codecs.rb:8:in `require'
from /opt/local/lib/ruby/site_ruby/1.8/_aem/codecs.rb:8:in `<top
(required)>'
from /opt/local/lib/ruby/site_ruby/1.8/aem.rb:14:in `require'
from /opt/local/lib/ruby/site_ruby/1.8/aem.rb:14:in `<module:AEM>'
from /opt/local/lib/ruby/site_ruby/1.8/aem.rb:10:in `<top
(required)>'
from /opt/local/lib/ruby/site_ruby/1.8/appscript.rb:13:in `require'
from /opt/local/lib/ruby/site_ruby/1.8/appscript.rb:13:in
`<module:Appscript>'
from /opt/local/lib/ruby/site_ruby/1.8/appscript.rb:7:in `<top
(required)>'
from /Users/yt/work/Ruby19/rb-appscript/Finder/desktop.rb:4:in
`require'
from /Users/yt/work/Ruby19/rb-appscript/Finder/desktop.rb:4:in
`<main>'
----------------------------------------------------------------------
then, ruby19 is looking into "/opt/local/lib/ruby/site_ruby/1.8"
i think this is due to my environment variables for Rubygems :
$ echo $RUBYOPT
rubygems
$ echo $GEM_HOME
/opt/local/lib/ruby/gems/1.8
$ echo $RUBYLIB
/opt/local/lib/ruby/:/opt/local/lib/ruby/site_ruby/1.8
$ echo $RUBYGEMS
/opt/local/lib/ruby/site_ruby/1.8
is there a way to setup those environment variables to get ruby and
ruby19 working with gems without switching an environment variable ?
default one):
$ which ruby
/opt/local/bin/ruby
$ which ruby19
/opt/local/bin/ruby19
(all of the Ruby-1.9.0-0 bins have a "19" suffix)
when i try a simple script as :
----------------------------------------------------------------------
#! /usr/bin/env ruby19
require "appscript"
include Appscript
p app('Finder').home.folders.get
----------------------------------------------------------------------
i get the following :
----------------------------------------------------------------------
RubyMate r6354 running Ruby r1.9.0 (/opt/local/bin/ruby19)
/opt/local/lib/ruby/site_ruby/1.8/_aem/aemreference.rb:15:in `new' : Not
a four-char-code string. ( ArgumentError )
from /opt/local/lib/ruby/site_ruby/1.8/_aem/aemreference.rb:15:in
`pack_enum'
from /opt/local/lib/ruby/site_ruby/1.8/_aem/aemreference.rb:204:in
`<classositionSpecifier>'
from /opt/local/lib/ruby/site_ruby/1.8/_aem/aemreference.rb:193:in
`<module:AEMReference>'
from /opt/local/lib/ruby/site_ruby/1.8/_aem/aemreference.rb:44:in
`<top (required)>'
from /opt/local/lib/ruby/site_ruby/1.8/_aem/codecs.rb:8:in `require'
from /opt/local/lib/ruby/site_ruby/1.8/_aem/codecs.rb:8:in `<top
(required)>'
from /opt/local/lib/ruby/site_ruby/1.8/aem.rb:14:in `require'
from /opt/local/lib/ruby/site_ruby/1.8/aem.rb:14:in `<module:AEM>'
from /opt/local/lib/ruby/site_ruby/1.8/aem.rb:10:in `<top
(required)>'
from /opt/local/lib/ruby/site_ruby/1.8/appscript.rb:13:in `require'
from /opt/local/lib/ruby/site_ruby/1.8/appscript.rb:13:in
`<module:Appscript>'
from /opt/local/lib/ruby/site_ruby/1.8/appscript.rb:7:in `<top
(required)>'
from /Users/yt/work/Ruby19/rb-appscript/Finder/desktop.rb:4:in
`require'
from /Users/yt/work/Ruby19/rb-appscript/Finder/desktop.rb:4:in
`<main>'
----------------------------------------------------------------------
then, ruby19 is looking into "/opt/local/lib/ruby/site_ruby/1.8"
i think this is due to my environment variables for Rubygems :
$ echo $RUBYOPT
rubygems
$ echo $GEM_HOME
/opt/local/lib/ruby/gems/1.8
$ echo $RUBYLIB
/opt/local/lib/ruby/:/opt/local/lib/ruby/site_ruby/1.8
$ echo $RUBYGEMS
/opt/local/lib/ruby/site_ruby/1.8
is there a way to setup those environment variables to get ruby and
ruby19 working with gems without switching an environment variable ?