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
粘贴在中提到的已修复块上方,我在中找到了答案。