有个奇怪的问题需要帮助.
我试图在生产服务器上启动rails控制台,它的行为就像rails c命令不存在一样.
FWIW,我已经做了4年的rails开发人员,并且一直在大量其他服务器上这样做,没有任何问题.在这台服务器上,我可以毫无问题地删除、创建、迁移、为数据库添加种子(使用RAILS_ENV=production),应用程序可以正常运行,没有任何问题.
Setup:
Ubuntu 14.04(racksapce第二代性能1服务器)
What I've tried:
将cd放入应用程序目录:
cd /home/deployer/app_name/current
它装载了.rvmrc并显示我在正确的Ruby 中,跑Bundle 只是为了踢.
rails c production # (which usually works no problem)
bundle exec rails c production # (sometimes have to do this on older apps that do not have the newer capistrano 3 and rvm setup)
rails c production RAILS_ENV=production # (getting desperate here)
RAILS_ENV=production rails c production # (haha, surely this won't work, but out of options)
RAILS_ENV=production bundle exec rails console
每次我都会收到一条通知,暗示"rails c"不是有效的命令:
Usage:
rails new APP_PATH [options]
Options:
-r, [--ruby=PATH] # Path to the Ruby binary of your choice
..... yada yada, shows the rest of the rails options (oddly enough does not show 'c' or 'console' as options?)
同样,我已经登录了nginx/apache上的数百个生产控制台,这些控制台部署了Unicorn的旧版本和新版本,以及大部分旧版本的Passenger.
这是我第一次收到这个消息,控制台是唯一一个似乎坏了的东西——其他一切都很好!该应用程序是实时的,效果很好.
我知道,首先要建议的是,我没有从应用程序目录运行rails c产品——我已将cd光盘放入正确的目录至少10次,并手动加载了正确的gemset,这不是问题所在.
我不明白为什么它在开发中运行良好,但在生产中却不行.我知道不久前有一个脚本目录(可能是rails 2?)-是否还有一个目录包含可能已损坏的rails脚本命令?
以前有没有人经历过这种情况,或者有什么建议?
我觉得我错过了什么.