ld: library not found for -lzstd while bundle install for mysql2 gem Ruby on macOS Big Sur 11.4 Apple M1

Step 1: confirm you have both openssl and MySQL installed via brew brew install mysql brew install openssl or if you have previous version of openssl try brew reinstall openssl@3 Step 2: Run this on your Rails app to make sure you can get through bundler: gem install mysql2 -v ‘0.5.3’ — –with-opt-dir=$(brew –prefix openssl) … Read more

bundle install problem: mysql.h is missing

I tried all the solutions posted here, but was not lucky. I reinstalled mysql with homebrew a couple of times and still no luck. Then I came across a blog post with a solution. I edited the mysql_config file in /usr/local/Cellar/mysql/5.6.12/bin and removed the W-compiler options -Wno-null-conversion and -Wno-unused-private-field for cflags and cxxflags. This solved … Read more

Ruby MYSQL2 gem installation on windows 7

EDIT 30/09/2014 When this answer was posted the 64 bit rails installer wasn’t the recommended version – it now seems people are starting to use it more. It should be noted when you download the MySQL Connector you need to download either 64 or 32bit to correspond to the version of rails you installed. Amazingly … Read more

rails server fails to start with mysql2 using rvm & ruby 1.9.2-p0 on OSX 10.6.5

The problem comes from the mysql2 gem missing the dynamic library from MySQL. A cleaner solution than install_name_tool … would need to update your DYLD_LIBRARY_PATH to add MySQL libs to it. To do so, update your ~/.bash_profile to add the MySQL library folder : export DYLD_LIBRARY_PATH=”/usr/local/mysql/lib:$DYLD_LIBRARY_PATH” Note: You might want to update the MySQL location … Read more

Creating tables and problems with primary key in Rails

I had a same problem before, and I solved according to here https://github.com/rails/rails/pull/13247#issuecomment-32425844 With Rails 2.3.5, MySQL version 5.7.9 and mysql gem you need to have this bit as an initializer in config/initializers/abstract_mysql_adapter.rb: class ActiveRecord::ConnectionAdapters::MysqlAdapter NATIVE_DATABASE_TYPES[:primary_key] = “int(11) auto_increment PRIMARY KEY” end For mysql2, it should be config/initializers/abstract_mysql2_adapter.rb: class ActiveRecord::ConnectionAdapters::Mysql2Adapter NATIVE_DATABASE_TYPES[:primary_key] = “int(11) auto_increment PRIMARY … Read more

Mysql 5.6 headaches on Mac OSX

None of the answers here helped me, but finally I got MySQL 5.6 to work. THREE options to fix MySQL 5.6: (confirmed) Edit /etc/my.cnf (create if not exists) and add: [mysqld] innodb_file_per_table = OFF and restart MySQL. Then for this to work you’ll need to dump your databases into SQL file (mysqldump), then drop and … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)