bundle exec rake asset:precompile-数据库配置未指定适配器 [英] bundle exec rake assets:precompile - database configuration does not specify adapter

查看:227
本文介绍了bundle exec rake asset:precompile-数据库配置未指定适配器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试找到我的应用程序的问题24小时后。我终于找到了问题。

After 24 hours of trying to find the problem with my app. I finally found the problem.

我已运行

rake assets:precompile RAILS_ENV=production

,而我一直收到此错误。

and i kept on getting this error.

/Users/vezu/.rvm/rubies/ruby-1.9.3-p194/bin/ruby /Users/vezu/.rvm/gems/ruby-1.9.3-p194@global/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
rake aborted!
database configuration does not specify adapter

Tasks: TOP => environment
(See full trace by running task with --trace)
rake aborted!
Command failed with status (1): [/Users/vezu/.rvm/rubies/ruby-1.9.3-p194/bi...]

我的database.yml文件如下

My database.yml file looks like this

development:
  adapter: postgresql
  host: localhost
  encoding: unicode
  database: ndoda_development
  pool: 5
  username:
  password:

test:
  adapter: postgresql
  encoding: unicode
  database: ndoda_test
  pool: 5


推荐答案

简单的解决方案是在我的应用程序中添加一条简单的行。rb

The simple solution was to add one simple line to my application.rb

config.assets.initialize_on_precompile = false

一切正常

这篇关于bundle exec rake asset:precompile-数据库配置未指定适配器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