Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/65.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 没有为rails 6和rails_ENV=production提供密码_Ruby On Rails_Ruby On Rails 6_Passenger Nginx - Fatal编程技术网

Ruby on rails 没有为rails 6和rails_ENV=production提供密码

Ruby on rails 没有为rails 6和rails_ENV=production提供密码,ruby-on-rails,ruby-on-rails-6,passenger-nginx,Ruby On Rails,Ruby On Rails 6,Passenger Nginx,我尝试使用nginx和passenger将我的rails api放入digital oceans服务器,目前为止,我已经让它正常工作了,但是当我尝试使用postman向我的服务器发送请求时,在检查log/production.log后,出现了500个内部错误,这500个内部错误是由于ActiveRecord::ConnectionNotEstablished(fe_sendauth:没有提供密码) 这很奇怪,因为RAILS\u ENV=production RAILS db:setup正在运行,

我尝试使用nginx和passenger将我的rails api放入digital oceans服务器,目前为止,我已经让它正常工作了,但是当我尝试使用postman向我的服务器发送请求时,在检查log/production.log后,出现了500个内部错误,这500个内部错误是由于
ActiveRecord::ConnectionNotEstablished(fe_sendauth:没有提供密码)
这很奇怪,因为
RAILS\u ENV=production RAILS db:setup
正在运行,我有凭证的master.key和secret\u key\u base在其中,用户名数据库和密码数据库的bashrc中有环境变量。当我运行
RAILS\u ENV=production RAILS c
时,我可以看到我的
ENV[“MYAPP\u database\u USER”]
仍然在rails控制台的生产模式下,我可以做
rails.application.credentials.secret\u key\u base
她在那里

postgres用户设置正确,密码与我提供给rails的密码相同。可能是它的乘客工作不正常…但我不知道如何正确检查它

编辑:问题解决

我能够像这样将我的env变量传递给nginx来解决我的问题 在
/etc/nginx/sites enabled/myapp.conf

passenger_env_var KEY VALUE;

乘客文档说他正在读取env变量的bashrc文件……但这没关系,希望它能帮助这里的某个家伙(呵呵;)

您是否在nginx设置中输入了env是生产的;乘客应用程序环境生产;````在服务器块中