ruby 如何为无意中设置的当前用户重置捆绑包配置构建?

0g0grzrc  于 2023-05-17  发布在  Ruby
关注(0)|答案(3)|浏览(167)

我遇到了bundle install的问题,特别是mysql2 gem。一些回答建议更改构建配置构建。所以,我执行了这个命令
bundle config build.mysql2 --use-system-libraries
我该怎么做?它没有解决我的问题,所以我想恢复它。bundle config显示:

build.mysql2
Set for your local app (/Users/{user}/workspace/{appname}/.bundle/config): "--with-ldflags=-L/usr/local/opt/openssl/lib --with-cppflags=-I/usr/local/opt/openssl/include"
Set for the current user (/Users/{user}/.bundle/config): "--use-system-libraries"

谢谢

xuo3flqw

xuo3flqw1#

我遇到了这个问题,现在当我尝试使用rails c或rails s时,我得到了这个错误:

xxx@Mac-mini xxx % rails c                                   
<internal:/Users/xxx/.rvm/rubies/ruby-3.2.2/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require': cannot load such file -- /Users/xxx/.rvm/gems/ruby-3.2.2/gems/mysql2-0.5.5/lib/mysql2/mysql2.bundle (LoadError)

我已经删除了.bundle文件夹,并尝试取消设置,什么都没有,错误仍然存在。

gev0vcfq

gev0vcfq2#

请参阅bundle配置输出中提到的.bundle/config文件。编辑这些设置以删除您不需要的设置,或者如果您根本不需要它们,则将其删除。

k97glaaz

k97glaaz3#

使用bundle config unset
执行bundle config unset <name>将删除本地和全局源中的配置。

您的示例:

bundle config unset build.mysql2 --global

相关问题