[MacRuby] #474: Sinatra's get method not being registered
#474: Sinatra's get method not being registered ------------------------+--------------------------------------------------- Reporter: cad@… | Owner: lsansonetti@… Type: defect | Status: new Priority: trivial | Milestone: Component: MacRuby | Keywords: ------------------------+--------------------------------------------------- When I run {{{ #!/usr/bin/env ruby require 'rubygems' require 'sinatra' get '/' do "I'm running version " + Sinatra::VERSION end }}} after running {{{ # macgem install sinatra }}} I get {{{ [colin@marle Source]$ macruby sinatra.rb core:in `require:': undefined method `get' for main:TopLevel (NoMethodError) from sinatra.rb:3:in `<main>' }}} When I try it in the OSX bundled Ruby, I get something similar but more verbose: {{{ [colin@marle Source]$ ruby sinatra.rb ./sinatra.rb:4: undefined method `get' for main:Object (NoMethodError) from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require' from sinatra.rb:3 }}} This is of course after running {{{ #gem install sinatra }}} It's likely that this is a bug in Sinatra, not MacRuby. For reference: {{{ [colin@marle Source]$ macruby -v MacRuby version 0.5 (ruby 1.9.0) [universal-darwin10.0, x86_64] }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/474> MacRuby <http://macruby.org/>
#474: Sinatra's get method not being registered ------------------------+--------------------------------------------------- Reporter: cad@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: trivial | Milestone: Component: MacRuby | Resolution: invalid Keywords: | ------------------------+--------------------------------------------------- Changes (by lsansonetti@…): * status: new => closed * resolution: => invalid Comment: I believe you need to tell the program about the webserver. Sinatra probably has a default one that MacRuby can't run, for a reason. # We recently created a simple webserver in MacRuby that runs Sinatra apps, and it will be released soon. I am closing the bug since 1.9 behaves the same. If you believe there is something wrong in MacRuby please let us know. -- Ticket URL: <http://www.macruby.org/trac/ticket/474#comment:1> MacRuby <http://macruby.org/>
#474: Sinatra's get method not being registered ------------------------+--------------------------------------------------- Reporter: cad@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: trivial | Milestone: Component: MacRuby | Resolution: invalid Keywords: | ------------------------+--------------------------------------------------- Comment(by russm-trac-macports-org@…): FYI: this is not a sinatra bug, but a problem with calling your test case {{{sinatra.rb}}} the load path by default includes {{{.}}} (the current directory) before the gem directory, so when you "{{{require 'sinatra'}}}" ruby (either MRI or MacRuby) just re-loads your test file and the actual sinatra framework in never loaded. try changing the name of your test case. -- Ticket URL: <http://www.macruby.org/trac/ticket/474#comment:2> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby