Forum: Ruby on Rails uninitialized constant ActionVie

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Kad K. (Guest)
on 2008-12-11 17:47
Hello

I am trying to transform my web app into a 2.2 ready app,
in my config/environment.rb
I wrote

Rails::Initializer.run do |config|
.....
  # disabling the surrounding div if validation error
  ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
    if html_tag.include?("class=")
      html_tag.sub(%r{(class=["'])}, '\1invalid ')
    else
      html_tag.sub(%r{(<[^ ]+ )}, '\1class="invalid" ')
    end
  end
..
end

BUT running the console I get an error :

 yves$ script/console

Loading development environment (Rails 2.2.2)

/...i/config/environment.rb:111:NameError: uninitialized constant
ActionView
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/testing/setup_and_teardown.rb:14:in
`included':NameError: uninitialized constant ActiveSupport::Callbacks

/usr/local/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/console_with_helpers.rb:19:NoMethodError:
undefined method `require_dependency' for main:Object


what could be the error ?  thanks for your help ...

erwin

(Rails 2.2.2 , Ruby 1.8.7, on Mac OS X10.5)
Frederick C. (Guest)
on 2008-12-11 17:53
(Received via mailing list)
On 11 Dec 2008, at 15:47, Kad K. wrote:
> active_support/testing/setup_and_teardown.rb:14:in
> `included':NameError: uninitialized constant ActiveSupport::Callbacks
>
> /usr/local/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/
> console_with_helpers.rb:19:NoMethodError:
> undefined method `require_dependency' for main:Object
>
>
> what could be the error ?  thanks for your help ...
>
ActionView hasn't been loaded yet. Move all of that into a file in
config/initializers

Fred
Kad K. (Guest)
on 2008-12-11 20:17
Frederick C. wrote:
> On 11 Dec 2008, at 15:47, Kad K. wrote:
>> active_support/testing/setup_and_teardown.rb:14:in
>> `included':NameError: uninitialized constant ActiveSupport::Callbacks
>>
>> /usr/local/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/
>> console_with_helpers.rb:19:NoMethodError:
>> undefined method `require_dependency' for main:Object
>>
>>
>> what could be the error ?  thanks for your help ...
>>
> ActionView hasn't been loaded yet. Move all of that into a file in
> config/initializers
>
> Fred


Thanks a lot.....  is there any link to a doc where i can read more
about the initialization process... ?
(like the one I have on boot process of my OS X system...)
This topic is locked and can not be replied to.