[英]Run rake outside of rails_root/Incron doesn't run rake or bundle commands for rails
[英]Run rake task from outside RAILS_ROOT
我的RAILS_ROOT是/ usr / local / www / application /
如果我從RAILS_ROOT中運行'rake db:migrate RAILS_ENV = production',它可以正常工作。
但是我似乎找不到從RAILS_ROOT外部運行相同命令的方法。
嘗試:
rake -f $RAILS_ROOT/Rakefile db:migrate RAILS_ENV=production
# Assuming you set the environment variable.
# Else, just replace $RAILS_ROOT by actual value
我想你需要重新思考你的問題。 在沒有指定rakefile的情況下運行rake
,它將在當前目錄中搜索所述rakefile。 在除RAILS_ROOT之外的目錄中,它將找不到rakefile或錯誤的Rakefile
rake -rakefile /usr/local/www/application/Rakefile db:migrate RAILS_ENV=production
可能有效(假設rake用戶指南是正確的),盡管你可能必須在目錄中進行設計不良的插件/庫修改。
嘗試
cd /user/local/www/application && rake db:migrate RAILS_ENV=production
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.