Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

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.

share|improve this answer
    
Radeanu thanks for your answer but they both are not working for me. Any other idea? –  petwho Jul 7 '13 at 15:33
    
@petwho Can you start it from terminal? If yes, how? –  Radu Rădeanu Jul 7 '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. –  petwho Jul 8 '13 at 2:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.