Daniel
Daniel

Reputation: 4173

Starting Rails Instance Server from an absolute path?

I'm trying to create a autostart script to start a Rails Instance Server when my SUSE Linux Server is restarting.

I've created a shell script in /etc/init.d/rails_s_appname with the following content:

#!/bin/bash
/home/appname/public_html/rails s -p 3333 -d

I gave the script 755 permissions and started it.

The result is the following:

/etc/init.d/rails_s_appname 
/etc/init.d/rails_s_appname: line 2: /home/appname/public_html/rails: No such file or directory

Any one has an idea how to start a Rails Instance Server from an absolute path?

Upvotes: 0

Views: 563

Answers (1)

shingara
shingara

Reputation: 46914

It's better do not use the rails script to launch your app like that.

Try Thin or unicorn. Both have the cwd configuration to say where is you APP_HOME

But if you really want do that. Use the script/rails commandline inside your APP_HOME to do what you want

/home/appname/script/rails s -p 3333 -d

Upvotes: 2

Related Questions