Ruby 1.9.1 & Rails 2.3.4 generate code show wrong

My computer build on windows Ruby 1.9.1 ,rails 2.3.4 mysql

I am follow agile_web_development_with_rails_3rd_edition book to build
my site

ruby script/generate scaffold recipe title:string author:string
description:text

rake db:migrate

when I use chrome to view the url : http://192.168.15.100:3000/recipes

It shows this mistake:

NoMethodError in Recipes#index
Showing app/views/layouts/recipes.html.erb where line #12 raised:

undefined method `^’ for “a”:String

Extracted source (around line #12):

9:
10:
11:
12:

<%= flash[:notice] %>


13:
14: <%= yield %>
15:

RAILS_ROOT: E:/ror

and then I try :http://192.168.15.100:3000/recipes/new

It shows this :

NoMethodError in Recipes#new
Showing app/views/recipes/new.html.erb where line #3 raised:

undefined method `^’ for “a”:String

Extracted source (around line #3):

1:

New recipe


2:
3: <% form_for(@recipe) do |f| %>
4: <%= f.error_messages %>
5:
6:

RAILS_ROOT: E:/ror

the Log file record is :

Processing RecipesController#new (for 192.168.15.100 at 2009-09-24
15:43:46) [GET]
[4;35;1mRecipe Columns (0.0ms) [0m [0mSHOW FIELDS FROM recipes
[0m
Rendering template within layouts/recipes
Rendering recipes/new

ActionView::TemplateError (undefined method `^’ for “a”:String) on
line #3 of app/views/recipes/new.html.erb:
1:

New recipe


2:
3: <% form_for(@recipe) do |f| %>
4: <%= f.error_messages %>
5:
6:
(eval):2:in `form_authenticity_token'
app/views/recipes/new.html.erb:3
app/controllers/recipes_controller.rb:29:in `new'
<internal:prelude>:8:in `synchronize'
C:/Ruby/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
C:/Ruby/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
C:/Ruby/lib/ruby/1.9.1/webrick/server.rb:183:in `block in

start_thread’

Rendered rescues/_trace (125.0ms)
Rendered rescues/_request_and_response (0.0ms)
Rendering rescues/layout (internal_server_error)

btw i try ruby 1.8.6 + rails 2.3.4 is ok.thanks very much for your
time.

On Sep 24, 11:16Â am, ouwsh [email protected] wrote:

My computer build on  windows  Ruby 1.9.1  ,rails 2.3.4 mysql

It’s a bug in rails 2.3.4

Fred

oh,Thank for you help,

Do you know how to fix this bug with ruby 1.9.1 on rails 2.3.4 ? Just
on way I choose rails 2.3.2 or older?

On 9月24æ—¥, 下午7æ—¶45分, Frederick C. [email protected]

On Sep 24, 6:55Â pm, ouwsh [email protected] wrote:

oh,Thank for you help,

Do you know how to fix this bug with ruby 1.9.1 on rails 2.3.4 ? Just
on way I choose rails 2.3.2 or older?

downgrading to 2.3.3 probably the easiest thing.

Fred

Oh,I See

Thanks very much for you help again.I am study ruby & ROR from
yesterday,I try rails 2.3.3 now

BTW,I am chinese,My English is so poor,if have some mistake in
English,please don’t care ~ :slight_smile:

On 9月25æ—¥, 上午1æ—¶58分, Frederick C. [email protected]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs