使用绝对路径启动 Rails 服务器
我正在尝试编写一个脚本来运行我的 Rails 开发服务器,但绝对路径不起作用。
这就是我所拥有的;
/home/me/dev/app/script/rails 服务器>> /var/log/rails.output.log
它只是抛出一个错误,
“找不到配置/home/me/config.ru”
看来 Rails 正在使用当前工作目录来获取其路径,而不是脚本位置。
有没有办法强制应用程序路径?
I'm trying to make a script to run my Rails dev server, but the absolute path doesn't want to work.
This is what I've got;
/home/me/dev/app/script/rails server >> /var/log/rails.output.log
It just throws an error saying,
"configuration /home/me/config.ru not found"
It appears that Rails is using the current working directory to get it's paths, rather than the script location.
Is there a way to force the app path?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
尝试:
cd /home/me/dev/app &&脚本/rails 服务器>> /var/log/rails.output.log
Try:
cd /home/me/dev/app && script/rails server >> /var/log/rails.output.log
作为替代方案:
as an alternative:
我想也许 Rails 服务器有一个可以传递给它的选项,以更改路径,但它没有 看起来就是这种情况。
您可以传递
-c
标志并指定您自己的配置,也许这与它有关?I thought maybe
rails server
had an option you could pass to it, to change the path, but it doesn't look like that's the case.You are able to pass a
-c
flag and specify your own configuration, maybe that has something to do with it?