-
Notifications
You must be signed in to change notification settings - Fork 550
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
Error when starting rails server #717
Comments
You may need mysql2 0.3.17 or higher for compatibility with MySQL 5.7. |
@sodabrew Worked with lower version of mysql 5.6, 5.5 |
@lalithr95, how did you fix the issue? |
I have the same issue. Error on 'rails s' is
MySQL v5.6.23 |
@PeterBloom Try just loading mysql2 within your gem set to see if there's a more detailed message. Something like |
@PeterBloom try this as well brew uninstall mysql Now install mysql5.6 version using brew brew tap homebrew/versions Then install mysql56 or something similar formula brew install mysql56 |
Thanks @sodabrew and @lalithr95, My setup is a bit complex. In my local environment, I use a Docker server running MySQL 5.6.27. (This is to emulate part of a production db architecture.) My origin/master repo Gemfile.lock (shared by coworkers) calls for mysql2 gem v0.3.15. When running 'rails s' with this gem version, I received the error "uninitialized constant Mysql2::Client::SECURE_CONNECTION (NameError)". I am using ruby 2.1.5, rails 3.2.21, bundler 1.10.6 in this environment. After some research and a few tries, I was able to get a good rails server start with the mysql2 v0.3.18 gem. I had to change my local branch Gemfile.lock to call for this version. Newer versions of mysql2 gem (such as v0.4.2) failed (I think they may only support MySQL >=5.7). I'd like to upgrade the versioned Gemfile.lock to v0.3.18, but don't want to create problems for others, or the production environment. Please let me know if you have any comments on this issue or have experienced something similar. Thanks! |
In order to use mysql2 0.4.x, you need Rails 4.2.5 or higher. It otherwise works with all versions of MySQL >= 5.0. If you use the MySQL 5.7 client libraries, then you need mysql2 0.3.17 or higher. You mention that you're using MySQL 5.6.27, but I suspect you may have a different client library or newer headers in your docker image. |
@PeterBloom Have a look at this issue #603 for Mysql2::Client::SECURE_CONNECTION error. |
There was an issue in
|
There was a problem when I start the server
'rails s' throws me with following error
bundle install works
Mysql 5.7.10 installed through brew
Rails 4.1.7
mysql2 gem 0.3.16
The text was updated successfully, but these errors were encountered: