简体   繁体   English

当我尝试 gem install bootsnap -v '1.7.2 时出现错误

[英]A error came when i try gem install bootsnap -v '1.7.2

An error occurred while installing bootsnap (1.7.2), and Bundler cannot continue.安装 bootsnap (1.7.2) 时出错,Bundler 无法继续。 Make sure that gem install bootsnap -v '1.7.2' --source 'https://rubygems.org/' succeeds before bundling.在捆绑之前确保gem install bootsnap -v '1.7.2' --source 'https://rubygems.org/'成功。

In Gemfile: bootsnap在 Gemfile 中:bootsnap

You can just run the line in the terminal in order to install the right bootsnap version.您可以在终端中运行该行以安装正确的 bootsnap 版本。

gem install bootsnap -v '1.7.2' --source 'https://rubygems.org/'

Or alternatively you can run bundle update bootsnap and then bundle install或者,您可以运行bundle update bootsnap然后bundle install

I had the same issue on my mac.我在我的 Mac 上遇到了同样的问题。

In the error message I saw next line xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun在错误消息中,我看到了下一行xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

It solves by running xcode-select --install它通过运行xcode-select --install来解决

First of all, check which bundler version you are using.首先,检查您使用的是哪个捆绑器版本。 Bundler version greater than 1 and ruby version greater than 2 is required.捆绑器版本大于 1 和 ruby 版本大于 2 是必需的。 And check for the rails version also, use the rails version greater than 5.并检查 rails 版本,使用大于 5 的 rails 版本。

You can check gem dependency on the below location您可以在以下位置检查 gem 依赖项

https://rubygems.org/gems/bootsnap/ https://rubygems.org/gems/bootsnap/

If all the above things are fine then you hadn't installed some of the system packages required to run ruby or ruby on rails.如果上述所有事情都很好,那么您还没有安装在轨道上运行 ruby 或 ruby 所需的一些系统包。 You can install some of them using the below commands.您可以使用以下命令安装其中一些。

sudo apt install autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm5 libgdbm-dev

sudo apt-get install git-core zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev software-properties-common libffi-dev nodejs yarn

If you can't resolve the problem, Let me know in the comments which ruby, rails, and bundler version you are using.如果您无法解决问题,请在评论中告诉我您使用的是哪个 ruby、rails 和 bundler 版本。

Try to run xcode-select --install尝试运行xcode-select --install

Then run gem install bootsnap -v '1.7.3' --source 'https://rubygems.org/'然后运行gem install bootsnap -v '1.7.3' --source 'https://rubygems.org/'

Or another version of bootsnap, depending of your needing或其他版本的 bootsnap,取决于您的需要

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM