Unable to install cucumber gem - ruby

I'm trying to setup ruby/cucumber tool on my windows 7 PC, I've installed Ruby 2.1.5 and devkit and got installed all the gems except Cucumber.
I'm getting the following error while install cucumber gem.Please help me on this.
ERROR:
Following gems were not installed:
cucumber (2.0.0.rc.4): Error installing cucumber:
ERROR: Failed to build gem native extension. C:/Ruby22-x64/bin/ruby.exe -r ./siteconf20150308-6692-1kwvlbm.rb extconf.rb checking for main() in -lc... * extconf.rb failed * Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. Temporarily enhancing PATH to include DevKit... Provided configuration options: Building native extensions. This could take a while... --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=C:/Ruby22-x64/bin/$(RUBY_BASE_NAME) --with-gherkin_lexer_ar-dir --without-gherkin_lexer_ar-dir --with-gherkin_lexer_ar-include --without-gherkin_lexer_ar-include=${gherkin_lexer_ar-dir}/include --with-gherkin_lexer_ar-lib --without-gherkin_lexer_ar-lib=${gherkin_lexer_ar-dir}/lib --with-clib --without-clib C:/Ruby22-x64/lib/ruby/2.2.0/mkmf.rb:456:in try_do': The compiler failed to generate an executable file. (RuntimeError) You have to install development tools first. from C:/Ruby22-x64/lib/ruby/2.2.0/mkmf.rb:541:intry_link0' from C:/Ruby22-x64/lib/ruby/2.2.0/mkmf.rb:556:in try_link' from C:/Ruby22-x64/lib/ruby/2.2.0/mkmf.rb:735:intry_func' from C:/Ruby22-x64/lib/ruby/2.2.0/mkmf.rb:966:in block in have_library' from C:/Ruby22-x64/lib/ruby/2.2.0/mkmf.rb:911:inblock in checking_for' from C:/Ruby22-x64/lib/ruby/2.2.0/mkmf.rb:351:in block (2 levels) in postpone' from C:/Ruby22-x64/lib/ruby/2.2.0/mkmf.rb:321:inopen' from C:/Ruby22-x64/lib/ruby/2.2.0/mkmf.rb:351:in block in postpone' from C:/Ruby22-x64/lib/ruby/2.2.0/mkmf.rb:321:inopen' from C:/Ruby22-x64/lib/ruby/2.2.0/mkmf.rb:347:in postpone' from C:/Ruby22-x64/lib/ruby/2.2.0/mkmf.rb:910:inchecking_for' from C:/Ruby22-x64/lib/ruby/2.2.0/mkmf.rb:961:in have_library' from extconf.rb:5:in' extconf failed, exit code 1 Gem files will remain installed in C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/gherkin-2.12.2 for inspection. Results logged to C:/Ruby22-x64/lib/ruby/gems/2.2.0/extensions/x64-mingw32/2.2.0/gherkin-2.12.2/gem_make.out

Are you able to try using the current HEAD?
You can specify gem 'cucumber', github: 'cucumber/cucumber' in a Gemfile and try bundle installl

Related

Ruby Shopify CLI installation - missing libraries - error

