Home > OS >  cannot load such file -- mysql2/mysql2
cannot load such file -- mysql2/mysql2

Time:04-26

I am doing the installation on m1 mac and I am stuck mysql issue.

my rails server is working fine but when I run my spec then I got cannot load such file -- mysql2/mysql2 error

can someone help me here?

rspec spec/

An error occurred while loading rails_helper.
Failure/Error: require File.expand_path('../../config/environment', __FILE__)

LoadError:
  cannot load such file -- mysql2/mysql2
# ./config/application.rb:7:in `<top (required)>'
# ./config/environment.rb:2:in `require_relative'
# ./config/environment.rb:2:in `<top (required)>'
# ./spec/rails_helper.rb:4:in `<top (required)>'
No examples found.


Finished in 0.00003 seconds (files took 5.21 seconds to load)
0 examples, 0 failures, 1 error occurred outside of examples

CodePudding user response:

I deleted my tmp/ folder and it's worked for me.

  • Related