Hi,
I am trying to run a command line Rails script. This worked wonderfully,
until I upgraded to Rails 1.4. I do the following:
#!/usr/bin/env ruby
require File.dirname(__FILE__) + ''/../config/environment''
ActiveRecord::Base.establish_connection
(ActiveRecord::Base.configurations["development"])
user = User.find(uid)
and I get the following error, please help:
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_suppo
rt/dependencies.rb:123:in `const_missing'': uninitialized constant
ApplicationCon
troller (NameError)
from
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib
/active_support/dependencies.rb:131:in `const_missing''
from
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib
/active_support/dependencies.rb:133:in `send''
from
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib
/active_support/dependencies.rb:133:in `const_missing''
from ./../config/../app/models/blog.rb:26
from
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib
/active_support/dependencies.rb:140:in `load''
from
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib
/active_support/dependencies.rb:140:in `load''
from
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib
/active_support/dependencies.rb:56:in `require_or_load''
from
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk
-~----------~----~----~----~------~----~------~--~---
On 10/22/06, Vinod Krishnan <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Hi, > I am trying to run a command line Rails script. This worked wonderfully, > until I upgraded to Rails 1.4. I do the following:Are you opening your console Window through Instant Rails or otherwise ensuring that the IR 1.4 ruby\bin directory is on your path before any other instance of Ruby? I can report that it is working for me, so there is something not quite right with your environment. Curt --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Curt Hibbs wrote:> On 10/22/06, Vinod Krishnan <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: >> >> Hi, >> I am trying to run a command line Rails script. This worked wonderfully, >> until I upgraded to Rails 1.4. I do the following: > > Are you opening your console Window through Instant Rails or otherwise > ensuring that the IR 1.4 ruby\bin directory is on your path before any > other instance of Ruby? > > I can report that it is working for me, so there is something not > quite right with your environment. > > CurtIt somehow seems like I am not able to load the ApplicationController. I removed all the logic that was being referred in the application.rb and put it in a helper, and now it works fine. I am opening my script through windows, but I am running use_ruby to ensure that all the environment variables are loaded. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---