I am fairly new to Ruby and getting an error in the command line when attempting to use it to install Shopify CLI gem install shopify-cli.
I verified that I have ruby installed by running ruby -v
Here is the error:
C:\Users\mso87>gem install shopify-cli
Fetching rb-fsevent-0.11.0.gem
Fetching rb-inotify-0.10.1.gem
Fetching ffi-1.15.3-x64-mingw32.gem
Fetching listen-3.6.0.gem
Fetching liquid-5.0.1.gem
Fetching nokogiri-1.12.3-x64-mingw32.gem
Fetching nokogumbo-2.0.5.gem
Fetching theme-check-1.2.0.gem
Fetching shopify-cli-2.2.2.gem
Successfully installed rb-fsevent-0.11.0
Successfully installed ffi-1.15.3-x64-mingw32
Successfully installed rb-inotify-0.10.1
Successfully installed listen-3.6.0
Successfully installed liquid-5.0.1
Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions. This could take a while...
ERROR: Error installing shopify-cli:
ERROR: Failed to build gem native extension.
current directory: C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/racc-1.5.2/ext/racc/cparse
C:/Ruby26-x64/bin/ruby.exe -I C:/Ruby26-x64/lib/ruby/2.6.0 -r ./siteconf20210816-16376-5tlz85.rb extconf.rb
checking for rb_ary_subseq()... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/Ruby26-x64/bin/$(RUBY_BASE_NAME)
C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:467:in try_do': The compiler failed to generate an executable file. (RuntimeError) You have to install development tools first. from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:552:in try_link0'
from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:570:in try_link' from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:782:in try_func'
from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:1069:in block in have_func' from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:959:in block in checking_for'
from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:361:in block (2 levels) in postpone' from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:331:in open'
from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:361:in block in postpone' from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:331:in open'
from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:357:in postpone' from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:958:in checking_for'
from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:1068:in have_func' from extconf.rb:6:in '
To see why this extension failed to compile, please check the mkmf.log which can be found here:
C:/Ruby26-x64/lib/ruby/gems/2.6.0/extensions/x64-mingw32/2.6.0/racc-1.5.2/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/racc-1.5.2 for inspection.
Results logged to C:/Ruby26-x64/lib/ruby/gems/2.6.0/extensions/x64-mingw32/2.6.0/racc-1.5.2/gem_make.out
The docs for shopify cli mention that you need ruby 2.7 installed on your system. From looking at your output, you're using ruby 2.6.
https://shopify.dev/apps/tools/cli/installation

SQLite3 with JRuby and Sequel

I need to use SQLite3 with Jruby and Sequel gem on Windows.
require 'sequel'
DB = Sequel.sqlite
I got this error:
Sequel::AdapterNotFound: LoadError: no such file to load -- sqlite3
load_adapter at C:/jruby-9.1.13.0/lib/ruby/gems/shared/gems/sequel-5.9.0/lib/sequel/database/connecting.rb:93
adapter_class at C:/jruby-9.1.13.0/lib/ruby/gems/shared/gems/sequel-5.9.0/lib/sequel/database/connecting.rb:17
connect at C:/jruby-9.1.13.0/lib/ruby/gems/shared/gems/sequel-5.9.0/lib/sequel/database/connecting.rb:45
connect at C:/jruby-9.1.13.0/lib/ruby/gems/shared/gems/sequel-5.9.0/lib/sequel/core.rb:116
adapter_method at C:/jruby-9.1.13.0/lib/ruby/gems/shared/gems/sequel-5.9.0/lib/sequel/core.rb:394
block in sqlite at C:/jruby-9.1.13.0/lib/ruby/gems/shared/gems/sequel-5.9.0/lib/sequel/core.rb:401
<main> at test.rb:53
When i try to install sqlite3 gem it fails when building native extensions:
Building native extensions. This could take a while...
ERROR: Error installing sqlite3:
ERROR: Failed to build gem native extension.
current directory: C:/jruby-9.1.13.0/lib/ruby/gems/shared/gems/sqlite3-1.3.1
3/ext/sqlite3
C:/jruby-9.1.13.0/bin/jruby.exe -r ./siteconf20181005-6576-1e4h1cf.rb extconf.rb
checking for sqlite3.h... RuntimeError: The compiler failed to generate an executable file.
You have to install development tools first.
try_do at C:/jruby-9.1.13.0/lib/ruby/stdlib/mkmf.rb:456
try_cpp at C:/jruby-9.1.13.0/lib/ruby/stdlib/mkmf.rb:587
block in find_header at C:/jruby-9.1.13.0/lib/ruby/stdlib/mkmf.rb:1144
block in checking_for at C:/jruby-9.1.13.0/lib/ruby/stdlib/mkmf.rb:942
block in postpone at C:/jruby-9.1.13.0/lib/ruby/stdlib/mkmf.rb:350
open at C:/jruby-9.1.13.0/lib/ruby/stdlib/mkmf.rb:320
block in postpone at C:/jruby-9.1.13.0/lib/ruby/stdlib/mkmf.rb:350
open at C:/jruby-9.1.13.0/lib/ruby/stdlib/mkmf.rb:320
postpone at C:/jruby-9.1.13.0/lib/ruby/stdlib/mkmf.rb:346
checking_for at C:/jruby-9.1.13.0/lib/ruby/stdlib/mkmf.rb:941
find_header at C:/jruby-9.1.13.0/lib/ruby/stdlib/mkmf.rb:1143
<main> at extconf.rb:50
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/jruby-9.1.13.0/bin/jruby
--with-sqlite3-config
--without-sqlite3-config
--with-pkg-config
--without-pkg-config
--with-sqlite3-dir
--without-sqlite3-dir
--with-sqlite3-include
--without-sqlite3-include=${sqlite3-dir}/include
--with-sqlite3-lib
--without-sqlite3-lib=${sqlite3-dir}/lib
To see why this extension failed to compile, please check the mkmf.log which can
be found here:
C:/jruby-9.1.13.0/lib/ruby/gems/shared/extensions/universal-java-1.8/2.3.0/sql
ite3-1.3.13/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in C:/jruby-9.1.13.0/lib/ruby/gems/shared/gems/s
qlite3-1.3.13 for inspection.
Results logged to C:/jruby-9.1.13.0/lib/ruby/gems/shared/extensions/universal-ja
va-1.8/2.3.0/sqlite3-1.3.13/gem_make.out
I've copied SQLite lib (sqlite3.dll, sqlite3.def) in jruby/bin folder.
JRuby official page sugget use activerecord-jdbc-adapter, but I need to create in memory db, not connecting to existing one.
How can I do?
My environment:
Jruby v. 9.1.13
Sequel v. 5.9.0
Windows Server 2012 R2
You want to use the Sequel jdbc adapter and the jdbc-sqlite3 gem:
require 'sequel'
DB = Sequel.connect("jdbc:sqlite::memory:")
FWIW, if you want an in-memory database with JRuby, h2, hsqldb, and derby may be better choices (and Sequel supports all of them).

Failed to build gem native extension on Windows

I'm attempting to install the dandelion gem on on my Windows machine, but it keeps failing:
C:\Users\William>gem install dandelion --platform=ruby
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing dandelion:
ERROR: Failed to build gem native extension.
C:/Ruby22/bin/ruby.exe -r ./siteconf20150623-7568-1ikffjg.rb extconf.rb
checking for gmake... no
checking for make... yes
checking for cmake... yes
checking for pkg-config... yes
-- cmake .. -DBUILD_CLAR=OFF -DTHREADSAFE=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_
FLAGS=-fPIC -DCMAKE_BUILD_TYPE=RelWithDebInfo -G "Unix Makefiles"
-- C:\DevKit\bin/make.exe
checking for main() in -lgit2... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/Ruby22/bin/$(RUBY_BASE_NAME)
--use-system-libraries
--with-git2-dir
--without-git2-dir
--with-git2-include
--without-git2-include=${git2-dir}/include
--with-git2-lib
--without-git2-lib=${git2-dir}/lib
--with-git2lib
--without-git2lib
C:/Ruby22/lib/ruby/2.2.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from C:/Ruby22/lib/ruby/2.2.0/mkmf.rb:541:in `try_link0'
from C:/Ruby22/lib/ruby/2.2.0/mkmf.rb:556:in `try_link'
from C:/Ruby22/lib/ruby/2.2.0/mkmf.rb:735:in `try_func'
from C:/Ruby22/lib/ruby/2.2.0/mkmf.rb:966:in `block in have_library'
from C:/Ruby22/lib/ruby/2.2.0/mkmf.rb:911:in `block in checking_for'
from C:/Ruby22/lib/ruby/2.2.0/mkmf.rb:351:in `block (2 levels) in postpone'
from C:/Ruby22/lib/ruby/2.2.0/mkmf.rb:321:in `open'
from C:/Ruby22/lib/ruby/2.2.0/mkmf.rb:351:in `block in postpone'
from C:/Ruby22/lib/ruby/2.2.0/mkmf.rb:321:in `open'
from C:/Ruby22/lib/ruby/2.2.0/mkmf.rb:347:in `postpone'
from C:/Ruby22/lib/ruby/2.2.0/mkmf.rb:910:in `checking_for'
from C:/Ruby22/lib/ruby/2.2.0/mkmf.rb:961:in `have_library'
from extconf.rb:89:in `<main>'
extconf failed, exit code 1
Gem files will remain installed in C:/Ruby22/lib/ruby/gems/2.2.0/gems/rugged-0.2
2.1b1 for inspection.
Results logged to C:/Ruby22/lib/ruby/gems/2.2.0/extensions/x86-mingw32/2.2.0/rug
ged-0.22.1b1/gem_make.out
The error that states "you have to install development tools first" is a head-scratcher. I have already installed DevKit.
Any ideas how to solve this error?
This is a fun one. I'm going to take a wild guess and say that you have a version of libgit2 located in C:/Program Files (x86)/libgit2/lib and that folder is somehow in your Path or possible some other environment variable.
The fix is to take that folder out of what environment variable that it could be in. That should let rugged build correctly.
The Problem
When gcc is trying to test for the libgit2 library it sees it could possibly be in C:/Program Files (x86)/libgit2/lib and uses -LC:/Program Files (x86)/libgit2/lib.
The problem is that it isn't properly escaped, which leads to
gcc: error: Files: No such file or directory
gcc: error: (x86)/libgit2/lib: No such file or directory
This is actually the same reason why Ruby can't be installed in folders with spaces.
As a side note: I'd like to point out that in addition to the regular DevKit you also have cmake and pkg-config somewhere installed and in your Path

Debugger cannot compile on Ruby 2.0

Originally posted here: "How to use the debugger with Ruby 2.0?"
I keep ending up back here, but I have a different problem. I don't have the option to change to Byebug right now. We are currently stuck on "debugger" for now, and I cannot install it.
Building native extensions. This could take a while...
ERROR: Error installing debugger:
ERROR: Failed to build gem native extension.
/Users/mbridges/.rbenv/versions/2.0.0-p247/bin/ruby extconf.rb
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/mbridges/.rbenv/versions/2.0.0-p247/bin/ruby
/Users/mbridges/.rbenv/versions/2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:51:in `require': cannot load such file -- debugger/ruby_core_source (LoadError)
from /Users/mbridges/.rbenv/versions/2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:51:in `require'
from extconf.rb:16:in `<main>'
Anyone have any ideas?
Update: Now Ruby 2.1+ should using byebug instead of debugger.
clone the debugger-ruby_core_source to local folder, e.g. C:\git\debugger-ruby_core_source
copy C:\git\debugger-ruby_core_source\lib to C:\Ruby200\lib\ruby\gems\2.0.0\gems\debugger-ruby_core_source-1.3.2
run the gem install debugger again.
I'm now sure why the gems debugger-ruby_core_source didn't copy the lib to that folder, but certainly the debugger need it.

