ruby-on-rails – bundle exec rake assets:预编译 – 数据库配置未指定适配器

前端之家收集整理的这篇文章主要介绍了ruby-on-rails – bundle exec rake assets:预编译 – 数据库配置未指定适配器前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
24小时后,我试图找到我的应用程序的问题.我终于找到了问题.

我跑了

  1. rake assets:precompile RAILS_ENV=production

我一直在收到这个错误.

  1. /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
  2. rake aborted!
  3. database configuration does not specify adapter
  4.  
  5. Tasks: TOP => environment
  6. (See full trace by running task with --trace)
  7. rake aborted!
  8. Command Failed with status (1): [/Users/vezu/.rvm/rubies/ruby-1.9.3-p194/bi...]

我的database.yml文件看起来像这样

  1. development:
  2. adapter: postgresql
  3. host: localhost
  4. encoding: unicode
  5. database: ndoda_development
  6. pool: 5
  7. username:
  8. password:
  9.  
  10. test:
  11. adapter: postgresql
  12. encoding: unicode
  13. database: ndoda_test
  14. pool: 5

解决方法

简单的解决方案是在我的application.rb中添加一个简单的行
  1. config.assets.initialize_on_precompile = false

一切正常.

猜你在找的Ruby相关文章