Hello,
I have a program built in InstantRails 1.6 on Windows Server 2003. I
have a script, located in the script folder. I also have a windows
version of Cron, which points to that script. However, it doesn’t seem
to execute properly. If I call it from a controller in my app, it works
fine using script/myscript.rb
however, when I simply double-click it
in windows explorer, a command window pops up briefly (less than a
second) and closes, not executing anything. How am I to run my script
from anywhere, not just rails?
Any and all help is appreciated!
Thanks,
FYI, on a test script I created (which just creates a txt file and puts
in some lines) I noticed that it will work if I don’t load up the
environment. However, when I put
require File.expand_path(File.dirname(FILE) +
“/…/config/environment”)
at the top, it exits the program as soon as it starts… I need to use
this so I can access my models from that script, so I am not quite sure
how to go about this…
Any advice?
Thanks,
A coworker of mine helped me figure out that I am having this problem
because Ruby is not installed on the system, as it is only available via
Ruby on Rails (InstantRails 1.6). Is there a way I can “expand” this so
that I can use it outside of Rails?
Thanks,