Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Comments on What does this failure involving mysql on Mac mean?

Post

What does this failure involving mysql on Mac mean? Question

+3
−0

I had to reinstall mysql on my Mac, and after some thrashing I was able to again connect to my Qpixel database from the command line. The data is as expected, so it appears that mysql itself is ok. Specifically, this worked (connection command and data validation):

$ mysql -u root -p qpixel_dev

mysql> select count(id) from users;
+-----------+
| count(id) |
+-----------+
|         9 |
+-----------+
1 row in set (0.00 sec)

When I run the Qpixel server I get this error:

$ rails s
/Users/cellio/.rvm/gems/ruby-3.0.6/gems/mysql2-0.5.4/lib/mysql2.rb:36:in `require': dlopen(/Users/cellio/.rvm/gems/ruby-3.0.6/gems/mysql2-0.5.4/lib/mysql2/mysql2.bundle, 0x0009): Library not loaded: /opt/homebrew/opt/mysql/lib/libmysqlclient.21.dylib (LoadError)

And the rest of the stack trace in case it's helpful:

  Referenced from: <C48E75F7-C7A1-3D51-A669-683DF84DA6AE> /Users/cellio/.rvm/gems/ruby-3.0.6/gems/mysql2-0.5.4/lib/mysql2/mysql2.bundle
  Reason: tried: '/opt/homebrew/opt/mysql/lib/libmysqlclient.21.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/opt/mysql/lib/libmysqlclient.21.dylib' (no such file), '/opt/homebrew/opt/mysql/lib/libmysqlclient.21.dylib' (no such file), '/usr/local/lib/libmysqlclient.21.dylib' (no such file), '/usr/lib/libmysqlclient.21.dylib' (no such file, not in dyld cache), '/opt/homebrew/Cellar/mysql/9.0.1/lib/libmysqlclient.21.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/Cellar/mysql/9.0.1/lib/libmysqlclient.21.dylib' (no such file), '/opt/homebrew/Cellar/mysql/9.0.1/lib/libmysqlclient.21.dylib' (no such file), '/usr/local/lib/libmysqlclient.21.dylib' (no such file), '/usr/lib/libmysqlclient.21.dylib' (no such file, not in dyld cache) - /Users/cellio/.rvm/gems/ruby-3.0.6/gems/mysql2-0.5.4/lib/mysql2/mysql2.bundle
	from /Users/cellio/.rvm/gems/ruby-3.0.6/gems/mysql2-0.5.4/lib/mysql2.rb:36:in `<top (required)>'
	from /Users/cellio/.rvm/gems/ruby-3.0.6/gems/bundler-2.4.13/lib/bundler/runtime.rb:60:in `require'
	from /Users/cellio/.rvm/gems/ruby-3.0.6/gems/bundler-2.4.13/lib/bundler/runtime.rb:60:in `block (2 levels) in require'
	from /Users/cellio/.rvm/gems/ruby-3.0.6/gems/bundler-2.4.13/lib/bundler/runtime.rb:55:in `each'
	from /Users/cellio/.rvm/gems/ruby-3.0.6/gems/bundler-2.4.13/lib/bundler/runtime.rb:55:in `block in require'
	from /Users/cellio/.rvm/gems/ruby-3.0.6/gems/bundler-2.4.13/lib/bundler/runtime.rb:44:in `each'
	from /Users/cellio/.rvm/gems/ruby-3.0.6/gems/bundler-2.4.13/lib/bundler/runtime.rb:44:in `require'
	from /Users/cellio/.rvm/gems/ruby-3.0.6/gems/bundler-2.4.13/lib/bundler.rb:187:in `require'
	from /Users/cellio/Data/codidact/qpixel/config/application.rb:7:in `<top (required)>'
	from /Users/cellio/.rvm/gems/ruby-3.0.6/gems/railties-7.0.8.4/lib/rails/commands/server/server_command.rb:137:in `require'
	from /Users/cellio/.rvm/gems/ruby-3.0.6/gems/railties-7.0.8.4/lib/rails/commands/server/server_command.rb:137:in `block in perform'
	from <internal:kernel>:90:in `tap'
	from /Users/cellio/.rvm/gems/ruby-3.0.6/gems/railties-7.0.8.4/lib/rails/commands/server/server_command.rb:134:in `perform'
	from /Users/cellio/.rvm/gems/ruby-3.0.6/gems/thor-1.3.1/lib/thor/command.rb:28:in `run'
	from /Users/cellio/.rvm/gems/ruby-3.0.6/gems/thor-1.3.1/lib/thor/invocation.rb:127:in `invoke_command'
	from /Users/cellio/.rvm/gems/ruby-3.0.6/gems/thor-1.3.1/lib/thor.rb:527:in `dispatch'
	from /Users/cellio/.rvm/gems/ruby-3.0.6/gems/railties-7.0.8.4/lib/rails/command/base.rb:87:in `perform'
	from /Users/cellio/.rvm/gems/ruby-3.0.6/gems/railties-7.0.8.4/lib/rails/command.rb:48:in `invoke'
	from /Users/cellio/.rvm/gems/ruby-3.0.6/gems/railties-7.0.8.4/lib/rails/commands.rb:18:in `<top (required)>'
	from /Users/cellio/Data/codidact/qpixel/bin/rails:9:in `require'
	from /Users/cellio/Data/codidact/qpixel/bin/rails:9:in `<top (required)>'
	from /Users/cellio/.rvm/gems/ruby-3.0.6/gems/spring-4.0.0/lib/spring/client/rails.rb:30:in `load'
	from /Users/cellio/.rvm/gems/ruby-3.0.6/gems/spring-4.0.0/lib/spring/client/rails.rb:30:in `call'
	from /Users/cellio/.rvm/gems/ruby-3.0.6/gems/spring-4.0.0/lib/spring/client/command.rb:7:in `call'
	from /Users/cellio/.rvm/gems/ruby-3.0.6/gems/spring-4.0.0/lib/spring/client.rb:30:in `run'
	from /Users/cellio/.rvm/gems/ruby-3.0.6/gems/spring-4.0.0/bin/spring:49:in `<top (required)>'
	from /Users/cellio/.rvm/gems/ruby-3.0.6/gems/spring-4.0.0/lib/spring/binstub.rb:11:in `load'
	from /Users/cellio/.rvm/gems/ruby-3.0.6/gems/spring-4.0.0/lib/spring/binstub.rb:11:in `<top (required)>'
	from /Users/cellio/Data/codidact/qpixel/bin/spring:12:in `require'
	from /Users/cellio/Data/codidact/qpixel/bin/spring:12:in `block in <top (required)>'
	from <internal:kernel>:90:in `tap'
	from /Users/cellio/Data/codidact/qpixel/bin/spring:9:in `<top (required)>'
	from bin/rails:3:in `load'
	from bin/rails:3:in `<main>'

I tried reverting Gemfile to the version before a recent Dependabot update, just in case, and that didn't make a difference. Rails seems to be complaining about a gem named mysql2-0.5.4, which has been in Gemfile for more than a year.

I haven't changed Ruby version since the last code change that required it (a long time ago). rvm does not seem to know about a newer version (for the Mac) than 3.0.6, what I'm using.

I'm stumped. How do I diagnose this and fix or work around it? This is for my development environment, not a production system. I've had to locally edit Gemfile before, so local overrides are ok if needed. But I don't know where I need to poke at what.

History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.
Why should this post be closed?

1 comment thread

Method of accessing from the terminal (3 comments)
Method of accessing from the terminal
trichoplax‭ wrote 3 months ago

I was able to again connect to my Qpixel database from the command line

To narrow things down, could you show the command you used for this?

Monica Cellio‭ wrote 3 months ago

Added, thanks. (Also, thanks for reminding me that text is a valid option for code fences. I tried bash but that didn't change the highlighting that was showing up in the output.)

trichoplax‭ wrote 3 months ago

You're welcome. I think text is actually invalid, but the response to an invalid language choice is to apply no syntax highlighting, which is what I want.

I did also try bash first, and it changed a few subtle things but still had so much inconsistency that I thought plain text would be easier to read. I think bash can work for commands when there is no output, but output is arbitrary text and not valid bash syntax, so breaks the syntax highlighting.

Skipping 1 deleted comment.