Ruby - "bundle install" json gem error - ruby-on-rails

I am working on Windows 10. I successfully installed Ruby, MSYS2 and DevKit, but after trying to run the following command:
bundle install
it throws me an error
An error occurred while installing json (1.8.1), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.1'` succeeds before bundling.
I tried the solution with
gem install json -v '1.8.1'
but it still doesn't work for me.
Does anybody knows how i can fix the error?

Related

Why does 'bundle install' fail and force me to 'gem install' myself?

I have executed the command
bundle install
In my Ruby on Rails projects, and I get the following error message
An error occurred while installing bcrypt (3.1.10), and Bundler cannot continue.
Make sure that `gem install bcrypt -v '3.1.10'` succeeds before bundling.
After executing
gem install bcrypt -v '3.1.10'
the problem disappears. My question is why it's necessary sometimes to install some gems in a direct way?

RubyOnRails- How to bundle?

I am trying to install all dependencies via following command:
bundle install
It gave me following error:
An error occurred while installing libv8 <3.16.14.13>, and bundle cannot continue.
Make sure that 'gem install libv8 -v '3.16.14.13' ' succeeds before bundling.
Then from this link:
Error installing libv8: ERROR: Failed to build gem native extension
I found this solution:
gem install libv8 -v '3.16.14.13' -- --with-system-v8
It then installed the libv8
Then again I ran the command:
bundle install
Now its giving me following error:
An error occurred while installing therubyracer <0.12.2>, and bundler cannot continue.
Make sure that 'gem install therubyracer -v '0.12.2' ' succeeds before bundling.
I tried deleting therubyracer from gem file and then run the command but i am getting the same error.
Please guide me.
Thanx
I see that you are using Windows 7 , then prepare yourself:
Unfortunately, there's no know way of installing that gem on Windows:
Linked question: therubyracer not installing on Windows
This is one of many things that made me change to Linux.
EDIT
There is a workaround but its from 4 years ago so , I hope this will work:
https://github.com/eakmotion/therubyracer_for_windows
EDIT 2 - About middleman
Did you install the DevKit for RubyInstaller?.
Here you have the documentation of the gem with the installation steps:
https://github.com/middleman/middleman
EDIT 3
Check this one. There are others with the same issue (of course) and they managed to "solved" it using it:
https://github.com/jawwadzafar/middleman-boilerplate

Installing Bundle for Ruby

I am trying to install bundle and I keep on getting errors about specific gems not being installed. For example, my byebug debugger was not installed I had to install that, and my eventmachine was not installed, and now my json is not installed I install json and when I run
#bundle install
I still get the:
An error occurred while installing json (1..7.7), and Bundler cannot continue.
Make sure that 'gem install json -v '1.7.7' succeeds before bundling
How can I successfully install bundle?
edit: gem install json -v '1.7.7' I get the following error:
new error message

Error on bundle install

I am trying to run my Ruby application.
I am running the bundle install command, however get the error-
An error occurred while installing libv8 (3.1.16.14.3), and Bundler cannot continue.
Make sure that 'gem install libv8 -v '3.1.16.14.3' succeeds before bundling.
So then I tried-
gem install --version '=3.16.14.3' libv8
and get the error-
Error installing libv8:
ERROR: Failed to build gem native extension.
This is required to run the application however I am not sure how to resolve this?
RUBYOPT=-rrubygems gem install libv8 -v '3.16.14.3'

bundle cannot build gem native extension while gem can - json

I know, yet another question of the kind, but nothing helped so far.
When I run bundle install on the production server I get the following error:
...
Installing json (1.6.3) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
Gem files will remain installed in /home/onblimp/onblimp/releases/20111213131738/RAILS_ENV=production/ruby/1.9.1/gems/json-1.6.3 for inspection.
Results logged to /home/onblimp/onblimp/releases/20111213131738/RAILS_ENV=production/ruby/1.9.1/gems/json-1.6.3/ext/json/ext/parser/gem_make.out
An error occured while installing json (1.6.3), and Bundler cannot continue.
Make sure that `gem install json -v '1.6.3'` succeeds before bundling.
When I run gem install json -v '1.6.3' it installs without error. I'm running both commands as a root. In development it works well. A few days ago it also worked well.
Any help is appreciated.
I've managed to solve this issue by simply restarting the server. It would be great to know the cause, but I guess that's too much to ask.
hey i got the same error .I installed xcode and restart my mac.Then i made new project in rails and got into this
**Errno::EPERM: Operation not permitted
An error occured while installing json (1.6.3), and Bundler cannot continue.
Make sure that `gem install json -v '1.6.3'` succeeds before bundling**
i just did sudo gem install json -v '1.6.3' it worked fine in my case.

Resources