2

I want webrick running at startup. So I execute this command in terminal:

crontab -e

Then added this line to the end of the file

@reboot /home/myname/.rvm/rubies/ruby-2.0.0-head/bin/ruby /home/myname/redmine-2.3.1/script/rails server webrick -e production

and restarted Ubuntu. However, the server still didn't start when my Ubuntu booted.

Any help on this problem?

Karthik C
  • 2,827

1 Answers1

0

I think the right way is to add this two lines in crontab:

PATH = /home/myname/.rvm/rubies/ruby-2.0.0-head/bin:$PATH
@reboot ruby script/rails server webrick -e production

Or, better, use this post to start webrick automatically on login.

Radu Rădeanu
  • 169,590
  • Radeanu thanks for your answer but they both are not working for me. Any other idea? – Khanh Tran Jul 07 '13 at 15:33
  • @petwho Can you start it from terminal? If yes, how? – Radu Rădeanu Jul 07 '13 at 15:48
  • I am not sure what do you mean by starting it from terminal. However, I tried both on terminal and GUI approaches. For GUI approach (which you linked on your answer): I entered this line: "/home/myname/.rvm/rubies/ruby-2.0.0-head/bin/ruby /home/myname/redmine-2.3.1/script/rails server webrick -e production &" to "command" field (and event removed the ampersand character at the end of the command). They both not working. I also added "x" permission to all users to file under ~/.config/autostart/webrick and /etc/rc.local. I'm really getting hairy with this. – Khanh Tran Jul 08 '13 at 02:59