Bundle Install Json Error - json

My ruby environment is pretty much setup. I can retrieve my Gherkins syntax via command line and run simple ruby web tests. But I need some other gems to complete the environment. All I need to do is get bundle install working, but can't figure out why it's not installing. I've updated my gems as well. I'm using Ruby 2.2.3 on Windows 10. Below is my output after trying to run.
C:\GitHubFiles\MyAccountWeb-Tests>bundle install
Fetching gem metadata from http://rubygems.org/............
Resolving dependencies...
Using public_suffix 3.0.2
Using addressable 2.5.2
Using awesome_print 1.8.0
Installing json 2.1.0 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
C:/Ruby22-x64/bin/ruby.exe -r ./siteconf20180817-13500-1p562oy.rb extconf.rb creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
make failed, uncaught signal 11
Gem files will remain installed in
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/json-2.1.0 for inspection.
Results logged to
C:/Ruby22-x64/lib/ruby/gems/2.2.0/extensions/x64-mingw32/2.2.0/json-2.1.0/gem_make.out
An error occurred while installing json (2.1.0), and Bundler cannot
continue.
Make sure that `gem install json -v '2.1.0' --source 'http://rubygems.org/'`
succeeds before bundling.
In Gemfile:
appium_lib was resolved to 9.7.1, which depends on
json
My source is already set to 'http://rubygems.org/'. I ran 'gem sources -r https://rubygems.org -a http://rubygems.org' to confirm this. My output after trying to run 'gem install json -v '2.1.0' is below.
C:\GitHubFiles\MyAccountWeb-Tests>gem install json -v '2.1.0'
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing json:
ERROR: Failed to build gem native extension.
current directory: C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/json-2.1.0/ext/json/ext/generator
C:/Ruby22-x64/bin/ruby.exe -r ./siteconf20180817-15312-13stnps.rb extconf.rb
creating Makefile
current directory: C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/json-2.1.0/ext/json/ext/generator
make "DESTDIR=" clean
current directory: C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/json-2.1.0/ext/json/ext/generator
make "DESTDIR="
make failed, uncaught signal 11
Gem files will remain installed in C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/json-2.1.0 for inspection.
Results logged to C:/Ruby22-x64/lib/ruby/gems/2.2.0/extensions/x64-mingw32/2.2.0/json-2.1.0/gem_make.out
gem_make text file
current directory: C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/json-2.1.0/ext/json/ext/generator
C:/Ruby22-x64/bin/ruby.exe -r ./siteconf20180817-10044-ypvx4a.rb extconf.rb
creating Makefile
current directory: C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/json-2.1.0/ext/json/ext/generator
make "DESTDIR=" clean
current directory: C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/json-2.1.0/ext/json/ext/generator
make "DESTDIR="
make failed, uncaught signal 11
According to this link, I should try rake install. https://www.rubydoc.info/gems/json/2.1.0. But it just says rake aborted. No rake file found.
I also tried 'gem install bundler -v '= 1.5.1'' followed by 'bundle package', which created the same json error.
I've tried bundle update and bundle update json.
I read that there was a problem with json version 1.8.1 and ruby 2.2.3, so install json 1.8.3 version, so I tried gem install json -v1.8.3. Same json error.
I tried deleting my gemfile and running bundle update again, which replaced the gemfile and created the bundle install error again :(
I am stuck!

Related

Cannot install Jekyll on Manjaro

On a fresh Manjaro install, after having installed the Ruby with
pacman -S ruby
I tried to install Jekyll running
gem install bundler jekyll
The bundler has been installed successfully, but the Jekyll installation gave me this error:
ERROR: Error installing jekyll:
ERROR: Failed to build gem native extension.
current directory: /home/jgabrielgruber/.local/share/gem/ruby/3.0.0/gems/ffi-1.15.5/ext/ffi_c
/usr/bin/ruby -I /usr/lib/ruby/3.0.0 -r ./siteconf20220428-5815-4q66ic.rb extconf.rb
checking for ffi.h... yes
checking for ffi_prep_closure_loc() in -lffi... yes
checking for ffi_prep_cif_var()... yes
checking for ffi_raw_call()... yes
checking for ffi_prep_raw_closure()... yes
checking for whether -pthread is accepted as LDFLAGS... yes
creating extconf.h
creating Makefile
current directory: /home/jgabrielgruber/.local/share/gem/ruby/3.0.0/gems/ffi-1.15.5/ext/ffi_c
make DESTDIR\= clean
current directory: /home/jgabrielgruber/.local/share/gem/ruby/3.0.0/gems/ffi-1.15.5/ext/ffi_c
make DESTDIR\=
make failedNo such file or directory - make
Turns out, on the
make failedNo such file or directory - make
It says that the make command is not installed on Manjaro, to solve this, you need to install it with:
pacman -S make

Fail to install mysql2 on bundle install ruby

fail install mysql when run bundle install
i try to install rails project that use mysql2 as database, but i got this error when try to install mysql
-----
Don't know how to set rpath on your system, if MySQL libraries are not in path mysql2 may not load
-----
-----
Setting libpath to /opt/homebrew/Cellar/mysql/8.0.26/lib
-----
creating Makefile
current directory: /Users/<username>/.rvm/gems/ruby-2.6.5/gems/mysql2-0.5.3/ext/mysql2
make "DESTDIR=" clean
current directory: /Users/<username>/.rvm/gems/ruby-2.6.5/gems/mysql2-0.5.3/ext/mysql2
make "DESTDIR="
compiling client.c
compiling infile.c
compiling mysql2_ext.c
compiling result.c
compiling statement.c
linking shared-object mysql2/mysql2.bundle
ld: warning: directory not found for option '-L/usr/local/opt/openssl/lib/'
ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [mysql2.bundle] Error 1
make failed, exit code 2
Gem files will remain installed in /Users/<username>/.rvm/gems/ruby-2.6.5/gems/mysql2-0.5.3 for
inspection.
Results logged to
/Users/<username>/.rvm/gems/ruby-2.6.5/extensions/-darwin-20/2.6.0/mysql2-0.5.3/gem_make.out
An error occurred while installing mysql2 (0.5.3), and Bundler cannot continue.
Make sure that `gem install mysql2 -v '0.5.3' --source 'https://rubygems.org/'` succeeds before
bundling.
In Gemfile:
mysql2
seems like 'bundle' try to access ld: warning: directory not found for option '-L/usr/local/opt/openssl/lib/'
meanwhil openssl path is on : opt/homebrew/opt/openssl#1.1/lib/
how to change '-L/usr/local/opt/openssl/lib/' to opt/homebrew/opt/openssl#1.1/lib/
someone can help ?
Please install the following Linux packages if you're using Linux:
sudo apt update
sudo apt install git curl libssl-dev libreadline-dev zlib1g-dev autoconf bison build-essential libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev
many RubyGems required native libraries from them.
and run bundle install again.
The same thing happens to me in Rails 6.1.4.1 (Ruby 3.0.1p64).
I have tried to executed brew info openssl, then follow display some guide.
echo 'export PATH="/usr/local/opt/openssl#1.1/bin:$PATH"' >> /Users/user/.bash_profile
$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.14.4

how to run bundle install on ubuntu 16.04 LTS

I have a problems to run the bundle install on my PC. The return is:
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /tmp/bundler20170309-28068-jc2jotsqlite3-1.3.13/gems/sqlite3-1.3.13/ext/sqlite3
/usr/bin/ruby2.3 -r ./siteconf20170309-28068-19m0tjz.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h
extconf failed, exit code 1
Gem files will remain installed in /tmp/bundler20170309-28068-jc2jotsqlite3-1.3.13/gems/sqlite3-1.3.13 for inspection.
Results logged to /tmp/bundler20170309-28068-jc2jotsqlite3-1.3.13/extensions/x86_64-linux/2.3.0/sqlite3-1.3.13/gem_make.out
Using turbolinks-source 5.0.0
An error occurred while installing json (1.8.6), and Bundler cannot continue.
Make sure that gem install json -v '1.8.6' succeeds before bundling.
I try run gem install json -v '1.8.6' but it did not work.
Can someone help me?
Sorry my english.

Failed to install mysql2 gem on Ubuntu 14

I'm running Ubuntu 14 and when I try to run rails server but I get this error:
Could not find gem 'mysql2 (>= 0) ruby' in the gems available on this machine.
Run bundle install to install missing gems.
So I run the bundle install and then I get the following error.
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/usr/bin/ruby2.1 extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h
extconf failed, exit code 1
Gem files will remain installed in /var/lib/gems/2.1.0/gems/mysql2-0.3.16 for inspection.
Results logged to /var/lib/gems/2.1.0/extensions/x86_64-linux/2.1.0/mysql2-0.3.16/gem_make.out
An error occurred while installing mysql2 (0.3.16), and Bundler cannot continue.
Make sure that `gem install mysql2 -v '0.3.16'` succeeds before bundling.
So I run gem install mysql2 -v '0.3.16' and it installs successfully however when I run bundle install again it gives me the same error:
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/usr/bin/ruby2.1 extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h
extconf failed, exit code 1
Gem files will remain installed in /var/lib/gems/2.1.0/gems/mysql2-0.3.16 for inspection.
Results logged to /var/lib/gems/2.1.0/extensions/x86_64-linux/2.1.0/mysql2-0.3.16/gem_make.out
An error occurred while installing mysql2 (0.3.16), and Bundler cannot continue.
Make sure that `gem install mysql2 -v '0.3.16'` succeeds before bundling.
Start again from scratch and this time you should install RVM as it is really good at handling all this stuff for you.
http://rvm.io/rvm/install
Make sure you get all the dependencies first, this code will check to see what you have and don't have:
for name in {bash,awk,sed,grep,ls,cp,tar,curl,gunzip,bunzip2,git,svn} ; do which $name ; done
Its also worth looking at the prerequisites page: http://rvm.io/rvm/prerequisites
You can run the below code to install rvm with Ruby 2.1.1 and Rails:
\curl -sSL https://get.rvm.io | bash -s stable --rails
Then To start using RVM:
/bin/bash --login
Its definitely worth using RVM it will make your life much easier when managing your ruby versions, gems etc, just make sure you read through the webpage so that you know how to use it.

An error occurred while installing json (1.8.1), and Bundler cannot continue

I am trying to upgrade the redmine. In order to create the session variable, after following several steps I have to run the bundle install to make sure all the gems are instaalled
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension
C:/PROGRA~1/BITNAM~1/ruby/bin/ruby.exe extconf.rb
creating Makefile
make
gcc -I. -I/C/PROGRA~1/BITNAM~1/ruby/lib/ruby/1.8/i386-mingw32 -I/C/PROGRA~1/BITN
AM~1/ruby/lib/ruby/1.8/i386-mingw32 -I. -DJSON_GENERATOR -g -O3 -DFD_SETSIZE=
256 -Wall -O0 -ggdb -c generator.c
/bin/sh: /usr/mingw/bin/gcc: Bad file number
make: *** [generator.o] Error 126
enter code here
Gem files will remain installed in C:/PROGRA~1/BITNAM~1/ruby/lib/ruby/gems/1.8/g
ems/json-1.8.1 for inspection.
Results logged to C:/PROGRA~1/BITNAM~1/ruby/lib/ruby/gems/1.8/gems/json-1.8.1/ex
t/json/ext/generator/gem_make.out
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 am not able run the command bundle install in ruby
bundle update json
Did not work for me,
Instead i did run following command.
bundle update
and then
bundle install
I am running a Kali, was trying to install SNORBY after successful installation of SNORT, PULLED PORK and BARNYARD2.
Above solution fixed the problem
Try locking JSON gem to 1.8.0 in your gemfile and doing an update
gem 'json', '1.8.0'
then run
bundle update json