Skip to content

The specified module could not be found - mysql2.so #1403

@srijansaxena11

Description

@srijansaxena11

System:
OS: Windows 11
Ruby: 3.2.8 (x64-mingw-ucrt)
Rails: 5.2.8.1
mysql2 gem version: 0.5.6

Problem Description:
gem install and bundle install works fine with --with-mysql-dir parameters pointing to mysql c connector 6.1.11. I also used -with-cflags=-Who-error=incompatible-pointer-types to avoid some pointer errors.

Issue:
On trying to start the server with rails s, I am getting the following error:
C:/MyFiles/Ruby_new/ruby/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb:37:in 'require': 126: The specified module could not be found. - C:/MyFiles/LX/BMinor_new/vendor/bundle/ruby/3.2.0/gems/mysql2-0.5.6/lib/mysql2/mysql2.so (LoadError)

What have I tried so far:
Placing libmysql.dll in the ruby/bin folder as instructed everywhere which should have solved the problem but it hasn't.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions