Tag: webrick

服务器不会开始使用authlogic-oauth2

我已经在gemfile中包含了oauth2和authlogic-oauth2,因为我想使用它们并且我正在尝试启动服务器。 它没有启动并给我错误: /Library/Ruby/Gems/1.8/gems/railties-3.0.3/lib/rails.rb:44:in `configuration’: undefined method `config’ for nil:NilClass (NoMethodError) from /Library/Ruby/Gems/1.8/gems/authlogic_oauth2-1.1.2/lib/authlogic_oauth2.rb:14 from /Library/Ruby/Gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:64:in `require’ from /Library/Ruby/Gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:64:in `require’ from /Library/Ruby/Gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:62:in `each’ from /Library/Ruby/Gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:62:in `require’ from /Library/Ruby/Gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:51:in `each’ from /Library/Ruby/Gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:51:in `require’ from /Library/Ruby/Gems/1.8/gems/bundler-1.0.7/lib/bundler.rb:112:in `require’ from /Users/arkidmitra/Documents/qorm_bzar/buyzaar/config/application.rb:7 from /Library/Ruby/Gems/1.8/gems/railties-3.0.3/lib/rails/commands.rb:28:in `require’ from /Library/Ruby/Gems/1.8/gems/railties-3.0.3/lib/rails/commands.rb:28 from /Library/Ruby/Gems/1.8/gems/railties-3.0.3/lib/rails/commands.rb:27:in `tap’ from /Library/Ruby/Gems/1.8/gems/railties-3.0.3/lib/rails/commands.rb:27 from script/rails:6:in `require’ from script/rails:6 我使用的是Rails 3.0.3和Ruby 1.8.7。 在我添加之前,服务器似乎也很好 gem […]

Webrick透明代理

我有一个绝对简单的代理运行。 require ‘webrick’ require ‘webrick/httpproxy’ s = WEBrick::HTTPProxyServer.new(:Port => 8080, :RequestCallback => Proc.new{|req,res| puts req.request_line, req.raw_header}) # Shutdown functionality trap(“INT”){s.shutdown} # run the beast s.start 在我看来,这应该不会以任何方式影响沟通。 但是有些网站不再有用了。 特别是http://lastfm.de的嵌入式闪存播放器不起作用。 标题看起来链接: – -> http://ext.last.fm/2.0/?api%5Fsig=aa3e9ac9edf46ceb9a673cb76e61fef4&flashresponse=true&y=1269686332&streaming=true&playlistURL=lastfm%3A%2F%2Fplaylist%2Ftrack%2F42620245&fod=true&sk=ee93ae4f438767bf0183d26478610732&lang=de&api%5Fkey=da6ae1e99462ee22e81ac91ed39b43a4&method=playlist%2Efetch GET http://play.last.fm/preview/118270350.mp3 HTTP/1.1 Host: play.last.fm User-Agent: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.2) Gecko/20100308 Ubuntu/10.04 (lucid) Firefox/3.6 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: de,en-us;q=0.7,en;q=0.3 Accept-Encoding: gzip,deflate […]

如何为独立的Sinatra应用启用SSL?

我想在Sinatra写一个快速的服务器应用程序。 它必须是自包含的(即不使用apache / nginx / passenger),但也必须支持SSL。 有没有简单的方法为Sinatra启用SSL支持(例如使用WEBRick)?

如何在ruby中控制(启动/终止)后台进程(服务器应用程序)

我正在尝试通过ruby为集成测试(实际规格)设置一个服务器,但无法弄清楚如何控制该过程。 所以,我想要做的是: 为我的gem执行rake任务,执行集成规范 任务需要首先启动服务器(我使用webrick),然后运行规范 在执行规范后它应该杀死webrick所以我没有留下一些未使用的后台进程 webrick不是必需的,但它包含在ruby标准库中,因此能够使用它会很棒。 希望有人能够提供帮助! PS。 我正在linux上运行,因此将这项工作用于Windows并不是我的主要优先事项(现在)。

在后台运行Webrick服务器?

MBPro:shovell myname$ ruby script/server => Booting WEBrick => Rails 2.3.8 application starting on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server [2010-08-01 15:28:35] INFO WEBrick 1.3.1 [2010-08-01 15:28:35] INFO ruby 1.9.1 (2010-07-02) [i386-darwin10.4.0] [2010-08-01 15:28:35] INFO WEBrick::HTTPServer#start: pid=36349 port=3000 在这个命令之后,我必须保持终端打开,甚至不能使用Cmd + z。 我不能把它作为后台服务运行吗? 谢谢

Ruby Webrick HTTP身份validation

如何使用如下子类在此页面中执行相同的身份validation: class Configuration 666) server.mount “/conf”, Configuration trap “INT” do server.shutdown end server.start

配置WEBrick以使用自动生成的自签名SSL / HTTPS证书

我想用SSL / HTTPS在本地开发我的Ruby on Rails应用程序,但是我在设置服务器以使用SSL时遇到了麻烦。 以下是我到目前为止已经尝试过的事情: rails server [options] rails server命令没有附带ssl选项( rails server –help ): Usage: rails server [mongrel, thin, etc] [options] -p, –port=port Runs Rails on the specified port. Default: 3000 -b, –binding=ip Binds Rails to the specified ip. Default: 0.0.0.0 -c, –config=file Use custom rackup configuration file -d, –daemon Make server run as […]

Ruby Sinatra Webservice在localhost上运行:4567但不在IP上运行

我在Windows 7 32位操作系统上有一个ruby(使用sinatra)webservice。 它在端口4567上运行。当我使用localhost时工作正常:4567但是当我用我的机器的本地ip替换localhost时, 192.168.103.99 :4567它不起作用,并且无法连接。 我已经禁用了防火墙,旁路代理并将端口4567添加到exception,仍然没有运气。 可能是什么问题?

无法打开rails服务器

我不知道我做了什么。 我想我更新了我的Ruby on Rails。 更新后,运行$ rails服务器时总是出错。 输出是 ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/utils.rb:73:in `initialize’: Address already in use – bind(2) (Errno::EADDRINUSE) 我会重新启动控制台并运行rails服务器,它会工作几分钟,但它会停止响应,如果我重新启动rails服务器,它会再次给我错误。 我尝试在不同的端口(rails s -p 9191)上运行,它给了我同样的问题。 什么想法我做错了什么? Thnx家伙