An error occurred while installing racc (1.6.0), and Bundler cannot continue
Asked Answered
T

2

12

Getting the following error while running bundle

An error occurred while installing racc (1.6.0), and Bundler cannot continue.
Make sure that `gem install racc -v '1.6.0' --source 'https://rubygems.org/'` succeeds before bundling.
Teddy answered 17/12, 2021 at 21:1 Comment(1)
if you have this issue when you tried to creaate a rails proyect with this command rails new blog, my suggestion is choice other one of rails framework, choose a newer version from here rubygems.org/gems/rails/versions and try again pleaseJanise
L
24

I got the same error. I tried the following and the error's gone. Hopefully it can help you.

  1. Update ruby to the latest version 2.7.0p0 using:

    sudo apt-get install ruby-full build-essential
    
  2. Re-run bundle install

Leyva answered 18/12, 2021 at 0:9 Comment(0)
G
2

For me (MacOS Sonoma 14.0) the root issue ended up being this "Failed to build gem native extension" problem. The solution was:

xcode-select --install

Then click yes to download.

You might also want to check that you've agreed to the Xcode license.

Gauffer answered 12/10, 2023 at 0:12 Comment(2)
Thanks, it helped. If anyone else has a similar problem and wants to understand the issue deeper: the thing is, to compile a native Ruby extension it needs the C standard library (normally also available in your search path). It includes such headers as stdio.h, stdlib.h, etc. Installing Xcode CLI tools also installs the library into the search path for you so the native extensions can use the stdlib headers.Groove
Interesting. I didn't know the root issue, so thank you Dmytro. The C standard library would be a much smaller download than the Xcode CLI tools, which as I recall is several gigs in size. So presumably there's a more space-efficient way to solve this problem, if we cared to.Gauffer

© 2022 - 2024 — McMap. All rights reserved.