0

我正在关注 ruby​​onrails 教程,然后我坚持http://ruby.railstutorial.org/chapters/rails-flavored-ruby#code:home_page_base_title

当我输入“bundle exec rspec spec/requests/static_pages_spec.rb”时出现以下错误

没有 DRb 服务器正在运行。而是在本地进程中运行... FFFFFFFFF

失败:

1) 静态页面首页应该有 h1 'Sample App' Failure/Error: visit '/static_pages/home' ActionView::Template::Error: undefined local variable or method page' for #<#<Class:0x007fd991bb7610>:0x007fd9928d8290> # ./app/helpers/application_helper.rb:6:infull_title' # ./app/views/layouts/application .html.erb:4:in_app_views_layouts_application_html_erb__2444475768180965445_70286215048520' # ./spec/requests/static_pages_spec.rb:8:in块 (3 级) in '

在 .rspec 文件中

--color --drb

错误是否来自后卫,运动(在第 3 章的最后部分)?

4

2 回答 2

1

This probably wont help the OP anymore, but I had the same thing if the DRb server is not running it'll run in local process. For me the error was because I switched to postgresql (as per the end of chapter 3) and didn't start up the server. After I started the server, the test ran fine.

I hope that helps anyone who may end up here with the same problem.

于 2013-08-16T16:56:05.327 回答
0

警告表明 spork 没有运行或无法联系(rspec 使用 drb 与 spork 对话),因此 rspec 恢复正常运行。

不管你的规范是否在 spork 下运行,你的规范都应该通过,所以这不太可能是他们失败的原因,只是他们需要几秒钟才能失败的原因。

于 2012-06-25T07:39:12.910 回答