Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I need to get WEBrick (basically a Rails web server) to work using upstart, but cannot figure out what should I write in script.

The following gives me an error:

chdir /rails-app

exec su -s /bin/sh -c 'exec "$0" "$@"' myuser -- rails server -e production

start on runlevel [2345]
stop on runlevel [^2345]

(the error is rails: 1: exec: rails: not found)

Ruby is installed via rvm, so probably I should try something like :

exec su -s /bin/sh -c 'exec "$0" "$@"' myuser -- /home/myuser/.rvm/gems/ruby-1.9.3-p385/bin/bundle exec rails server -e production

But this doesn't work too (/usr/bin/env: ruby_noexec_wrapper: No such file or directory).

How do I run WEBrick as an upstart job?

share|improve this question

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.