【发布时间】:2021-11-04 21:28:46
【问题描述】:
运行 bundle install 时安装 mysql 失败 我尝试安装使用 mysql2 作为数据库的 rails 项目,但尝试安装 mysql 时出现此错误
-----
Don't know how to set rpath on your system, if MySQL libraries are not in path mysql2 may not load
-----
-----
Setting libpath to /opt/homebrew/Cellar/mysql/8.0.26/lib
-----
creating Makefile
current directory: /Users/<username>/.rvm/gems/ruby-2.6.5/gems/mysql2-0.5.3/ext/mysql2
make "DESTDIR=" clean
current directory: /Users/<username>/.rvm/gems/ruby-2.6.5/gems/mysql2-0.5.3/ext/mysql2
make "DESTDIR="
compiling client.c
compiling infile.c
compiling mysql2_ext.c
compiling result.c
compiling statement.c
linking shared-object mysql2/mysql2.bundle
ld: warning: directory not found for option '-L/usr/local/opt/openssl/lib/'
ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [mysql2.bundle] Error 1
make failed, exit code 2
Gem files will remain installed in /Users/<username>/.rvm/gems/ruby-2.6.5/gems/mysql2-0.5.3 for
inspection.
Results logged to
/Users/<username>/.rvm/gems/ruby-2.6.5/extensions/-darwin-20/2.6.0/mysql2-0.5.3/gem_make.out
An error occurred while installing mysql2 (0.5.3), and Bundler cannot continue.
Make sure that `gem install mysql2 -v '0.5.3' --source 'https://rubygems.org/'` succeeds before
bundling.
In Gemfile:
mysql2
似乎“捆绑”尝试访问ld: warning: directory not found for option '-L/usr/local/opt/openssl/lib/'
openssl 路径开启时:opt/homebrew/opt/openssl@1.1/lib/
如何将'-L/usr/local/opt/openssl/lib/' 更改为opt/homebrew/opt/openssl@1.1/lib/
有人可以帮忙吗?
【问题讨论】:
标签: mysql ruby-on-rails ruby rubygems