Using cucumber with jruby - cucumber

I'm working on my company's intranet with
cucumber 0.8.5
gherkin 2.1.5
And I'm trying to switch from using ruby 1.8.7 to jruby 1.5.1
However, whenever I try to run cucumber from jruby, I get an error:
% jruby -S cucumber
/usr/local/src/jruby-1.5.1/lib/ruby/site_rub/1.8/rubygems/custom_require.rb:31:in `require': no such file to load -- gherkin (LoadError)
I think this is b/c gherkin 2.1.5 is a native extension, and jruby can't handle it:
% jgem install gherkin-2.1.5.gem
...
ERROR: Error installing gherkin-2.1.5.gem:
ERROR: Failed to build gem native extension.
Now, I'd love to just try updating versions, but since this is on a protected intranet, importing new software is a PITA, and takes some time.
Does anyone have any suggestions of how I can make the software I have work? Am I missing a proper configuration setting or some such?

You need to install the JRuby version of gherkin. If you simply do
jgem install gherkin
you will get the correct version automatically. Otherwise, you have to figure out the URI to the JRuby version of the gherkin gem yourself and download it by hand.
But really, there is only one sensible thing you can do if you are working for a company that asks you to do a job and then ties your hands behind your back: run, as fast as you can, as far away as you can.

Related

OWASP security issue with jackson-databind-2.9.8 jar

I have a maven web project(RESTful, Spring Rest/data) running in Java 8(tomcat 8.5.5) and using 'jackson-databind-2.9.8.jar'. When the Dependency Check Tool(Checks vulnerable jar version and generates report) is run against the libraries the project is using, it showed 'jackson-databind-2.9.8.jar' as Vulnerable(Reference- https://nvd.nist.gov/vuln/search/results?form_type=Advanced&results_type=overview&search_type=all&cpe_vendor=cpe%3A%2F%3Afasterxml&cpe_product=cpe%3A%2F%3Afasterxml%3Ajackson-databind&cpe_version=cpe%3A%2F%3Afasterxml%3Ajackson-databind%3A2.9.8)
Problem:- Changing to 'jackson-databind-2.10.0.jar' version fixes OWASP security issue(running Dependency Check Tool) but, when project is build and run it throws error since 2.10.0 uses jdk9+ complaint classes(Reference- https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.10)
What should be done to resolve the issue, can we make the project compile in Java 8 and run in JDK11(since JDK9 is out of support) or something else should be done? Please suggest.
Thanks in advance!
CVE-2019-12086 is fixed in jackson-databind-2.9.9.jar .
See the report: https://nvd.nist.gov/vuln/detail/CVE-2019-12086
Maven repo for 2.9.9 : https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind/2.9.9

Error installing feeder/feedr library in python

I am trying to run a code which uses feeder (feedr on git repository) library. I am getting error while installing it. I have tried pip, cloning git, and previous versions but still getting same error on all PC. Please tell how to solve it or any alternative for feeder. Original code link is https://github.com/nashory/DeLF-pytorch/tree/master/notebook enter image description here
feedr uses infi.docopt_completion==0.2.1 which in turn uses distribute which is so old (last release in 2013) that it could hardly be installed in modern Python. I failed to install it in Python 2.7.
In short: the project feedr is old, outdated and abandoned. Forget about it. Or try to update in manually to use newer versions of dependencies. You can send pull request(s) to the author.

Ruby error when deploying a module with Puppet on CentOS 6

I have installed both Puppet master and agent on machines running CentOS 6
Everything went well, until the moment I have tried to deploy a simple sample module: I got an error, explained on the picture.
Trying to edit the file didn't help and the file was actually updated each time from repository
I tried running a different module which resulted in the same error
The error is because the formatting for Ruby code will not work with older Ruby. The CentOS 6 upstream Ruby package is 1.8.7, which is a super old Ruby version, and has been EOL for 3 years since 2014.
To fix this problem, Puppet started packaging Ruby and other dependancies as part of an all-in-one package since Puppet 4. This means there's no dependancy hell when it comes to EOL Ruby, OpenSSL and any other dependancies: they're all bundled and supported as a single RPM, without affecting the system packages.
It also means that you don't break any applications that require a different system Ruby, and generally makes using Puppet a lot easier.
Adding to this, the version of Puppet in CentOS is 3.X, which is also EOL. You should upgrade to Puppet 4. Here's a handy script that will install the Puppet 4 agent package on CentOS 6: https://github.com/petems/puppet-install-shell
If you are limited to using Puppet 3 for whatever reason, there are a few less preferable solutions:
Download a new Ruby RPM for CentOS 6, (such as from this Github repo) or a CloudPackage.io repo (such as this one I made for CentOS 6 Ruby packages https://packagecloud.io/petems/ruby2/install)
Disadvantage: Those RPMs are not supported officially and might have unintentional issues
Fork the module to change the Ruby code
Disadvantage: This is a big maintenance cost, and you'll have to do this every time an update happens to the module upstream.

Configure program that uses gtk1.2

I am trying to build a program as most others available on linux:
configure, make, make install.
However when I try to configure it I get the following message:
checking for gtk-config... no
checking for GTK - version >= 1.2.0... no
*** The gtk-config script installed by GTK could not be found
*** If GTK was installed in PREFIX, make sure PREFIX/bin is in
*** your path, or set the GTK_CONFIG environment variable to the
*** full path to gtk-config.
configure: error: Cannot find GTK: Is gtk-config in path?
I have got gtk 2.x on the host machine. And when I run which and locate on gtk-config I get nothing back. Since I have the source what patches can I apply to fix this?
You need to install the development files for GTK 1.2; the name of the package depends on your distribution.
I'd like to warn you, though, that GTK 1.2 was last released 15 years ago, in 2001, and hasn't been updated since — which also implies that the application you're trying to build is also hopelessly outdated.
GTK+ 2.0.0 was also released in 2001 and it's currently in deep maintenance mode (the latest version is 2.24.29 and was released in 2015); GTK+ 3.0.0 was released in 2011, and it's the currently developed version of the API.
You cannot really apply patches to compile an application written with the GTK 1.x API using any newer major versions of GTK+ (e.g. 2.x or 3.x); each time the major version of GTK is bumped, the API is changed in a non-compatible way. You would need to port the application to the new API.
Additionally, if an application depends on GTK 1.x it's also likely that it will depend on older versions of existing libraries; or deprecated ones. You will need to find all the dependencies and ensure that they can be installed in parallel with the ones you have installed in your system.
You could try using the compatibility wrappers developed by OpenSUSE team that try to emulate GTK1.2 by some wrappers and/or automatically patching source code to be compiled, to be able to use GTK2.0 instead.
Have a look at https://github.com/openSUSE/gtk1-compat - perhaps it may work for you. I didn't test it, however, myself.

Groovy plugin installation fails in STS 2.5.2 and 2.7

I have tried installing Groovy plugin via STS's dashboard install feature in both 2.7 (the version I downloaded initially which was the latest version at the time). My colleague recommended downloading 2.5.2, the version he is using, so I did; however the Groovy plugin installer still fails. It starts with:
Cannot complete the install because of a conflicting dependency.
Software being installed: Groovy-Eclipse Feature 2.5.2.xx-20110808-1400-e36 (org.codehaus.groovy.eclipse.feature.feature.group 2.5.2.xx-20110808-1400-e36)
Windows 7 64B
groovy v 1.8.2
grails v 1.3.7
jvm 1.6.0_26
Greatly appreciate any hints/recommendations/ideas. THANK YOU!
Make sure that your STS install is in a directory where the current user has write permissions. Also, there is a problem with installing into the Program Files directory (it is not really writable, even if you think it is).
The reason for this problem is the feature patch that comes with Groovy-Eclipse must be installed into the same directory as the rest of STS (an Eclipse limitation). This patch is the thing that patches the jdt compiler so that it can also compile groovy code.

Resources