0
我經歷了railstutorial.org書和代碼得到一個編譯時錯誤編譯錯誤
<div class="center hero-unit">
<h1>Welcome to the Sample App</h1>
<h2>
This is the home page for the
<a href="http://railstutorial.org/">Ruby on Rails Tutorial</a>
sample application.
</h2>
<%= link_to "Sign up now!", '#', class: "btn btn-large btn-primary" %>
</div>
<%= link_to image_tag("rails.png", alt: "Rails"), 'http://rubyonrails.org/' %>
我的錯誤是
compile error
/home/ritesh/projects/sample/app/views/static_pages/home.html.erb:8: syntax error, unexpected ':'
...to "Sign up now!", '#', class: "btn btn-large btn-primary")...
^
/home/ritesh/projects/sample/app/views/static_pages/home.html.erb:10: syntax error, unexpected ':', expecting ')'
...to image_tag("rails.png", alt: "Rails"), 'http://rubyonrails...
^
/home/ritesh/projects/sample/app/views/static_pages/home.html.erb:10: syntax error, unexpected ')', expecting kEND
...), 'http://rubyonrails.org/');@output_buffer.safe_concat('
^
我想:應該有class.can任何一個後請建議如何糾正這個錯誤
Ruby解釋器的版本號是多少? –
ruby翻譯版本是1.8.7 –
好吧,現在有道理。看到我的答案。 –