small medium large xlarge

21 Sep 2009, 20:49
Roger S Southwick (2 posts)

Fresh install of Ruby 1.9.1-p243, Rails 2.3.4, Mysql 5.062, following the instructions in the AWDwR, 3rd edition, I’m getting stuck in section 6.2 I can get the tables into Mysql, I start up the webrick server, connect to the host/products page, and click ‘New product’. (i.e. http://HOST:3000/products/new).

Any suggestions? Here’s the error details:

I get a “NoMethodError in Products#new” and this in the browser:

Showing app/views/products/new.html.erb where line #3 raised:

undefined method `^’ for “e”:String Extracted source (around line #3):

1: <h1>New product</h1> 2: 3: <% form_for(@product) do |f| %> 4: <%= f.error_messages %> 5: 6: <p>

Also, I get this in the dump, (I had to shorten the paths to the top of the Ruby tree because of company confidentiality):

lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/message_verifier.rb:46:in block in secure_compare' lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/message_verifier.rb:45:in each’ /ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/message_verifier.rb:45:in secure_compare' lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/message_verifier.rb:28:in verify’ lib/ruby/gems/1.9.1/gems/actionpack-2.3.4/lib/action_controller/session/cookie_store.rb:156:in unmarshal' lib/ruby/gems/1.9.1/gems/actionpack-2.3.4/lib/action_controller/session/cookie_store.rb:145:in load_session’ lib/ruby/gems/1.9.1/gems/actionpack-2.3.4/lib/action_controller/session/abstract_store.rb:62:in block in load!' lib/ruby/gems/1.9.1/gems/actionpack-2.3.4/lib/action_controller/session/abstract_store.rb:70:in stale_session_check!’ lib/ruby/gems/1.9.1/gems/actionpack-2.3.4/lib/action_controller/session/abstract_store.rb:61:in load!' lib/ruby/gems/1.9.1/gems/actionpack-2.3.4/lib/action_controller/session/abstract_store.rb:28:in []’ lib/ruby/gems/1.9.1/gems/actionpack-2.3.4/lib/action_controller/request_forgery_protection.rb:102:in form_authenticity_token' (eval):2:in form_authenticity_token’ /usr/rogers/rails/depot/app/views/products/new.html.erb:3:in _run_erb_app47views47products47new46html46erb' /usr/rogers/rails/depot/app/controllers/products_controller.rb:29:in new’

————- Here is the output of webrick, santizing the paths ——

Rendering products/new

ActionView::TemplateError (undefined method `^’ for “5”:String) on line #3 of app/views/products/new.html.erb: 1: <h1>New product</h1> 2: 3: <% form_for(@product) do |f| %> 4: <%= f.error_messages %> 5: 6: <p>

(eval):2:in `form_authenticity_token'
app/controllers/products_controller.rb:29:in `new'
<internal:prelude>:8:in `synchronize'
lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
21 Sep 2009, 20:53
Nicolas Noël (8 posts)

I don’t think that rails work with ruby 1.9.1. I think the recommanded version is 1.8.7. I’m using 1.8.6 because of a problem in 1.8.7 on the mac cheers

21 Sep 2009, 20:58
Roger S Southwick (2 posts)

Thanks, Nicolas… that’s what I was afraid of. I was really hoping 1.9.1 would work because it’s faster and got some other improvements I wanted.

I’ll get 1.8.7-p160, and start over again.

You must be logged in to comment