I''m attempting to learn Ruby on Rails, but these errors aren''t helping. I''m currently trying to follow the lessons available on www.learningrails.com. I received this error after trying to visit a page generated by using the scaffold command. Actually, this is all I did up until the error: rails sample2 -d mysql mysqladmin -u root -p create sample2_development ruby script/generate controller pages home resources about contact ruby script/generate scaffold page name:string title:string body:text rake db:migrate Then after visiting localhost:3000/pages/new, this error occurred... Showing app/views/pages/new.html.erb where line #3 raised: undefined method `^'' for "e":String Extracted source (around line #3): 1: <h1>New page</h1> 2: 3: <% form_for(@page) do |f| %> 4: <%= f.error_messages %> 5: 6: <p> /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/message_verifier.rb:46:in `block in secure_compare'' /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/message_verifier.rb:45:in `each'' /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/message_verifier.rb:45:in `secure_compare'' /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/message_verifier.rb:28:in `verify'' /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.4/lib/action_controller/session/cookie_store.rb:156:in `unmarshal'' /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.4/lib/action_controller/session/cookie_store.rb:145:in `load_session'' /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.4/lib/action_controller/session/abstract_store.rb:62:in `block in load!'' /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.4/lib/action_controller/session/abstract_store.rb:70:in `stale_session_check!'' /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.4/lib/action_controller/session/abstract_store.rb:61:in `load!'' /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.4/lib/action_controller/session/abstract_store.rb:28:in `[]'' /usr/local/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'' /Users/username/Sites/Ruby/sample2/app/views/pages/new.html.erb:3:in `_run_erb_app47views47pages47new46html46erb'' /Users/username/Sites/Ruby/sample2/app/controllers/pages_controller.rb:29:in `new'' I read another post on here that reported an error similar to this and it lead to this patch: https://rails.lighthouseapp.com/projects/8994/tickets/3144/ However, this patch is apparently specifying message_verifier.rb, which I do not see in my error, and I do not know how to apply patches to Rails. If anyone could be of assistance I would greatly appreciate it. I''m using: Ruby 1.9.1p243 (2009-07-16 revision 24175) Rails 2.3.4 RubyGems 1.3.5 MySQLAdmin Ver 8.42 Distrib 5.1.40 -- Posted via http://www.ruby-forum.com/.
Also, this was what popped out of the terminal: ActionView::TemplateError (undefined method `^'' for "e":String) on line #3 of app/views/pages/new.html.erb: 1: <h1>New page</h1> 2: 3: <% form_for(@page) do |f| %> 4: <%= f.error_messages %> 5: 6: <p> (eval):2:in `form_authenticity_token'' app/views/pages/new.html.erb:3 app/controllers/pages_controller.rb:29:in `new'' <internal:prelude>:8:in `synchronize'' /usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'' /usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'' /usr/local/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'' -- Posted via http://www.ruby-forum.com/.
Hi Joe dude Firstly advise you to use any name other than page for the resource> ruby script/generate controller pages home resources about contact > ruby script/generate scaffold page name:string title:string body:text > rake db:migrate >Instead of these do like ruby script/generate scaffold Page name:string title:string body:text rake db:migrate Now check And add the additional routes as you go through Sijo K George -- Posted via http://www.ruby-forum.com/.
Check out this link - https://rails.lighthouseapp.com/projects/8994/tickets/3144-undefined-method-for-string-ror-234 There is a bug in rails 2.3.4 ... that throws the same errors you are mentioning. On Wed, Oct 28, 2009 at 9:55 AM, Sijo k g <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Hi Joe dude > > Firstly advise you to use any name other than page for the resource > >> ruby script/generate controller pages home resources about contact >> ruby script/generate scaffold page name:string title:string body:text >> rake db:migrate >> > > Instead of these do like > ruby script/generate scaffold Page name:string title:string body:text > rake db:migrate > Now check > > And add the additional routes as you go through > > > > Sijo K George > -- > Posted via http://www.ruby-forum.com/. > > > >-- Regards, Kashyap
C K Kashyap wrote:> Check out this link - > https://rails.lighthouseapp.com/projects/8994/tickets/3144-undefined-method-for-string-ror-234 > > There is a bug in rails 2.3.4 ... that throws the same errors you are > mentioning. > > > -- > Regards, > KashyapWell I figured out how to apply this patch by visiting this site -- http://stackoverflow.com/questions/930126/how-do-you-apply-a-patch-to-ruby-on-rails I''ll try creating a new Rails app and see what happens. -- Posted via http://www.ruby-forum.com/.
Joe dude wrote:> C K Kashyap wrote: >> Check out this link - >> https://rails.lighthouseapp.com/projects/8994/tickets/3144-undefined-method-for-string-ror-234 >> >> There is a bug in rails 2.3.4 ... that throws the same errors you are >> mentioning. >> >> >> -- >> Regards, >> Kashyap > > Well I figured out how to apply this patch by visiting this site -- > http://stackoverflow.com/questions/930126/how-do-you-apply-a-patch-to-ruby-on-rails > > I''ll try creating a new Rails app and see what happens.You don''t need to create a new app. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/.
Marnen Laibow-Koser wrote:> You don''t need to create a new app. > > Best, > -- > Marnen Laibow-Koser > http://www.marnen.org > marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.orgIt really doesn''t matter since I literally just began toying around with RoR. I already deleted the 2 sample apps I generated last night; they were hardly touched anyway. No big deal :P -- Posted via http://www.ruby-forum.com/.