bundle install failing on JSON gem: Failing to build gem native extension, Windows 7
Seems like passing in the --version
flag to fix compilation is true bug, as evidenced here.
To mimic this behaviour in bundler we can use bundle config
:
You can use bundle config to give bundler the flags to pass to the gem installer every time bundler tries to install a particular gem.
...
After running this command, every time bundler needs to install the mysql gem, it will pass along the flags you specified.
Try running
bundle config build.json --versionbundle install
This should cause bundler to run gem install --verbose json
if you run gem install json --verbose -v '1.8.1'
you are going to see how the compiler is failing because it is not finding some C modules.
Seems to be that re-installing your current ruby
version (with these C
headers) might be a possible solution
checking your current ruby version
ruby -v
=> ruby 2.5.8p224 (2020-03-31 revision 67882) [x86_64-darwin19]
re-install ruby with C modules (with rbenv
)
CC=gcc rbenv install 2.5.8