2013-05-15 27 views
0

我試圖使用bundle exec rake資源預編譯我的資源在生產服務器上:precompile。什麼時候運行耙子,我得到下面的錯誤。這是什麼造成的?bundle exec rake資源中不存在的mysql適配器:precompile

[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 

回答

1

不知道這是解決方案,但對於最近的Rails應用,你可能想使用mysql2寶石。看起來你還在那個古老的寶石上。

+0

感謝您的意見。它結束了我的版本的MySQL是錯誤的,但更新到mysql2固定,反正。謝謝。 – dremme

相關問題