开发者

Starting Rails Instance Server from an absolute path?

开发者 https://www.devze.com 2023-02-22 12:08 出处:网络
I\'m trying to create a autostart script to start a Rails Instance Server when my SUSE Linux Server is restarting.

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开发者_如何学Go?


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
0

精彩评论

暂无评论...
验证码 换一张
取 消