0
我使用的Ruby on由邁克爾·哈特爾Rails的教程 - 第8章 - Rails 3的紅寶石第8章教程部分文件
在文件new.html.erb我:
<h1>Sign up</h1>
<%= form_for(@user) do |f| %>
<%= render 'shared/error_messages' %>
我創建該文件的應用程序/視圖/共享/ _error_messages.html.erb
當我運行測試:束EXEC rspec的投機/請求/ users_spec.rb我收到以下錯誤消息:
失敗:
用戶註冊失敗不應該讓新用戶
Failure/Error: visit signup_path ActionView::Template::Error: Missing partial shared/error_messages with {:handlers=>[:erb, :rjs, :builder, :rhtml, :rxml], :formats=>[:html], :locale=>[:en, :en]} in view paths "/Users/username/rails_projects/my_sample_app/app/views"
用戶立即登記成功應該讓新用戶
Failure/Error: visit signup_path ActionView::Template::Error: Missing partial shared/error_messages with {:handlers=>[:erb, :rjs, :builder, :rhtml, :rxml], :formats=>[:html], :locale=>[:en, :en]} in view paths "/Users/username/rails_projects/my_sample_app/app/views"
如果你用'<%= render'/ shared/error_messages'%>替換,那該怎麼辦?' – apneadiving
這沒有用。我使用AptanaStudio3作爲我的編輯器,並且一旦我保存了該文件,就出現了以下錯誤:/ Aptana Studio 3/configuration/org.eclipse.osgi/bundles/84/1/.cp/bundles/rails.ruble/commands/content_assist.rb:7) \t at org.jruby.RubyProc.call(org/jruby/RubyProc.java:268)仍嘗試過運行rspec,並得到相同的錯誤 – user814455
真的很奇怪,沒有其他的想法,然後 – apneadiving