Sunday, 19 May 2013

Run Webrick as upstart job

Run Webrick as upstart job

I need to get Webrick running for development (basically rails server) via upstart, but cannot figure out what should I write in script.
This gives me an error (obviously): rails: 1: exec: rails: not found
chdir /rails-app

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

start on runlevel [2345]
stop on runlevel [^2345]
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).

1 comment:

  1. Were you able to find a solution to this? I am trying to accomplish the same task.

    ReplyDelete