When I was playing with this stuff I just added the extra arg of the server I wanted started:
jruby script/server webrick -Tom On Tue, 13 Jun 2006, Charles O Nutter defenestrated me: > > With the fastcgi nonsense commented out, the fcntl patch, and the > Socket/BasicSocket thing fixed, script/server starts up and > successfully serves the index page!!! > And then it stops doing anything. > But it's close! > => Booting WEBrick... > => Rails application started on [1]http://0.0.0.0:3000 > => Ctrl-C to shutdown server; call with --help for options > [2006-06-13 19:28:24] INFO WEBrick 1.3.1 > [2006-06-13 19:28:24] INFO ruby 1.8.4 (0) [java] > [2006-06-13 19:28:24] INFO WEBrick::HTTPServer#start: pid=3195425 > port=3000 > [2]127.0.0.1 - - [13/Jun/2006:19:31:03 CDT] "GET /favicon.ico > HTTP/1.1" 304 0 > - -> /favicon.ico > [3]127.0.0.1 - - [13/Jun/2006:19:31:05 CDT] "GET / HTTP/1.1" 304 0 > - -> / > [4]127.0.0.1 - - [13/Jun/2006:19:31:05 CDT] "GET > /javascripts/prototype.js HTTP/1.1" 304 0 > [5]http://localhost:3000/ -> /javascripts/prototype.js > [6]127.0.0.1 - - [13/Jun/2006:19:31:05 CDT] "GET > /javascripts/effects.js HTTP/1.1" 304 0 > [7]http://localhost:3000/ -> /javascripts/effects.js > [8]127.0.0.1 - - [13/Jun/2006:19:31:05 CDT] "GET /images/rails.png > HTTP/1.1" 304 0 > [9]http://localhost:3000/ -> /images/rails.png > > On 6/13/06, Charles O Nutter <[10] [EMAIL PROTECTED]> wrote: > > Fixed. SocketMetaClass needed the following: > - extend BasicSocketMetaClass > - pass the BasicSocket rubyclass as parent > SocketLibrary needed to reorder creation of BasicSocketMetaClass and > SocketMetaClass so Socket could extend BasicSocket. The extension in > the .rb file doesn't work unless the classes and metaclasses already > created do that extension as well. > [EMAIL PROTECTED]:~$ jirb > irb(main):001:0> require 'socket' > => true > irb(main):002:0> Socket.do_not_reverse_lookup > => false > irb(main):003:0> > And an example of why it didn't work: > irb(main):003:0> class String < File > irb(main):004:1> end > => nil > irb(main):005:0> String.dirname > NoMethodError: undefined method `dirname' for String:Class > ... > Ruby throws an error for this that we don't: > irb(main):001:0> class String < File > irb(main):002:1> end > TypeError: superclass mismatch for class String > from (irb):1 > I didn't fix the static var though. Two bugs then remain with socket > stuff out of all this: > - Don't use static var for BasicSocket.do_not_reverse_lookup (easy > fix) > - Re-opened classes that attempt to extend something new should throw > TypeError (more involved) > > On 6/13/06, Charles O Nutter <[EMAIL PROTECTED]> wrote: > > Perhaps this has something to do with it: > irb(main):014:0> Socket.superclass > => Object > Now we just need to figure out why that's happening :) > > On 6/13/06, Charles O Nutter <[EMAIL PROTECTED]> wrote: > > The Socket/BasicSocket dichotomy is certainly an interesting issue. It > doesn't seem to be a simple issue of singleton methods, since File's > singleton methods work fine in extending classes: > class F < File > end > F.dirname => wrong number of arguments (i.e. it's finding it ok) > So there's something odd about Socket/BasicSocket specifically. > Also, I noticed now that do_not_reverse_lookup is implemented as a > static var in RubyBasicSocket. That needs to be fixed. > > On 6/13/06, Ola Bini <[13] [EMAIL PROTECTED]> wrote: > > Well, so I've found the first thing that's a problem with > script/server, > at least on my win32-box. The server script first tries to > determine > which server to use. It does this by all different manners of fun > tricks. This one: > if RUBY_PLATFORM !~ /mswin/ && !silence_stderr { `lighttpd > -version` > }.blank? && defined?(FCGI) > is especially fun; just look at that silence_stderr ... so what > does it do? > well, silence_stderr is part of active support, it more or less > calls on > silence_stream, that looks like this: > def silence_stream(stream) > old_stream = stream.dup > stream.reopen(RUBY_PLATFORM =~ /mswin/ ? 'NUL:' : '/dev/null') > stream.sync = true > yield > ensure > stream.reopen(old_stream) > end > and, since I'm on win, this will try to open /dev/null. Now, > commenting > out this, to get to the next step, we find this fine error: > D:/project/jruby/lib/ruby/gems/1.8/gems/rails- > 1.1.2/lib/webrick_server.rb:53:in > `method_missing': undefined method `do_not_reverse_lookup=' > for Socket:Class (NoMethodError) > from > D:/project/jruby/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/webrick_ser > ver.rb:53:in > `dispatch' > And well, this is where it seems we have a real problem. I'm not > entirely sure about this, it's only a hypothesis. But that method > is > defined, in BasicSocketMetaClass as a singleton method. and the > Socket > class is defined in socket.rb to inherit BasicSocket. but look at > this > jirb session: > irb(main):002:0> require 'socket' > => true > irb(main):003:0> Socket.do_not_reverse_lookup > NoMethodError: undefined method `do_not_reverse_lookup' for > Socket:Class > from (irb):1:in `method_missing' > from (irb):1 > from D:/project/jruby/lib/ruby/site_ruby/1.8/irb.rb:150:in > `eval_input' > from D:/project/jruby/lib/ruby/site_ruby/1.8/irb.rb:70:in > `signal_status' > from D:/project/jruby/lib/ruby/site_ruby/1.8/irb.rb:189:in > `eval_input' > from D:/project/jruby/lib/ruby/site_ruby/1.8/irb.rb:70:in > `each_top_level_statement' > from D:/project/jruby/lib/ruby/site_ruby/1.8/irb.rb:190:in > `loop' > from D:/project/jruby/lib/ruby/site_ruby/1.8/irb.rb:190:in > `catch' > from D:/project/jruby/lib/ruby/site_ruby/1.8/irb.rb:190:in > `eval_input' > from D:/project/jruby/lib/ruby/site_ruby/1.8/irb.rb:70:in > `start' > from D:\project\jruby\bin\jirb:13:in `catch' > from D:/project/jruby/lib/ruby/site_ruby/1.8/irb.rb:71:in > `start' > from D:\project\jruby\bin\jirb:13 > irb(main):004:0> BasicSocket.do_not_reverse_lookup > => false > irb(main):005:0> BasicSocket.do_not_reverse_lookup=true > => true > irb(main):006:0> Socket.do_not_reverse_lookup=true > NoMethodError: undefined method `do_not_reverse_lookup=' for > Socket:Class > from (irb):1:in `method_missing' > from (irb):1 > from D:/project/jruby/lib/ruby/site_ruby/1.8/irb.rb:150:in > `eval_input' > from D:/project/jruby/lib/ruby/site_ruby/1.8/irb.rb:70:in > `signal_status' > from D:/project/jruby/lib/ruby/site_ruby/1.8/irb.rb:189:in > `eval_input' > from D:/project/jruby/lib/ruby/site_ruby/1.8/irb.rb:70:in > `each_top_level_statement' > from D:/project/jruby/lib/ruby/site_ruby/1.8/irb.rb:190:in > `loop' > from D:/project/jruby/lib/ruby/site_ruby/1.8/irb.rb:190:in > `catch' > from D:/project/jruby/lib/ruby/site_ruby/1.8/irb.rb:190:in > `eval_input' > from D:/project/jruby/lib/ruby/site_ruby/1.8/irb.rb:70:in > `start' > from D:\project\jruby\bin\jirb:13:in `catch' > from D:/project/jruby/lib/ruby/site_ruby/1.8/irb.rb:71:in > `start' > from D:\project\jruby\bin\jirb:13 > irb(main):007:0> > It seems that the singleton methods from BasicSocket aren't > inherited by > the Socket class. I guess this is because of some major strange > thing > between defining a Java MetaClass and subclassing it from Ruby. > Anyway, anyone know where to continue? > Regards > Ola Bini > ps ... oh yeah, for anyone who wants to go drooling... by changing > from > Socket to BasicSocket in the line above I got this little output... > D:\Project\testjrails\test1>jruby script\server > D:/project/jruby/lib/ruby/gems/1.8/gems/activerecord- > 1.14.2/lib/active_record/connection_adapters/oracle_adapter.rb:118 > warning: (...) interpreted as grouped expression > => Booting WEBrick... > => Rails application started on [14]http://0.0.0.0:3000 > => Ctrl-C to shutdown server; call with --help for options > [2006-06-13 22:22:35] INFO WEBrick 1.3.1 > [2006-06-13 22:22:35] INFO ruby 1.8.4 (0) [java] > [2006-06-13 22:22:35] INFO WEBrick::HTTPServer#start: pid=7214088 > port=3000 > [15]127.0.0.1 - - [13/Jun/2006:22:26:35 CEST] "GET / HTTP/1.1" 200 > 7 > - -> / > [16]127.0.0.1 - - [13/Jun/2006:22:26:35 CEST] "GET /favicon.ico > HTTP/1.1" 200 0 > - -> /favicon.ico > it doesn't really serve anything, though, for some reason, but > Charlie > have said he'll continue from here... =) > Nighti > /O > _______________________________________________ > Jruby-devel mailing list > [EMAIL PROTECTED] > [18]https://lists.sourceforge.net/lists/listinfo/jruby-devel > > -- > Charles Oliver Nutter @ [19]headius.blogspot.com > JRuby Developer @ [20]jruby.sourceforge.net > Application Architect @ [21]www.ventera.com > > -- > Charles Oliver Nutter @ [22]headius.blogspot.com > JRuby Developer @ [23]jruby.sourceforge.net > Application Architect @ [24]www.ventera.com > > -- > Charles Oliver Nutter @ [25]headius.blogspot.com > JRuby Developer @ [26]jruby.sourceforge.net > Application Architect @ [27]www.ventera.com > > -- > Charles Oliver Nutter @ [28]headius.blogspot.com > JRuby Developer @ [29]jruby.sourceforge.net > Application Architect @ [30]www.ventera.com > > References > > 1. http://0.0.0.0:3000/ > 2. http://127.0.0.1/ > 3. http://127.0.0.1/ > 4. http://127.0.0.1/ > 5. http://localhost:3000/ > 6. http://127.0.0.1/ > 7. http://localhost:3000/ > 8. http://127.0.0.1/ > 9. http://localhost:3000/ > 10. mailto:[EMAIL PROTECTED] > 11. mailto:[EMAIL PROTECTED] > 12. mailto:[EMAIL PROTECTED] > 13. mailto:[EMAIL PROTECTED] > 14. http://0.0.0.0:3000/ > 15. http://127.0.0.1/ > 16. http://127.0.0.1/ > 17. mailto:Jruby-devel@lists.sourceforge.net > 18. https://lists.sourceforge.net/lists/listinfo/jruby-devel > 19. http://headius.blogspot.com/ > 20. http://jruby.sourceforge.net/ > 21. http://www.ventera.com/ > 22. http://headius.blogspot.com/ > 23. http://jruby.sourceforge.net/ > 24. http://www.ventera.com/ > 25. http://headius.blogspot.com/ > 26. http://jruby.sourceforge.net/ > 27. http://www.ventera.com/ > 28. http://headius.blogspot.com/ > 29. http://jruby.sourceforge.net/ > 30. http://www.ventera.com/ > _______________________________________________ > Jruby-devel mailing list > Jruby-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/jruby-devel -- + http://www.tc.umn.edu/~enebo +---- mailto:[EMAIL PROTECTED] ----+ | Thomas E Enebo, Protagonist | "Luck favors the prepared | | | mind." -Louis Pasteur | _______________________________________________ Jruby-devel mailing list Jruby-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jruby-devel