大家好: 我想达到一个启动启动后, rails 也就跟着起来的效果。 根据之前的经验, 是将/path/of/app/rails server -d 命令放到了 Linux 系统的/etc/rc.local 文件中了。 但是系统启动后,并没有启动 rails 服务。 提示/usr/bin/evn 'ruby' No such file or directory 这个错误。 请问大家是用什么方式达到开机启动 rails 服务的效果呢?
看了有些帖子写的是使用 god + puma , 我没太看懂是什么意思。 还有的是用 apache 或 nginx 来启动 rails ? 这块就更没有理解了。 rails 本身也是 web 服务器, 还需要 apache 和 nginx 来做什么呢? 小白一枚, 请不吝指教。 THX --------------------------------------- Update - --------------------------------------------------------------
找到了一个方法, 在/etc/init.d/目录下,添加 puma 的开机启动, 参照了 https://github.com/puma/puma/tree/master/tools/jungle/init.d 这个。 可以达到 rails 开机启动的效果... , 不知道这个做法是否 正确。 看上去是达到了我想要的效果。
还是有疑问, 就是大家在使用 rails 的时候,引入进来了 apache 和 nginx 。 这两个在环境中是做什么用的呢?