gpt4 book ai didi

ruby-on-rails-4 - rails 4 部署 - rake stderr : config.eager_load 设置为 nil .. 不正确的错误消息

转载 作者:行者123 更新时间:2023-12-04 01:11:26 24 4
gpt4 key购买 nike

在使用 Capistrano 进行项目暂存部署期间,为了解决常见的数据库访问错误,我注意到 rake stderr 行:

  rake stderr: config.eager_load is set to nil. Please update your config/environments/*.rb files accordingly..

但是,我的 config/environments/*rb 文件已根据需要正确设置..
为什么这个消息?我错过了什么?

我的配置/环境/development.rb
 config.eager_load = false

我的配置/环境/production.rb
 config.eager_load = true

我的配置/环境/test.rb
config.eager_load = false

这是控制台日志的摘录
    Tasks: TOP => db:migrate
(See full trace by running task with --trace)

SSHKit::Command::Failed: rake exit status: 1
rake stdout: Nothing written
rake stderr: config.eager_load is set to nil. Please update your config/environments/*.rb files accordingly:

* development - set it to false
* test - set it to false (unless you use a tool that preloads your test environment)
* production - set it to true

rake aborted!
Mysql2::Error: Access denied for user 'root'@'localhost' (using password: NO)

最佳答案

部署时我遇到了类似的问题

cap staging deploy

问题是 capistrano 正在寻找数据库 myapp_staging , 而我需要 myapp_production .

我通过添加修复它
set :stage, "production"

config/deploy/staging.rb .

关于ruby-on-rails-4 - rails 4 部署 - rake stderr : config.eager_load 设置为 nil .. 不正确的错误消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24841733/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com