Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot load such file -- mysql2 #47

Open
heaven opened this issue Sep 21, 2017 · 2 comments
Open

cannot load such file -- mysql2 #47

heaven opened this issue Sep 21, 2017 · 2 comments

Comments

@heaven
Copy link

heaven commented Sep 21, 2017

The error is happening while using the deprecated database cookbook:

Recipe: wego_teamcity::mysql
  * mysql2_chef_gem[default] action install
    * mysql_client_installation_package[default] action create
      * apt_package[mysql-client-5.5, libmysqlclient-dev] action install (up to date)
       (up to date)
    * gem_package[mysql2] action install (up to date)
     (up to date)
  * mysql_database[teamcity] action create

    ================================================================================
    Error executing action `create` on resource 'mysql_database[teamcity]'
    ================================================================================

    LoadError
    ---------
    cannot load such file -- mysql2

    Cookbook Trace:
    ---------------
    /var/chef/cache/cookbooks/database/libraries/provider_database_mysql.rb:103:in `test_client'
    /var/chef/cache/cookbooks/database/libraries/provider_database_mysql.rb:37:in `block in <class:Mysql>'
    /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:78:in `run_action'
    /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `block (2 levels) in converge'
    /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `each'
    /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `block in converge'
    /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:105:in `converge'

Also using the RVM cookbook with gem_package option enabled.

@hauntingEcho
Copy link

hauntingEcho commented Oct 17, 2017

depricated database cookbook

I'd recommend migrating away from that, since it's depricated (and thus not maintained anymore). In the meantime, have you tried the solution here?

@heaven
Copy link
Author

heaven commented Oct 18, 2017

Migrate to what? :) I think the problem is that there are no alternatives.

This bug was related to the rvm cookbook, which makes chef_gem work like gem_package, so all gems installed with any of these resources installed to rvm's directory and Chef doesn't see them any longer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants