Hi guys, I am trying to use an ActiveRecord function in a Ruby script, and I can''t get it to work. I am using ActiceRecord 3.2.8.> require ''active_support/all'' > Time.zone.parse("2012-10-20")NoMethodError: undefined method `parse'' for nil:NilClass from (irb):2 from /Users/pjj/.rvm/rubies/ruby-1.9.2-p320/bin/irb:16:in `<main>'' Time.zone.parse works absolutely fine in a Rails console. I am not sure what step I am missing. What is Rails doing to let us use this function directly? Thanks a lot PJ -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/z9CgU7DZbJwJ. For more options, visit https://groups.google.com/groups/opt_out.
On Tue, Nov 6, 2012 at 4:30 AM, PierreW <wamrewam-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:>> require ''active_support/all'' >> Time.zone.parse("2012-10-20") > NoMethodError: undefined method `parse'' for nil:NilClass> Time.zone.parse works absolutely fine in a Rails console. > > I am not sure what step I am missing. What is Rails doing to let us use this > function directly?Setting Time.zone to a value so it''s not nil :-) -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org http://about.me/hassanschroeder twitter: @hassan -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.