我使用的宝石捆(v.0.9.6)和轨2.3.5,把1.3.6和红宝石1.8.7(雪豹).我Gemfile看起来是这样的:

source :rubyforge
source "http://gems.github.com"

gem "rails", "2.3.5"
gem "ruby-debug"
gem "activemerchant", :require => 'active_merchant'
gem "hpricot"
gem "nokogiri"
gem "state_machine"
gem "fastercsv"
gem "yubikey"
gem "httparty"
gem "ruby-openid"
gem "mongrel" 

group :development do 
  gem 'mongrel'
end

#teste
group :test do
  gem 'rspec'  
  gem 'rspec-rails'
  gem 'cucumber' 
  gem 'cucumber-rails'
  gem "mechanize"
  gem 'notahat-machinist', :require => 'machinist'
  gem 'faker'
  gem 'webrat'
  gem 'selenium-client'
  gem 'database_cleaner'
  gem 'fakeweb'
  gem 'mongrel' #Selenium needs this
end

到目前为止一切顺利。我一直在使用成功地进行了几个星期了。但是,我开始使用黄瓜和WebRat在硒模式来测试一些ajaxy网站的功能,而每当我运行的功能,WebRat告诉我轨道服务器开始,但我总是有一个XHR_ERROR,其中硒不能找到网址。 好了,这事发生服务器是不是开始。

然后,我打开webrat/lib/webrat/硒/application_servers/轨道。rb文件和把一个调试器的声明在开始方法。跑的特征再次,在调试器触发,我打印返回的start_command def,这是:

mongrel_rails start -d --chdir='/Users/fullofcaffeine/Projetos/myproject' --port=3001 --environment=test --pid /Users/fullofcaffeine/Projetos/myproject/tmp/pids/mongrel_selenium.pid 

我抄和粘贴在控制台,删除的-d和&结束时,从这里的输出我得到了:

** Rails loaded.
** Loading any Rails specific GemPlugins
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require': no such file to load -- /Users/fullofcaffeine/.bundle/ruby/1.8/gems/mongrel-1.1.5/lib/mongrel/init.rb (MissingSourceFile)
 from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
 from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in'
 from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
 from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/gem_plugin-0.2.3/lib/gem_plugin.rb:134:in `load'
 from /Library/Ruby/Site/1.8/rubygems/source_index.rb:241:in `each'
 from /Library/Ruby/Site/1.8/rubygems/source_index.rb:241:in `each'
 from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/gem_plugin-0.2.3/lib/gem_plugin.rb:112:in `load'
 from /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:231:in `load_plugins'
 from /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:117:in `cloaker_'
 from /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:149:in `call'
 from /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:149:in `listener'
 from /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:99:in `cloaker_'
 from /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:50:in `call'
 from /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:50:in `initialize'
 from /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:84:in `new'
 from /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:84:in `run'
 from /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/command.rb:212:in `run'
 from /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281
 from /usr/bin/mongrel_rails:19:in `load'
 from /usr/bin/mongrel_rails:19

检查路径,它是试图负荷杂种自:"~/.捆绑/...",但是杂种是安装一个系统的宝石。束手柄装载系统的宝石现在其他方面,但是在这种特定情况下,我不知道为什么它就是失败:(.

我已经试过运行"包装"再次,它总是说:

安装的杂种(1.1.5)从系统 如果坐

我试着卸载杂种从系统 尽量让包来安装在~/.捆绑 (作为这似乎是错误的来源,因为杂种是被搜查,在这条道路,我开始mongrel_rails如上所述), 但我就是不能这样做。

gem uninstall mongrel
ERROR:  While executing gem ... (Gem::InstallError)
    cannot uninstall, check `gem list -d mongrel`

当我运行"宝清单|杂种查询",我获得:

mongrel (1.1.5)

奇怪的。

我只是希望能够运行黄瓜和WebRat+硒成功的同时,使用宝石用,但这是让我发疯了.

任何人都可以启发我吗?

有帮助吗?

解决方案

好吧,我发现了一个解决办法,有种腥,但作品:

 cp  /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/ mongrel-1.1.5

现在,如果你尝试:

mongrel_rails start --chdir='/Users/fullofcaffeine/Projetos/myproject' --port=3001 --environment=test --pid /Users/fullofcaffeine/Projetos/myproject/tmp/pids/mongrel_selenium.pid

它会找到杂种并启动服务器,那么你就可以运行使用硒黄瓜功能,它会工作:)

如果别人发现或知道任何关于这个问题,请份额,这可能最终会被错误的地方。

其他提示

我也有类似的问题,但它竟然是不匹配之间的宝石的版本是什么,我/Users/{account}/.gems/和安装在/库/红宝石/珠宝/(默认安装什么),或在/ opt / local / lib目录/红宝石/宝石/(在Mac端口安装)。当我删除了/Users/{account}/.gems/它的所有工作。

我遇到这个同样的问题,并度过了一段时间试图调试。它的出现有某种之间的相互作用的杂种狗,GemPlugin和捆.可能的解决方案包括:

  1. 修复GemPlugin以很好地发挥与捆0.9.
  2. 修改杂种不再使用GemPlugin.
  3. 修改Webrat支持一个网络服务器比其他的杂种。

由于这两个GemPlugin和杂种是看起来有些过时和废弃的这些日子,我决定增加薄支持Webrat的基础上 这个补丁.

你可以 找到新补上。, 或添加以下你Gemfile:

gem 'webrat', :git => 'git://github.com/emk/webrat.git'

...和更新的功能/支持/env.rb文件,因此:

Webrat.configure do |config|
  # Add this line.
  config.application_framework = :rails_thin

  # Your previous configuration here...
end

bundle exec mongrel_rails start ... ?

这里的要点是要载荷轨道是从捆绑,以及不能从系统gemenv.

我们有一个类似的情况,它是写在这里:如何获得的杂种工作的有用?

尝试找到其中电流宝石可执行使用宝石目录和从高速缓存或规格目录删除任何残留物,即应该工作。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top