2

I have a rails app all set on windows 7 machine. I am able to run rails server by running .bat file (run_rails.bat) which contains the following - cd C:\Sites\myapp @call rails s -e production -p 3000

I would like to automatically start the rails app when windows OS boots. For which I tried to create a scheduled task using schtasks.exe - schtasks /create /tn my_task /tr "C:\Scheduled Jobs\run_rails.bat" /sc onstart

But when I reboot the system the automated task run fails with message there are currently no logon servers available to service the logon request however manually running the task by clicking on run button runs the app fine.

Are there any alternative ways to achieve this, is my approach correct to run the rails app locally ?

abhishek77in
  • 1,848
  • 21
  • 41

2 Answers2

1

The simpler way is to create a batch file with the instruction what you give in the command prompt like

d:

cd projects\myapp

ruby script\server

and then drop a copy of the file to Windows Start -> All Programs -> start up folder.

HS_
  • 133
  • 8
1

Add an entry under HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run. Obviously, admin rights are needed for this.

MSalters
  • 173,980
  • 10
  • 155
  • 350