Rails amp; MySQL on Apple Silicon(苹果硅片上的Railsamp;MySQL)
本文介绍了苹果硅片上的Rails&;MySQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有人能够通过Apple Silicon上的mysql2gem让Rails与MySQL一起运行?我正在使用Ruby 2.5.3和Rails 5.2.3,但是我希望听到任何版本的成功消息。当前我遇到mysql2gem安装失败的问题:
linking shared-object mysql2/mysql2.bundle
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
谢谢!
推荐答案
我仅在以下方面取得了成功:
rbenv exec gem install mysql2 --
--with-mysql-lib=/opt/homebrew/Cellar/mysql/8.0.25_1/lib
--with-mysql-dir=/opt/homebrew/Cellar/mysql/8.0.25_1
--with-mysql-config=/opt/homebrew/Cellar/mysql/8.0.25_1/bin/mysql_config
--with-mysql-include=/opt/homebrew/Cellar/mysql/8.0.25_1/include
(请注意,您可能需要更改这些路径中的版本号)
值得注意的是,这适用于最新版本的MySQL,不需要任何英特尔版本或使用自制软件的仿真版本(例如ibrew
)。
将bundler配置为自动使用此生成配置:
您可能还希望将此配置设置为mysql2
的默认配置。这样,无论何时Bundler必须重新安装mysql2
(在同一台计算机上的此项目或任何其他项目上),它都会自动使用此配置。您可以使用以下内容执行此操作:
bundle config set --global build.mysql2
--with-mysql-lib=/opt/homebrew/Cellar/mysql/8.0.25_1/lib
--with-mysql-dir=/opt/homebrew/Cellar/mysql/8.0.25_1
--with-mysql-config=/opt/homebrew/Cellar/mysql/8.0.25_1/bin/mysql_config
--with-mysql-include=/opt/homebrew/Cellar/mysql/8.0.25_1/include
这篇关于苹果硅片上的Rails&;MySQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
沃梦达教程
本文标题为:苹果硅片上的Rails&;MySQL


猜你喜欢
- 创建索引时,具有 mysql 数据库迁移的实体框架失败 2022-01-01
- SQL Server 将 Varchar 转换为日期时间 2021-01-01
- 如何将uuid存储为数字? 2021-01-01
- MySql 错误 150 - 外键 2021-01-01
- 如何在oracle中获取字符串最右边的10个位置 2021-01-01
- MySQL(Windows10)使用 MyISAM 表进行 FULLTEXT 搜索不起作用 2022-01-01
- SSMS 中的权限问题:“对象 'extended_properties'、数据库 'mssqlsystem_resource'、... 错误 229)上的 SELECT 权限被拒绝" 2022-01-01
- HEROKU - 无法运行 git push heroku master 2021-01-01
- Oracle SQL 转置 2022-01-01
- 在 Oracle 中创建 CTE 2022-01-01