[MacRuby] #859: rubygems load error when running script using evaluateFileAtPath:

MacRuby ruby-noreply at macosforge.org
Thu Aug 19 05:58:19 PDT 2010


#859: rubygems load error when running script using evaluateFileAtPath:
---------------------------+------------------------------------------------
 Reporter:  below@…        |       Owner:  lsansonetti@…        
     Type:  defect         |      Status:  new                  
 Priority:  blocker        |   Milestone:                       
Component:  MacRuby        |    Keywords:                       
---------------------------+------------------------------------------------
 I have a MacRuby script which, among other things, requires rubygems.

 It works very nice when I call it in the terminal (i.e. "macruby
 test.rb"), but when I try to execute it in a Cocoa App using [[MacRuby
 sharedRuntime] evaluateFileAtPath:path];, I get a LoadError exception:
 /Users/below/dev/build/Debug/(eval):1:in `<main>': no such file to load --
 rubygems (LoadError)

 The issue is reproducible with this script, ControlTower must be present
 for this particular sample to work

 require 'rubygems'
 require 'control_tower'
 require 'rack/utils'

 server_options = { :port => 3001, :host => '0.0.0.0', :concurrent => false
 }

 app = Rack::Builder.new do
 map "/" do run Rack::File.new("/Users/below/Sites/") end
 end.to_app

 @s = ControlTower::Server.new(app, server_options)
 if @s
 puts 'Starting control tower webserver'
 @s.start
 else
 puts "ERROR: Couldnt build server"
 end

-- 
Ticket URL: <http://www.macruby.org/trac/ticket/859>
MacRuby <http://macruby.org/>



More information about the macruby-tickets mailing list