Hi,
I'm trying to make RubyAMP (not hosted at macromates.com) work. I installed rb-appscript using "sudo gem install rb-appscript", but when I try to run with TextMate and require it in a script, it shows me an error "LoadError: no such file to load ― appscript".
In irb, I could get "true" to require 'appscript'
irb(main):003:0> require 'rubygems' => true irb(main):004:0> require 'appscript' => true
My ruby script is as simple as:
p require('rubygems')
p require('appscript')
and if I run Command-R, it fails to load appscript.
The script
require 'rubygems' puts Gem.path
returns
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ gems/1.8 /Library/Ruby/Gems/1.8
My ruby version is: ruby 1.8.6 (2007-09-24 patchlevel 111) [i686- darwin9.2.0] gem version is 1.1.1 The gem is installed at `/usr/local/lib/ruby/gems/1.8/gems/rb- appscript-0.5.1`. I'm running Mac OS X 10.5.2 on an Intel-based MacBook.
Looks like I need to add a gem path to TextMate(?)
Any help would be appreciated.
Takaaki
On 21 Apr 2008, at 02:46, Takaaki Kato wrote:
[...] Looks like I need to add a gem path to TextMate(?)
More likely you have a custom installed ruby, and you need to have that used by TM.
See http://macromates.com/wiki/Troubleshooting/RubyVersionIssue for more.
My ruby version is: ruby 1.8.6 (2007-09-24 patchlevel 111) [i686- darwin9.2.0] ... The gem is installed at `/usr/local/lib/ruby/gems/1.8/gems/rb- appscript-0.5.1`
As Allan pointed out, you do appear to have a custom Ruby (the stock platform string is [universal-darwin9.0], not [i686-darwin9.2.0]). Same compile date and patchlevel, so it's easy to mistake.
Just a shot in the dark, but perhaps you followed Dan Benjamin's (hivelogic) guide? That would certainly explain the /usr/local/lib path.
I just tested installing rb-appscript with stock ruby and gems; `gem which appscript` yields:
/Library/Ruby/Gems/1.8/gems/rb-appscript-0.5.1/lib/appscript.rb
Alternately, is it possible you have a leftover $GEM_HOME environment variable from a previous custom installation of ruby and/or gems?
HTH, Daniel
On Apr 21, 2008, at 2:04 PM, Daniel Stockman wrote:
Just a shot in the dark, but perhaps you followed Dan Benjamin's (hivelogic) guide? That would certainly explain the /usr/local/lib path.
Yes. I followed Hivelogic instruction.
Alternately, is it possible you have a leftover $GEM_HOME environment variable from a previous custom installation of ruby and/ or gems?
Hmm. I check my .bash_login, but I found any relevant info there.
Takaaki
Solved.
I added TM_Ruby as /usr/local/bin/ruby in "Shell Variables" in the TextMate preferences.
I also added "GEM_PATH" manually in the "Shell Variables".
As others noted, I messed up default ruby installation and Hivelogic's version.
Thanks for your help.