Capistrano deploy: “Did not recognize your adapter specification” during assets:precompile

怎甘沉沦 提交于 2020-01-21 14:36:08

问题


I'm getting this error and I think it's coming from this line of code in the multi_json gem but I'm not sleuthy enough to know why it's being triggered?!?

Everything works fine in development and test but the deploy:assets:update_asset_mtimes task fails on cap deploy:migrations

Any tips as to why this might be happening? multi_json has rev'd since last deploy so may try rolling back to previous version but would like to know why it's failing...

Gory details:

$ cap deploy:migrations
...
  * 2013-08-13 15:18:44 executing `deploy:assets:update_asset_mtimes'
  * executing "[ -e /path/to/rails/myapp/shared/assets/manifest* ] && cat /path/to/rails/myapp/shared/assets/manifest* || echo"
    servers: ["railserver"]
    [railserver] executing command
    command finished in 888ms
 ** Updating mtimes for ~16 assets...
    servers: ["railserver"]
 ** scp upload #<StringIO:0x007f8651ba7fa0> -> /path/to/rails/myapp/TOUCH_ASSETS
    [railserver] /path/to/rails/myapp/TOUCH_ASSETS
  * scp upload complete
  * executing "cat /path/to/rails/myapp/TOUCH_ASSETS | while read asset; do touch -c -- \"$asset\"; done && rm -f -- /path/to/rails/myapp/TOUCH_ASSETS"
    servers: ["railserver"]
    [railserver] executing command
    command finished in 846ms
  * executing "cd -- /path/to/rails/myapp/releases/20130813221752 && RAILS_ENV=production RAILS_GROUPS=assets bundle exec rake assets:precompile"
    servers: ["railserver"]
    [railserver] executing command
 ** [out :: railserver] rake aborted!
 ** [out :: railserver] Did not recognize your adapter specification.
 ** [out :: railserver] /path/to/rails/myapp/shared/bundle/ruby/2.0.0/gems/multi_json-1.7.9/lib/multi_json.rb:106:in `rescue in load_adapter'
 ** [out :: railserver] /path/to/rails/myapp/shared/bundle/ruby/2.0.0/gems/multi_json-1.7.9/lib/multi_json.rb:95:in `load_adapter'
 ** [out :: railserver] /path/to/rails/myapp/shared/bundle/ruby/2.0.0/gems/multi_json-1.7.9/lib/multi_json.rb:99:in `load_adapter'
 ** [out :: railserver] /path/to/rails/myapp/shared/bundle/ruby/2.0.0/gems/multi_json-1.7.9/lib/multi_json.rb:89:in `use'
 ** [out :: railserver] /path/to/rails/myapp/shared/bundle/ruby/2.0.0/gems/multi_json-1.7.9/lib/multi_json.rb:71:in `adapter'
 ** [out :: railserver] /path/to/rails/myapp/shared/bundle/ruby/2.0.0/gems/multi_json-1.7.9/lib/multi_json.rb:129:in `current_adapter'
 ** [out :: railserver] /path/to/rails/myapp/shared/bundle/ruby/2.0.0/gems/multi_json-1.7.9/lib/multi_json.rb:116:in `load'
 ** [out :: railserver] /path/to/rails/myapp/shared/bundle/ruby/2.0.0/gems/sprockets-2.10.0/lib/sprockets/manifest.rb:229:in `json_decode'
 ** [out :: railserver] /path/to/rails/myapp/shared/bundle/ruby/2.0.0/gems
 ** [out :: railserver] /sprockets-2.10.0/lib/sprockets/manifest.rb:65:in `initialize'
 ** [out :: railserver] /path/to/rails/myapp/shared/bundle/ruby/2.0.0/gems/sprockets-rails-2.0.0/lib/sprockets/railtie.rb:96:in `new'
 ** [out :: railserver] /path/to/rails/myapp/shared/bundle/ruby/2.0.0/gems/sprockets-rails-2.0.0/lib/sprockets/railtie.rb:96:in `block (2 levels) in <class:Railtie>'
 ** [out :: railserver] /path/to/rails/myapp/shared/bundle/ruby/2.0.0/gems/sprockets-rails-2.0.0/lib/sprockets/railtie.rb:78:in `instance_eval'
 ** [out :: railserver] /path/to/rails/myapp/shared/bundle/ruby/2.0.0/gems/sprockets-rails-2.0.0/lib/sprockets/railtie.rb:78:in `block in <class:Railtie>'
 ** [out :: railserver] /path/to/rails/myapp/shared/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/lazy_load_hooks.rb:36:in `call'
 ** [out :: railserver] /path/to/rails/myapp/shared/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
 ** [out :: railserver] /path/to/rails/myapp/shared/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/lazy_load_hooks.rb:45:in
 ** [out :: railserver] `block in run_load_hooks'
 ** [out :: railserver] /path/to/rails/myapp/shared/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/lazy_load_hooks.rb:44:in `each'
 ** [out :: railserver] /path/to/rails/myapp/shared/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
 ** [out :: railserver] /path/to/rails/myapp/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application/finisher.rb:62:in `block in <module:Finisher>'
 ** [out :: railserver] /path/to/rails/myapp/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `instance_exec'
 ** [out :: railserver] /path/to/rails/myapp/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `run'
 ** [out :: railserver] /path/to/rails/myapp/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:55:in `block in run_initializers'
 ** [out :: railserver] /path/to/rails/myapp/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:54:in `run_initializers'
 ** [out :: railserver] /path/to/rails/myapp/shared/bundle/ruby/
 ** [out :: railserver] 2.0.0/gems/railties-4.0.0/lib/rails/application.rb:215:in `initialize!'
 ** [out :: railserver] /path/to/rails/myapp/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
 ** [out :: railserver] /path/to/rails/myapp/releases/20130813221752/config/environment.rb:5:in `<top (required)>'
 ** [out :: railserver] /path/to/rails/myapp/shared/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
 ** [out :: railserver] /path/to/rails/myapp/shared/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `block in require'
 ** [out :: railserver] /path/to/rails/myapp/shared/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
 ** [out :: railserver] /path/to/rails/myapp/shared/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
 ** [out :: railserver] /path/to/rails/myapp/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:189:in `require_environment!'
 ** [out :: railserver] /Library/WebServ
 ** [out :: railserver] er/rails/myapp/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:249:in `block in run_tasks_blocks'
 ** [out :: railserver] /path/to/rails/myapp/shared/bundle/ruby/2.0.0/gems/sprockets-rails-2.0.0/lib/sprockets/rails/task.rb:54:in `block (2 levels) in define'
 ** [out :: railserver] Tasks: TOP => environment
 ** [out :: railserver] (See full trace by running task with --trace)
    command finished in 9278ms
failed: "rvm_path=/usr/local/rvm /usr/local/rvm/bin/rvm-shell 'ruby-2.0.0-p247@myapp' -c 'cd -- /path/to/rails/myapp/releases/20130813221752 && RAILS_ENV=production RAILS_GROUPS=assets bundle exec rake assets:precompile'" on railserver

回答1:


Are you specifying a suitable JSON gem in your Gemfile, such as?

gem 'yajl-ruby', :require => "yajl"

or

gem 'json'


来源:https://stackoverflow.com/questions/18220485/capistrano-deploy-did-not-recognize-your-adapter-specification-during-assets

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!