Friday, February 25, 2011

Getting error uninitialized constant ENV_PATH (NameError) on running rails console

My Rails version is - 3.0.3
Ruby version - ruby 1.8.7 (2010-08-16 patchlevel 302) [i386-mingw32]
Gem version - 1.3.7
Operating system - Windows 7

When I run command "rails console" it gives following error:

C:\projects\working project\demo>rails console
C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.0.beta3/lib/rails/commands.rb:33: uninitialized constant ENV_PATH (NameError)
        from script/rails:6:in `require'
        from script/rails:6

Note -"Rails console" is not working only for this project and only on Windows 7
("Rails console" for the above project demo is working fine on linux but not working on Windows 7.
"Rails console" on another application on Rails 3 is working fine on Windows 7)

Can anybody guide me how to solve this error?

1 comment:

  1. Got this one solved at last.

    Actually, Rails version installed on the system is
    3.0.5, 3.0.3, 3.0.0, 3.0.0.beta3, 2.3.8, 2.3.5, 2.3.4

    And in the demo application Gemfile, instead of
    gem 'rails' , '3.0.3'

    it was

    gem 'rails'

    without any version and so picking wrong version and hence this error.

    Details can also be found on:
    http://railsforum.com/viewtopic.php?pid=137993#p137993

    ReplyDelete