简体   繁体   English

捆绑执行rake资产:预编译期间不存在的mysql适配器

[英]nonexistent mysql adapter during bundle exec rake asset:precompile

I'm trying to precompile my assets on the production server using bundle exec rake asset:precompile. 我正在尝试使用bundle exec rake asset:precompile在生产服务器上预编译我的资产。 When is run the rake, I get the error below. 当运行耙时,出现以下错误。 What is causing this? 是什么原因造成的?

[x]$ bundle exec rake asset:precompile
/usr/local/rvm/rubies/ruby-1.9.3-p392/bin/ruby /home/admin/ento/vendor/bundle/ruby/1.9.1/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
rake aborted!
database configuration specifies nonexistent mysql adapter
/home/admin/ento/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_specification.rb:133:in `establish_connection'
/home/admin/ento/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.11/lib/active_record/railtie.rb:82:in `block (2 levels) in <class:Railtie>'
/home/admin/ento/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.11/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval'
/home/admin/ento/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.11/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
/home/admin/ento/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.11/lib/active_support/lazy_load_hooks.rb:26:in `block in on_load'
/home/admin/ento/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.11/lib/active_support/lazy_load_hooks.rb:25:in `each'
/home/admin/ento/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.11/lib/active_support/lazy_load_hooks.rb:25:in `on_load'
/home/admin/ento/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.11/lib/active_record/railtie.rb:74:in `block in <class:Railtie>'
/home/admin/ento/vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/initializable.rb:30:in `instance_exec'
/home/admin/ento/vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/initializable.rb:30:in `run'
/home/admin/ento/vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/initializable.rb:55:in `block in run_initializers'
/home/admin/ento/vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/initializable.rb:54:in `each'
/home/admin/ento/vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/initializable.rb:54:in `run_initializers'
/home/admin/ento/vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/application.rb:136:in `initialize!'
/home/admin/ento/vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/railtie/configurable.rb:30:in `method_missing'
/home/admin/ento/config/environment.rb:5:in `<top (required)>'
/home/admin/ento/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require'
/home/admin/ento/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `block in require'
/home/admin/ento/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:236:in `load_dependency'
/home/admin/ento/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require'
/home/admin/ento/vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/application.rb:103:in `require_environment!'
/home/admin/ento/vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/application.rb:297:in `block (2 levels) in initialize_tasks'
/home/admin/ento/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.11/lib/sprockets/assets.rake:93:in `block (2 levels) in <top (required)>'
/home/admin/ento/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.11/lib/sprockets/assets.rake:60:in `block (3 levels) in <top (required)>'
Tasks: TOP => environment
(See full trace by running task with --trace)
rake aborted!
Command failed with status (1): [/usr/local/rvm/rubies/ruby-1.9.3-p392/bin/...]
/home/admin/ento/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.11/lib/sprockets/assets.rake:12:in `ruby_rake_task'
/home/admin/ento/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.11/lib/sprockets/assets.rake:21:in `invoke_or_reboot_rake_task'
/home/admin/ento/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.11/lib/sprockets/assets.rake:29:in `block (2 levels) in <top (required)>'
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)

Gemfile: 宝石文件:

source 'https://rubygems.org'

gem 'rails', '3.2.11'

group :development do
    gem 'sqlite3'
end

group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'

  gem 'uglifier', '>= 1.0.3'
  gem 'mysql'
end

gem 'jquery-rails'

group :production do
    gem 'mysql'
    gem 'activerecord-mysql-adapter'
end

gem 'devise'
gem 'paper_trail'
gem 'ckeditor_rails'
gem 'bootstrap-sass'
gem 'bootstrap-datepicker-rails'
gem 'carrierwave'
gem 'ransack'
gem 'nested_form'
gem 'mysql'
gem 'will_paginate'
gem 'capistrano'
gem 'therubyracer'
gem 'best_in_place'

database.yml 数据库

production:
  adapter: mysql
  host: localhost
  database: xxxx
  username: xxxx
  password: xxxx
  timeout: 5000

Not sure this is the solution, but for more recent Rails apps, you probably want to use the mysql2 gem. 不确定这是否是解决方案,但是对于较新的Rails应用程序,您可能要使用mysql2 gem。 It looks like you're still on the old gem. 看来您仍在使用旧宝石。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 MySQL&Rails 4-捆绑执行rake db:migrate-不支持的数据库迁移到UTF-8 - MySQL & Rails 4 - bundle exec rake db:migrate - Unsupported database for migration to UTF-8 耙资产:预编译 - Rake assets:precompile MySQL - 检查不存在的记录 - MySQL - Checking nonexistent records 由于errno而无法捆绑exec rake:db:rollback:150-外键约束格式错误 - Cannot bundle exec rake:db:rollback due to errno: 150 - Foreign key constraint is incorrectly formed MYSQL具有不存在的条目 - MYSQL HAVING with nonexistent entries 在rake db:migrate期间,Mina Deploy无法连接到MySQL - Mina Deploy fails connecting to MySQL during rake db:migrate rake db:用mysql2 gem创建错误(无法为{“adapter”=&gt;“mysql2”创建数据库) - rake db:create error with mysql2 gem (Couldn't create database for {“adapter”=>“mysql2”) Rails mysql2错误:“rake aborted!请安装mysql2适配器...“ - Rails mysql2 error: “rake aborted! Please install the mysql2 adapter…” 无法rake db:create:all - 无法为{“encoding”=&gt;“utf8”,“username”=&gt;“root”,“adapter”=&gt;“mysql”创建数据库 - Cannot rake db:create:all — Couldn't create database for {“encoding”=>“utf8”, “username”=>“root”, “adapter”=>“mysql” heroku rake db:migrate ERROR“gem install activerecord-mysql-adapter” - heroku rake db:migrate ERROR “gem install activerecord-mysql-adapter”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM