Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

You must log in to answer this question.

Browse other questions tagged .