Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用瘦服务器而不是默认的Webrick来运行selenium?_Selenium_Cucumber_Ruby On Rails 3_Thin - Fatal编程技术网

如何使用瘦服务器而不是默认的Webrick来运行selenium?

如何使用瘦服务器而不是默认的Webrick来运行selenium?,selenium,cucumber,ruby-on-rails-3,thin,Selenium,Cucumber,Ruby On Rails 3,Thin,selenium的MyCucumber功能使用默认的Webrick服务器运行(适用于Rails 3应用程序) 如何强制或设置使用精简服务器而不是Webrick运行? 要放入env.rb文件或其他文件中的任何设置?两种方式: 1) 关闭水豚的内置服务器,自己运行 2) 看起来有人在这里修补了功能这是最近水豚的新方法 require "rack/handler/unicorn" Capybara.register_server(:unicorn) do |app, port, host| Rac

selenium的MyCucumber功能使用默认的Webrick服务器运行(适用于Rails 3应用程序)

如何强制或设置使用精简服务器而不是Webrick运行? 要放入env.rb文件或其他文件中的任何设置?

两种方式:

1) 关闭水豚的内置服务器,自己运行


2) 看起来有人在这里修补了功能

这是最近水豚的新方法

require "rack/handler/unicorn"
Capybara.register_server(:unicorn) do |app, port, host|
  Rack::Handler::Unicorn.run(app, :Port => port)
end
Capybara.server = :unicorn

仅仅在Gemfile中包含瘦服务器gem
gem“thin”
,也可以。效果不错。在按上述方式注册之后,我还必须设置服务器
Capybara.server=:unicorn
。我还必须将
rack handlers
添加到我的Gemfile中,并在回答中的代码之前执行
要求“rack/handler/unicorn”
,否则我将得到“uninitialized constant rack::handler::unicorn(namererror)”。我在机架2.0.5上。