Installing opencv GEM - extconf.rb error

I have been stuck on this for a couple of days now, so PLEASE help!
I run MAC OS X(10.7.5), with Xcode(4.5.2) and Command Line Tools installed. Ruby 1.9.3-p362, RVM 1.17.8. apple-gcc42 has also been installed. I use Homebrew for installations.
When I try to install the Opencv gem, I get the following error:
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/samanthacabral/.rvm/rubies/ruby-1.9.3-p362/bin/ruby
--with-opencv-dir
--without-opencv-dir
--with-opencv-include
--without-opencv-include=${opencv-dir}/include
--with-opencv-lib
--without-opencv-lib=${opencv-dir}/lib
--with-ffcall-dir
--without-ffcall-dir
--with-ffcall-include
--without-ffcall-include=${ffcall-dir}/include
--with-ffcall-lib
--without-ffcall-lib=${ffcall-dir}/lib
--with-cxcorelib
--without-cxcorelib
extconf.rb:32:in `block in <main>': libcxcore not found. (RuntimeError)
from extconf.rb:31:in `each'
from extconf.rb:31:in `<main>'
I have tried reinstalling RVM a couple of times and making some of the other changes recommended in similar questions.
My gem file compiles just fine without the opencv gem, but I am having similar issues with RMagick (showing an extconf.rb error).
What should I do?
Thanks!!!
In case anyone else experiences this, I had better similar problems on OS X and had better luck with the ruby-opencv gem.

Resources