Every chef commands gets error (Mac OS X)

It looks like following:

$chef-client --version
/opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:774:in `block in activate_dependencies': can't satisfy 'mime-types (~> 1.16)', already activated 'mime-types-2.0' (Gem::LoadError)
    from /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:766:in `each'
    from /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:766:in `activate_dependencies'
    from /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:750:in `activate'
    from /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems.rb:1232:in `gem'
    from /opt/chef/embedded/bin/chef-client:22:in `'

It is mean that I should reinstall ruby?or updated it? What kinds of commands should be used?

  • My attempts to install json using “gem install json” don't seem to be working
  • Cannot install gem with Chef for an RVM gemset
  • Error executing action `install` on resource 'chef_gem' – installing ruby gem through Chef Solo
  • referencing an attribute in a windows path string
  • Kitchen test not running
  • RHEL7 gem install fails due to already installed zlib
  • rails union hack, how to pull two different queries together
  • SQLite3::SQLException: duplicate column name while migrating
  • Messages between Users
  • What is the correct protocol/etiquette for forking a Ruby/Rails gem on Github that may be maintained as an ongoing, parallel fork?
  • How to mock class method in RSpec expect syntax?
  • ruby gem install pg with ruby 1.8.7 on CentOS 6.5
  • One Solution collect form web for “Every chef commands gets error (Mac OS X)”

    I guess you installed Chef through rubygems. It requires mime-types ~> 1.16, but you have 2.0 installed. You should uninstall it and install the right version.

    gem uninstall mime-types
    gem install mime-types -v 1.16
    Ruby is the best programming language in the world - Ruby on Rails.