Installing Cucumber on IronRuby (native json issue) - cucumber

I am trying to install Cucumber on IronRuby 1.1.3 using gem install cucumber but I keep getting the following error:
Building native extensions. This could take a while...
ERROR: Error installing cucumber:
ERROR: Failed to build gem native extension.
"d:/Program Files (x86)/IronRuby 1.1/bin/ir.exe" extconf.rb
d:/Program Files (x86)/IronRuby 1.1/Lib/ruby/1.9.1/mkmf.rb:9:in `const_missing':
uninitialized constant RbConfig::MAKEFILE_CONFIG (NameError)
from d:/Program Files (x86)/IronRuby 1.1/Lib/ruby/1.9.1/mkmf.rb:9
from d:/Program Files (x86)/IronRuby 1.1/Lib/ruby/1.9.1/rubygems/custom_
require.rb:29:in `require'
from d:/Program Files (x86)/IronRuby 1.1/Lib/ruby/1.9.1/rubygems/custom_
require.rb:29:in `require'
from extconf.rb:1

Here's the problem:
Failed to build gem native extension
Some gems when they get installed compile C extensions as part of the process; the above library is one of them. Other examples are Nokogiri and Gherkin. The resulting libraries are not .net-based and as such can't be used by IronRuby. IronRuby only deals in managed code so you can only use 'pure' ruby gems, or .net DLLs.

Related

Trying to install python-mbedtls on Windows using VSCode

I am trying to install the python-mbedtls package using pip installer in my venv on Windows, but I am getting the below error:
build\3.10.2\temp.win-amd64-3.10\Release\pyrex\mbedtls\exceptions.c(685): fatal error C1083: Cannot open include file: 'mbedtls/error.h': No such file or directory
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.31.31103\bin\HostX86\x64\cl.exe' failed with exit code 2
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for python-mbedtls
Failed to build python-mbedtls
ERROR: Could not build wheels for python-mbedtls, which is required to install pyproject.toml-based projects
I know that this library uses the C lib mbedtls and I have no experience using C, or C libraries in my python code directly.
I have made sure to install the C/C++ build tools on my VSCode, and I'm using Python 3.10. I am completely lost on how to proceed

Error installing nokogiri: Failed to build gem native extension

I want to execute the following command
bundle install && rake install
but an error comes up and I try to figure out whats going on. I found that i need to install nokogiri. But when I try to install it an error comes up again. Any ideas? :/
sudo gem install nokogiri -v '1.8.5'
Building native extensions. This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
current directory: /var/lib/gems/2.5.0/gems/nokogiri-1.8.5/ext/nokogiri
/usr/bin/ruby2.5 -r ./siteconf20181210-12550-orku3c.rb extconf.rb
checking if the C compiler accepts ... yes
Building nokogiri using packaged libraries.
Using mini_portile version 2.3.0
checking for gzdopen() in -lz... no
zlib is missing; necessary for building libxml2
*** 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=/usr/bin/$(RUBY_BASE_NAME)2.5
--help
--clean
--use-system-libraries
--enable-static
--disable-static
--with-zlib-dir
--without-zlib-dir
--with-zlib-include
--without-zlib-include=${zlib-dir}/include
--with-zlib-lib
--without-zlib-lib=${zlib-dir}/lib
--enable-cross-build
--disable-cross-build
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/var/lib/gems/2.5.0/extensions/x86_64-linux/2.5.0/nokogiri-1.8.5/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /var/lib/gems/2.5.0/gems/nokogiri-1.8.5 for inspection.
Results logged to /var/lib/gems/2.5.0/extensions/x86_64-linux/2.5.0/nokogiri-1.8.5/gem_make.out

ghc-modi and cabal version

(Haskell newbie here)
I'm trying to configure HaskForce plugin into IntelliJ IDEA, configured "ghc-mod" with "legacy-interactive" in "GHC Modi" Flags. The root problem seems to be related to cabal version, although when I try autocompleting on any Haskell symbol, I get this:
ghc-modi error
Unable to parse problems from ghc-modi: cabal-helper-wrapper.exe: ghc: readCreateProcess: does not exist (No such file or directory)
ghc-mod: readCreateProcess: C:\ACME\projects\htest\.cabal-sandbox\cabal-helper-0.5.3.0-553kah86RQN6BuDX6XLBiX\cabal-helper-wrapper.exe "C:\\ACME\\projects\\htest" "C:\\ACME\\projects\\htest\\dist" (exit 1): failed
When I run this last command (C:\ACME\projects\htest\.cabal-sandbox\cabal-helper-0.5.3.0-553kah86RQN6BuDX6XLBiX\cabal-helper-wrapper.exe "C:\\ACME\\projects\\htest" "C:\\ACME\\projects\\htest\\dist"), it tries to install cabal 1.18:
cabal-helper-wrapper.exe: Installing Cabal version 1.18.1.3 failed.
I already have cabal, of version 1.22 (installed via Haskell Platform v7.10.2-a, released recently in August).
Is there any way to work around this issue (i.e. still use ghc-mod / ghc-modi)?
Updated Haskforce plugin (0.3-beta24) seems to work correctly with following ghc-mod:
ghc-mod version 5.4.0.0 compiled by GHC 7.10.2

Node.js npm installing websocket fails

I am installing websocket through npm in Windows 7 64 bit. The websocket version is 1.0.8
I am getting a linking error even though I have Visual Studio 2010 and Python 2.7 :
C:\Windows\system32\node_modules\websocket>node "C:\Program Files (x86)\nodejs\n
ode_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" r
ebuild
validation.cc
C:\Users\User\.node-gyp\0.10.30\deps\v8\include\v8.h(184): warning C4506: no d
efinition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8::Hand
le<T>)' [C:\Windows\system32\node_modules\websocket\build\validation.vcxproj]
with
[
T=v8::Object
]
LINK : fatal error LNK1104: cannot open file 'C:\Windows\system32\node_modules\w
ebsocket\build\Release\validation.node' [C:\Windows\system32\node_modules\websoc
ket\build\validation.vcxproj]
xor.cpp
C:\Users\User\.node-gyp\0.10.30\deps\v8\include\v8.h(179): warning C4506: no d
efinition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8::Hand
le<T>)' [C:\Windows\system32\node_modules\websocket\build\xor.vcxproj]
with
[
T=v8::Object
]
LINK : fatal error LNK1104: cannot open file 'C:\Windows\system32\node_modules\w
ebsocket\build\Release\xor.node' [C:\Windows\system32\node_modules\websocket\bui
ld\xor.vcxproj]
gyp[websocket v1.0.8]
Native code compile failed!!
Please note that this module DOES NOT REQUIRE the native components
and will still work without them, though not quite as efficiently.
On Windows, native extensions require Visual Studio and Python.
On Unix, native extensions require Python, make and a C++ compiler.
Start npm with --websocket:verbose to show compilation output (if any).
websocket#1.0.8 node_modules\websocket
C:\Windows\system32>
Is there a way to skip this compilation stuff and just use this module right away ? Or someway to fix this error ?
PS: the command prompt was started with Admin rights.

Cucumber/JRuby - uninitialized constant Syntax::Ruby::Set Error creating formatter: html (NameError)

I'm using a JRUBY/Cucumber/Watir framework and I have one specific features folder that keeps throwing this error every I try to use the built in HTML formatter:
uninitialized constant Syntax::Ruby::Set
Error creating formatter: html (NameError)
org/jruby/RubyModule.java:2690:in `const_missing'
/Users/Casey.Guerrero/.rvm/gems/jruby-1.7.10/gems/syntax-1.2.0/lib/syntax /lang/ruby.rb:11:in `Ruby'
/Users/Casey.Guerrero/.rvm/gems/jruby-1.7.10/gems/syntax-1.2.0/lib/syntax /lang/ruby.rb:8:in `Syntax'
/Users/Casey.Guerrero/.rvm/gems/jruby-1.7.10/gems/syntax-1.2.0/lib/syntax/lang/ruby.rb:3:in `(root)'
org/jruby/RubyKernel.java:1083:in `require'
/Users/Casey.Guerrero/.rvm/rubies/jruby-1.7.10/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:55:in `require'
/Users/Casey.Guerrero/.rvm/rubies/jruby-1.7.10/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:53:in `require'
/Users/Casey.Guerrero/.rvm/gems/jruby-1.7.10/gems/syntax-1.2.0/lib/syntax.rb:1:in `(root)'
/Users/Casey.Guerrero/.rvm/gems/jruby-1.7.10/gems/syntax-1.2.0/lib/syntax.rb:24:in `load'
/Users/Casey.Guerrero/.rvm/gems/jruby-1.7.10/gems/syntax-1.2.0/lib/syntax/convertors/abstract.rb:16:in `for_syntax'
/Users/Casey.Guerrero/.rvm/gems/jruby-1.7.10/gems/cucumber-1.3.14/bin/../lib/cucumber/formatter/html.rb:580:in `SnippetExtractor'
/Users/Casey.Guerrero/.rvm/gems/jruby-1.7.10/gems/cucumber-1.3.14/bin/../lib/cucumber/formatter/html.rb:578:in `Html'
/Users/Casey.Guerrero/.rvm/gems/jruby-1.7.10/gems/cucumber-1.3.14/bin/../lib/cucumber/formatter/html.rb:8:in `Formatter'
/Users/Casey.Guerrero/.rvm/gems/jruby-1.7.10/gems/cucumber-1.3.14/bin/../lib/cucumber/formatter/html.rb:7:in `Cucumber'
org/jruby/RubyKernel.java:1083:in `require'
/Users/Casey.Guerrero/.rvm/rubies/jruby-1.7.10/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:55:in `require'
/Users/Casey.Guerrero/.rvm/rubies/jruby-1.7.10/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:53:in `require'
/Users/Casey.Guerrero/.rvm/gems/jruby-1.7.10/gems/cucumber-1.3.14/bin/../lib/cucumber/formatter/html.rb:6:in `(root)'
/Users/Casey.Guerrero/.rvm/gems/jruby-1.7.10/gems/cucumber-1.3.14/bin/../lib/cucumber/constantize.rb:1:in `(root)'
/Users/Casey.Guerrero/.rvm/gems/jruby-1.7.10/gems/cucumber-1.3.14/bin/../lib/cucumber/constantize.rb:17:in `constantize'
org/jruby/RubyArray.java:2409:in `map'
/Users/Casey.Guerrero/.rvm/gems/jruby-1.7.10/gems/cucumber-1.3.14/bin/../lib/cucumber/cli/configuration.rb:81:in `formatter_class'
/Users/Casey.Guerrero/.rvm/gems/jruby-1.7.10/gems/cucumber-1.3.14/bin/../lib/cucumber/cli/configuration.rb:182:in `formatters'
/Users/Casey.Guerrero/.rvm/gems/jruby-1.7.10/gems/cucumber-1.3.14/bin/../lib/cucumber/cli/configuration.rb:178:in `formatters'
/Users/Casey.Guerrero/.rvm/gems/jruby-1.7.10/gems/cucumber-1.3.14/bin/../lib/cucumber/cli/configuration.rb:76:in `build_tree_walker'
/Users/Casey.Guerrero/.rvm/gems/jruby-1.7.10/gems/cucumber-1.3.14/bin/../lib/cucumber/runtime.rb:46:in `run!'
org/jruby/RubyKernel.java:1099:in `load'
/Users/Casey.Guerrero/.rvm/gems/jruby-1.7.10/gems/cucumber-1.3.14/bin/../lib/cucumber/cli/main.rb:47:in `execute!'
org/jruby/RubyKernel.java:1119:in `eval'
/Users/Casey.Guerrero/.rvm/gems/jruby-1.7.10/bin/jruby_executable_hooks:15:in `(root)'
Using cucumber-1.3.14 and jruby-1.7.10 , although the error occurs with jruby-1.7.4. There are no formatters included in the support directory or referenced anywhere in the env.rb. Not using rake or anything ust running individual features. The strange thing is that other feature folders can output html reports with the same command arguments as the one that fails. Example:
cucumber features/AddText.feature -f html -o report.html -f pretty
or
cucumber features/AddText.feature --format html --out report.html --format pretty
Any insight would be helpful.
UPDATE:
For some reason uninstalling then 'syntax' gem allows features to run and html reports to be generated. I was under the impression that 'syntax' was a 'cucumber' dependency...
When a test failure occurs in Cucumber, the following line is written to the console:
# gem install syntax to get syntax highlighting
Unfortunately, this causes people to install the syntax gem, which is the cause of your error.
Do 'gem uninstall syntax' or 'sudo gem uninstall syntax' to avoid this error.
Run "gem uninstall syntax" this will work
i know this is bit old thread, but would like to clear somethings out.
cucumber 1.3.17 and 1.3.18 dependent on syntax >= 1.0.0
and in the current case, problem is syntax 1.2.0 and not all version of syntax.
so what we should do is
uninstall syntax 1.2.0 and install syntax 1.0.0
sudo gem install syntax -v 1.0.0

Resources