Hello,
I am again looking for some guidance as an inexperienced programmer. I
appreciate the help. I would like to run a number of ruby files from
within rails. They are all different, but return information in a hash
(gen_output) in a standard format that my model in rails needs to use.
I am storing the files in a folder in "lib". The files can be as
basic
as 1+2+3, with 3 being returned in the hash.
This is in my model:
require ''lib/generators/parks_bielkowski_test.rb''
formatted = {
:complete_question => gen_output["complete_question"]
}
formatted
I get this error:
cannot load such file -- lib/generators/parks_bielkowski_test.rb
Do I need to do something to the files themselves?
Thanks
DC
--
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-/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 this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
Whoops, stupid error...
require "#{RAILS_ROOT}/lib/generators/parks_bielkowski_test.rb"
works!
Thanks anyway
DC
--
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-/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 this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
config.autoload_paths should include ''lib'' to load you code - it is strange that this isn''t happening. Rails.root is what we use in rails 2 On Sun, Mar 13, 2011 at 9:00 AM, Dave Castellano <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org>wrote:> Whoops, stupid error... > > require "#{RAILS_ROOT}/lib/generators/parks_bielkowski_test.rb" works! > > Thanks anyway > > DC > > -- > 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-/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 this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- make haste slowly \ festina lente \ - mobile +1_415_632_6001 curtis.schofield-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <curtis-DDU1nqEjlGkHaT8GDLgCUg@public.gmane.org> http://robotarmyma.de -- 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 this group at http://groups.google.com/group/rubyonrails-talk?hl=en.