An error occurred while installing mysql2 (0.5.3), and Bundler cannot continue.

本文介绍了解决在执行bundle install命令时遇到的mysql2 gem安装失败的问题。通过安装mysql-devel包成功解决了错误,使得bundle install能够顺利完成。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1.错误描述:

我在执行了bundle install之后报错:
Error:Fetching mysql2 0.5.3 Installing mysql2 0.5.3 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

2.解决:

  • 安装 mysql-devel
    sudo yum install mysql-devel
  • 再次执行bundle install
└─# cd /usr/share/beef-xss bundle install Don&#39;t run Bundler as root. Installing your bundle as root will break this application for all non-root users on this machine. Fetching gem metadata from https://rubygems.org/....... Resolving dependencies... Fetching ast 2.4.3 Fetching em-websocket 0.5.3 Installing ast 2.4.3 Installing em-websocket 0.5.3 Bundler::GemNotFound: Could not find domain_name-0.6.20240107.gem for installation /var/lib/gems/3.3.0/gems/bundler-2.6.6/lib/bundler/source/rubygems.rb:178:in `install&#39; /var/lib/gems/3.3.0/gems/bundler-2.6.6/lib/bundler/installer/gem_installer.rb:55:in `install&#39; /var/lib/gems/3.3.0/gems/bundler-2.6.6/lib/bundler/installer/gem_installer.rb:17:in `install_from_spec&#39; /var/lib/gems/3.3.0/gems/bundler-2.6.6/lib/bundler/installer/parallel_installer.rb:133:in `do_install&#39; /var/lib/gems/3.3.0/gems/bundler-2.6.6/lib/bundler/installer/parallel_installer.rb:124:in `block in worker_pool&#39; /var/lib/gems/3.3.0/gems/bundler-2.6.6/lib/bundler/worker.rb:62:in `apply_func&#39; /var/lib/gems/3.3.0/gems/bundler-2.6.6/lib/bundler/worker.rb:57:in `block in process_queue&#39; <internal:kernel>:187:in `loop&#39; /var/lib/gems/3.3.0/gems/bundler-2.6.6/lib/bundler/worker.rb:54:in `process_queue&#39; /var/lib/gems/3.3.0/gems/bundler-2.6.6/lib/bundler/worker.rb:90:in `block (2 levels) in create_threads&#39; An error occurred while installing domain_name (0.6.20240107), and Bundler cannot continue. In Gemfile: twitter was resolved to 8.1.0, which depends on http was resolved to 5.2.0, which depends on http-cookie was resolved to 1.0.8, which depends on domain_name Bundler::GemNotFound: Could not find erubis-2.7.0.gem for installation /var/lib/gems/3.3.0/gems/bundler-2.6.6/lib/bundler/source/rubygems.rb:178:in `install&#39; /var/lib/gems/3.3.0/gems/bundler-2.6.6/lib/bundler/installer/gem_installer.rb:55:in `install&#39; /var/lib/gems/3.3.0/gems/bundler-2.6.6/lib/bundler/installer/gem_installer.rb:17:in `install_from_spec&#39; /var/lib/gems/3.3.0/gems/bundler-2.6.6/lib/bundler/installer/parallel_installer.rb:133:in `do_install&#39; /var/lib/gems/3.3.0/gems/bundler-2.6.6/lib/bundler/installer/parallel_installer.rb:124:in `block in worker_pool&#39; /var/lib/gems/3.3.0/gems/bundler-2.6.6/lib/bundler/worker.rb:62:in `apply_func&#39; /var/lib/gems/3.3.0/gems/bundler-2.6.6/lib/bundler/worker.rb:57:in `block in process_queue&#39; <internal:kernel>:187:in `loop&#39; /var/lib/gems/3.3.0/gems/bundler-2.6.6/lib/bundler/worker.rb:54:in `process_queue&#39; /var/lib/gems/3.3.0/gems/bundler-2.6.6/lib/bundler/worker.rb:90:in `block (2 levels) in create_threads&#39; An error occurred while installing erubis (2.7.0), and Bundler cannot continue.
最新发布
03-21
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值