Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/52.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 RubyonRails“;KeyError:找不到密钥“;使用capistrano部署时_Ruby On Rails_Ruby_Capistrano - Fatal编程技术网

Ruby on rails RubyonRails“;KeyError:找不到密钥“;使用capistrano部署时

Ruby on rails RubyonRails“;KeyError:找不到密钥“;使用capistrano部署时,ruby-on-rails,ruby,capistrano,Ruby On Rails,Ruby,Capistrano,我正试图使用capistrano部署我的rails应用程序,但在db:migrate之后,我得到了 01 $HOME/.rbenv/bin/rbenv exec bundle exec rake db:migrate 01 rake aborted! 01 KeyError: Cannot load database configuration: 01 key not found: "APP_DATABASE_PASSWORD" 01 (erb):54:in `fetch'

我正试图使用
capistrano
部署我的rails应用程序,但在
db:migrate
之后,我得到了

  01 $HOME/.rbenv/bin/rbenv exec bundle exec rake db:migrate
  01 rake aborted!
  01 KeyError: Cannot load database configuration:
  01 key not found: "APP_DATABASE_PASSWORD"
  01 (erb):54:in `fetch'
  01 (erb):54:in `<main>'
  01 /home/deploy/app/shared/bundle/ruby/2.6.0/gems/railties-6.0.2.1/lib/rails/application/configuration.rb:228:in `database_configuration'
  01 /home/deploy/app/shared/bundle/ruby/2.6.0/gems/activerecord-6.0.2.1/lib/active_record/railtie.rb:39:in `block (3 levels) in <class:Railti…
  01 /home/deploy/app/shared/bundle/ruby/2.6.0/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
  01 /home/deploy/.rbenv/versions/2.6.3/bin/bundle:23:in `load'
  01 /home/deploy/.rbenv/versions/2.6.3/bin/bundle:23:in `<main>'
在my
.bashrc
中:

export APP\u DATABASE\u PASSWORD=“SOME\u PASSWORD”
导出应用程序\数据库\用户名=“某些\用户名”

在.bashrc中,如果您看到这一行

[ -z "$PS1" ] && return

将您的导出放在这上面。

我的
.bashrc
中没有这一行。就像这样的
PS1=“\[\e]0;${debian\u chroot:+($debian\u chroot)}\u@\h:\w\a\]$PS1”
但是我有
case$-in*I*);*)返回;;esac
粘贴在中提到的已修复块上方,我在中找到了答案。