I've created a rake task that does various things, one of which is
calling a script. When I call that script from my Rails.root folder,
it works, but it doesn't work inside my rake task. [This is rails 3]
That is, the following line works from bash:
lib/daemons/mailer_ctl start
However, inside my rake task, this line does not work:
puts `lib/daemons/mailer_ctl start`
The error message is:
lib/daemons/mailer_ctl:3:in `require': no such file to load -- daemons
(LoadError)
from lib/daemons/mailer_ctl:3
So, it can't be a problem with the current working directory, because
it found the file to execute.
The daemon is very typical. The first few lines are:
#!/usr/bin/env ruby
require 'rubygems'
require "daemons"
require 'yaml'
require 'erb'
So, the require for rubygems must have succeeded, since it failed on
the require for daemons.
Why does it work from the command line, but not from the rake task?
Thanks,
--
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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.