I’m a freshman on Rails (and Ruby) so I’m sorry if my question is
pretty basic, and possible has a vary basic answer. I tried to Google
this problem, but a couple of hour after and no solution found, I
decided to ask for help here.
I have installed ruby 1.9.1p243, Rails 2.3.4, Gem 1.3.5, SQLite
version 3.6.18 (I think this is all that it’s needed).
I´m reading and implementing simultaneously Depot sample app presented
in the book Agile Web D. with Rails. After creating the Model
(just a simple table Products) and generating the controller and views
through the generate script with scaffolding enabled, and applying the
respective migration to the database (SQLite), when I access the
default action on Products controller (index), I get the following
error:
Showing app/views/layouts/products.html.erb where line #12 raised:
undefined method `^’ for “d”:String
Extracted source (around line #12):
9:
10:
11:
12:
<%= flash[:notice] %>
13:
14: <%= yield %>
15:
RAILS_ROOT: C:/lfalcao/Work/Dev/Ruby/Rails/Depot
Application Trace | Framework Trace | Full Trace
This is the default view generated. I haven’t touched it yet. What is
this problem? Do I need to install something else? Am I doing anything
wrong?
I’m sorry if this is a basic one, but I tried everything (which is
very little) I know. Anybody can help me?
This is the default view generated. I haven’t touched it yet. What is
this problem? Do I need to install something else? Am I doing anything
wrong?
I’m sorry if this is a basic one, but I tried everything (which is
very little) I know. Anybody can help me?
The change in question was a security fix - for the purpose of
learning rails you could revert to rails 2.3.3 without ill effect
(make sure you have that version of the gem installed and set
RAILS_GEM_VERSION in environment.rb)
Thanks Fred. That solved my problem.
I Installed version 2.3.3 and then I had to rebuild the application
from scratch, because only changing the variable RAILS_GEM_VERSION in
environment.rb, still gave me the error pasted bellow, of a missing
method, I guess, when I started the WEBrick server.
Then I rebuilt the application with for the version 2.3.3 and all
works fine.
Thanks again
=> Booting WEBrick
=> Rails 2.3.3 application starting on http://0.0.0.0:3000
C:/lfalcao/Work/Dev/Ruby/Rails/Depot1/config/initializers/
new_rails_defaults.rb:14:in <top (require d)>': undefined methodgenerate_best_match=’ for
ActionController::Routing:Module (NoMethodError)
from C:/Ruby/Ruby1.9.1-p243/lib/ruby/gems/1.9.1/gems/
activesupport-2.3.3/lib/active_support/
dependencies.rb:145:in load' from C:/Ruby/Ruby1.9.1-p243/lib/ruby/gems/1.9.1/gems/ activesupport-2.3.3/lib/active_support/ dependencies.rb:145:inblock in load_with_new_constant_marking’
from C:/Ruby/Ruby1.9.1-p243/lib/ruby/gems/1.9.1/gems/
activesupport-2.3.3/lib/active_support/
dependencies.rb:521:in new_constants_in' from C:/Ruby/Ruby1.9.1-p243/lib/ruby/gems/1.9.1/gems/ activesupport-2.3.3/lib/active_support/ dependencies.rb:145:inload_with_new_constant_marking’
from C:/Ruby/Ruby1.9.1-p243/lib/ruby/gems/1.9.1/gems/
rails-2.3.3/lib/initializer.rb:622:in block in load_application_initializers' from C:/Ruby/Ruby1.9.1-p243/lib/ruby/gems/1.9.1/gems/ rails-2.3.3/lib/initializer.rb:621:in
each’
from C:/Ruby/Ruby1.9.1-p243/lib/ruby/gems/1.9.1/gems/
rails-2.3.3/lib/initializer.rb:621:in load_application_initializers' from C:/Ruby/Ruby1.9.1-p243/lib/ruby/gems/1.9.1/gems/ rails-2.3.3/lib/initializer.rb:176:in
process’
from C:/Ruby/Ruby1.9.1-p243/lib/ruby/gems/1.9.1/gems/
rails-2.3.3/lib/initializer.rb:113:in run' from C:/lfalcao/Work/Dev/Ruby/Rails/Depot1/config/ environment.rb:9:in<top (required)>’
from C:/Ruby/Ruby1.9.1-p243/lib/ruby/gems/1.9.1/gems/
activesupport-2.3.3/lib/active_support/
dependencies.rb:156:in require' from C:/Ruby/Ruby1.9.1-p243/lib/ruby/gems/1.9.1/gems/ activesupport-2.3.3/lib/active_support/ dependencies.rb:156:inblock in require’
from C:/Ruby/Ruby1.9.1-p243/lib/ruby/gems/1.9.1/gems/
activesupport-2.3.3/lib/active_support/
dependencies.rb:521:in new_constants_in' from C:/Ruby/Ruby1.9.1-p243/lib/ruby/gems/1.9.1/gems/ activesupport-2.3.3/lib/active_support/ dependencies.rb:156:inrequire’
from C:/Ruby/Ruby1.9.1-p243/lib/ruby/gems/1.9.1/gems/
rails-2.3.3/lib/commands/server.rb:84:i
n <top (required)>' from script/server:3:inrequire’
from script/server:3:in `’
Thanks Fred. That solved my problem.
I Installed version 2.3.3 and then I had to rebuild the application
from scratch, because only changing the variable RAILS_GEM_VERSION in
environment.rb, still gave me the error pasted bellow, of a missing
method, I guess, when I started the WEBrick server.
Then I rebuilt the application with for the version 2.3.3 and all
works fine.
Thanks again
=> Booting WEBrick
=> Rails 2.3.3 application starting on http://0.0.0.0:3000
C:/lfalcao/Work/Dev/Ruby/Rails/Depot1/config/initializers/
new_rails_defaults.rb:14:in <top (require d)>': undefined methodgenerate_best_match=’ for
ActionController::Routing:Module (NoMethodError)
from C:/Ruby/Ruby1.9.1-p243/lib/ruby/gems/1.9.1/gems/
activesupport-2.3.3/lib/active_support/
dependencies.rb:145:in load' from C:/Ruby/Ruby1.9.1-p243/lib/ruby/gems/1.9.1/gems/ activesupport-2.3.3/lib/active_support/ dependencies.rb:145:inblock in load_with_new_constant_marking’
from C:/Ruby/Ruby1.9.1-p243/lib/ruby/gems/1.9.1/gems/
activesupport-2.3.3/lib/active_support/
dependencies.rb:521:in new_constants_in' from C:/Ruby/Ruby1.9.1-p243/lib/ruby/gems/1.9.1/gems/ activesupport-2.3.3/lib/active_support/ dependencies.rb:145:inload_with_new_constant_marking’
from C:/Ruby/Ruby1.9.1-p243/lib/ruby/gems/1.9.1/gems/
rails-2.3.3/lib/initializer.rb:622:in block in load_application_initializers' from C:/Ruby/Ruby1.9.1-p243/lib/ruby/gems/1.9.1/gems/ rails-2.3.3/lib/initializer.rb:621:in
each’
from C:/Ruby/Ruby1.9.1-p243/lib/ruby/gems/1.9.1/gems/
rails-2.3.3/lib/initializer.rb:621:in load_application_initializers' from C:/Ruby/Ruby1.9.1-p243/lib/ruby/gems/1.9.1/gems/ rails-2.3.3/lib/initializer.rb:176:in
process’
from C:/Ruby/Ruby1.9.1-p243/lib/ruby/gems/1.9.1/gems/
rails-2.3.3/lib/initializer.rb:113:in run' from C:/lfalcao/Work/Dev/Ruby/Rails/Depot1/config/ environment.rb:9:in<top (required)>’
from C:/Ruby/Ruby1.9.1-p243/lib/ruby/gems/1.9.1/gems/
activesupport-2.3.3/lib/active_support/
dependencies.rb:156:in require' from C:/Ruby/Ruby1.9.1-p243/lib/ruby/gems/1.9.1/gems/ activesupport-2.3.3/lib/active_support/ dependencies.rb:156:inblock in require’
from C:/Ruby/Ruby1.9.1-p243/lib/ruby/gems/1.9.1/gems/
activesupport-2.3.3/lib/active_support/
dependencies.rb:521:in new_constants_in' from C:/Ruby/Ruby1.9.1-p243/lib/ruby/gems/1.9.1/gems/ activesupport-2.3.3/lib/active_support/ dependencies.rb:156:inrequire’
from C:/Ruby/Ruby1.9.1-p243/lib/ruby/gems/1.9.1/gems/
rails-2.3.3/lib/commands/server.rb:84:i
n <top (required)>' from script/server:3:inrequire’
from script/server:3:in `’
I confirm that just replacing RAILS_GEM_VERSION outputs the same
error.
Is there a workaround for this ?
you could remove the corresponding line from new_rails_defaults.rb -
sounds like the version 2.3.4 generates by default contains an option
that only exists from rails 2.3.4 onwards.
Fred
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.