[MacRuby-devel] [MacRuby] Require RubyGems quesions
Laurent Sansonetti
lsansonetti at apple.com
Wed Aug 18 17:11:20 PDT 2010
Hi Alexander,
This may be a load path issue. Could you open a ticket on trac? We will investigate.
Laurent
On Aug 18, 2010, at 3:53 AM, Alexander v. Below wrote:
> Hello,
>
> 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)
>
> How can I remedy this, and make rubygems known to the script running in my app?
>
> Thanks
>
> Alex
>
>
> 1) The issue is reproducible with this scrip, suggested by a user on this list. Thanks again:
>
> 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
> _______________________________________________
> MacRuby-devel mailing list
> MacRuby-devel at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
More information about the MacRuby-devel
mailing list