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

mysql with ruby 2.7.5 - impossible installation #1233

Open
jwalkerbg opened this issue Dec 18, 2021 · 2 comments
Open

mysql with ruby 2.7.5 - impossible installation #1233

jwalkerbg opened this issue Dec 18, 2021 · 2 comments

Comments

@jwalkerbg
Copy link

Hi,
I tried with no success to to install mysql2 on ruby 2.7.5. Here is what happened:

C:\>gem install mysql2 -- '--with-mysql-lib="C:\Program%20Files\MySQL\MySQL%20Server%205.7\lib" --with-mysql-include="C:\Program%20Files\MySQL\MySQL%20Server%205.7\include" --with-mysql-dir="C:\Program%20Files\MySQL\MySQL%20Server%205.7"'

Fetching mysql2-0.5.3-x64-mingw32.gem

ERROR: Error installing mysql2:

    `The last version of mysql2 (>= 0) to support your Ruby & RubyGems was 0.5.3. Try installing it with `gem install mysql2 -v 0.5.3`
    mysql2 requires Ruby version >= 2.2, < 2.7.dev. The current ruby version is 2.7.5.203.

`

So is there any plans to release new version of mysql2 gem?

@sbocinec
Copy link

sbocinec commented Jan 6, 2022

Can you try suggestions in this issue #1151 (comment) ? The new version appears to be released in the near future.

@sjieg
Copy link

sjieg commented Feb 17, 2022

Now we need to point to a github branch, the gem install command won't work on windows anymore. Because you need bundler to do this.

# Gemfile
gem 'mysql2', github: 'brianmario/mysql2', ref: '8193dc4' # You can point to a branch, but I'd rather not be prone to dev changes

So now you have the options to the bundler config like so:

bundle config build.mysql2 "--platform=ruby -- --with-mysql-dir='C:/Program Files (x86)/MySQL/Connector C++ 8.0'"
bundle install

Notice how the build options are put in a string, this is required because else characters like = and / are escaped. (That was 2 hours down the drain until I figured that one out 🥇 )

At the comment @sbocinec pointed at, I have made detailed instructions on making sure you install Connector C++ 8.0 for x86.

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

3 participants