Jruby: unable to install gems, failing with undefined class/module YAML::Syck::DefaultKey - cucumber

The console output pretty much speaks for itself:
$ java -jar jruby-complete-1.6.4.jar -S gem install nokogiri --no-rdoc --no-ri
Fetching: nokogiri-1.5.0-java.gem (100%)
Successfully installed nokogiri-1.5.0-java
1 gem installed
11:17:04|dkowis#racktop jruby
$ java -jar jruby-complete-1.6.4.jar -S gem install cucumber --no-rdoc --no-ri
ERROR: While executing gem ... (ArgumentError)
undefined class/module YAML::Syck::DefaultKey
11:18:24|dkowis#racktop jruby
$ java -jar jruby-complete-1.6.4.jar -S gem install cuke4duke --version=0.4.4 --no-rdoc --no-ri
ERROR: While executing gem ... (ArgumentError)
undefined class/module YAML::Syck::DefaultKey
There's a couple gems I can install, but the ones I need, I cannot. Is it a problem with the gem itself? Is it a problem with rubygems? I'm not able to puzzle this one out.

This apparently is a known issue with Rubygems reported here on the JRuby Forum.
There is a pull request to fix this Rubygems error, but you could try build the gems you want locally and correct the dependency statements in the gemspec file yourself. I had ran into the same problem with the i18n-js gem.
Hope this helps.

Related

Fluentd installation - Centos

I am trying to install Fluentd software on Centos servers and I get the error below:
Building native extensions. This could take a while...
ERROR: Error installing fluentd:
ERROR: Failed to build gem native extension.
current directory: /opt/rh/rh-ruby26/root/usr/local/share/gems/gems/msgpack-1.6.0/ext/msgpack
/opt/rh/rh-ruby26/root/usr/bin/ruby -I /opt/rh/rh-ruby26/root/usr/share/rubygems -r ./siteconf20221204-2069-z0rswh.rb extconf.rb
mkmf.rb can't find header files for ruby at /opt/rh/rh-ruby26/root/usr/share/include/ruby.h
You might have to install separate package for the ruby development
environment, ruby-dev or ruby-devel for example.
extconf failed, exit code 1
I saw in previous guides that I need to complete these commands:
xcode-select --install
sudo xcodebuild -license
However, when I tried to run the command I get this error:\
bash: xcode-select: command not found
Someone can assist please?
Thanks!!!
Install Fluentd on centos server
I get this error when I've run "sudo yum install ruby-devel"

jruby/cucumber: Bundle install doesn't install any gem

I'm on Windows 10 x64 and I've installed JRuby 1.7.8 (I tried the files for x64 and 32bits with the same problem) and JRE 7.
I was trying to have my Cucumber Test Framework running on a different machine. I downloaded my current branch (which is working fine in other computers, with all the settings: env.rb, Gemfile, etc) and then I installed successfully these 2 gems:
gem install bundler
gem install cucumber
The Gemfile I have contains loads of gems, similar to:
source 'https://rubygems.org'
gem "httpclient"
gem "watir-webdriver"
but when I execute:
bundle install
I just get this line and nothing gets installed, it finishes almost immediately. No Gemfile.lock is created, etc.
D:\project>bundle install
io/console not supported; tty will not be manipulated
D:\project>
Any idea what could be wrong and what I could try please?
Not quite sure if the issue has anything to do with the line above (which I had never seen in the other machines that are working). If it's not related and you've got an idea about both problems, please let me know and I'll have a look as well...
I've been trying for a few more hours and still not success, adding further info in case someone can spot something pls. Even 'bundle -v' doesn't work on this machine?!
D:\project>gem list
io/console not supported; tty will not be manipulated
*** LOCAL GEMS ***
builder (3.2.2)
bundler (1.13.2)
cucumber (2.4.0)
cucumber-core (1.5.0)
cucumber-wire (0.0.1)
diff-lcs (1.2.5)
gherkin (4.0.0)
jruby-win32ole (0.8.5)
multi_json (1.12.1)
multi_test (0.1.2)
rake (10.1.0)
D:\project>bundle -v
io/console not supported; tty will not be manipulated
D:\project>
Cheers!!
You have the latest version of bundler 1.13.2 installed and I have seen it cause different types of issues depending on the jruby version and some other gems. Bundler 1.10.6 works everytime for my Jruby 1.7.x.
Try these:
gem uninstall bundler
and
gem install bundler -v 1.10.6
Although I am not particularly familiar with jruby, it appears to be a bug, which is resolved in JRuby 1.7.24.
I would verify that the other computers this is working on are still on that version of jruby (assuming they are windows boxes).

"spawn.h not found" while installing octopress on Cygwin

I have been trying to install octopress on cygwin. I have googled but no avail. I hope that someone can suggest a hack (no matter how complicated) to resolve this.
I followed the octopress installation instructions. Everything went smoothly till the bundle install stage. When I reached that point, the installation quits with the error telling that it couldn't find spawn.h.
I searched and apparently spawn.h doesn't come in any of the cygwin libraries. I installed all the c++ libraries I could from cygwin setup but that did not help.
Can you please help resolve this?
I think the gem that fails in this process is posix-spawn. For this, you could install the gem locally:
$ gem install rake-compiler -v 0.7.6
$ git clone git://github.com/rtomayko/posix-spawn.git
$ cd posix-spawn
$ rake gem
$ cd pkg/posix-spawn-0.3.6
$ gem install --local posix-spawn-0.3.6.gem
The explanation (from an article I found):
There is a bug in the version of posix-spawn in the gem repositories however that makes installing via gem impossible on Cygwin
After this, try bundle install again, it should be successful.
Here's a related issue on the GitHub project
UPDATE: I recently installed scoop a command-line installer for Windows, a pretty easy setup. I installed Ruby, bundler and octopress without breaking a sweat. You should give it a try.

Error installing charlock_holmes : Error installing GITLAB

I am trying to install GITLAB. I get this error executing "sudo gem install charlock_holmes --version '0.6.9'" (section Install Gems)
GEOGIT:/geogit/Administrative_Tools # sudo gem install charlock_holmes --version '0.6.9'
Building native extensions. This could take a while...
ERROR: Error installing charlock_holmes:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9 extconf.rb
checking for main() in -licui18n... no
which: no brew in (/usr/sbin:/bin:/usr/bin:/sbin)
checking for main() in -licui18n... no
***************************************************************************************
*********** icu required (brew install icu4c or apt-get install libicu-dev) ***********
***************************************************************************************
*** 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}/
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/ruby1.9
--with-icu-dir
--without-icu-dir
--with-icu-include
--without-icu-include=${icu-dir}/include
--with-icu-lib
--without-icu-lib=${icu-dir}/
--with-icui18nlib
--without-icui18nlib
--with-icui18nlib
--without-icui18nlib
Gem files will remain installed in /usr/lib64/ruby/gems/1.9.1/gems/charlock_holmes-0.6.9 for inspection.
Results logged to /usr/lib64/ruby/gems/1.9.1/gems/charlock_holmes-0.6.9/ext/charlock_holmes/gem_make.out
Someone, can help me debug those logs and error?
This looks like issue 1952
It was actually weirdness with the way my ubuntu VPS is commissioned. Mine did not come with a C compiler or libdev obviously.
The problem fix I found was to install libdev first, then the GCC
Then apt-get install libicu-dev.
Update 2015: additional comments include:
yum install libicu-devel worked for me
You just need to make sure "patch" is installed (yum install patch) then it should work
For MacOS install the following dependency:
brew install icu4c
According to the documentation (https://github.com/gitlabhq/gitlabhq/blob/master/doc/install/installation.md) the package libicu-dev is required
Install it with "apt-get install libicu-dev" and then charlock_holmes could be installed
I used "yum install libicu-devel" and then I could install charlock_holmes
I got the same mistake on a Centos 5.4 server, the yum repository only have the icu version 3.6, so i have to search and install manually the library icu 4.2 which solve the problem. In case someone else need to know how to do it, i recommend to check this link http://source.icu-project.org/repos/icu/icu/tags/release-4-2-1/readme.html#HowToBuildUNIX
I had kind of the same problem: when I was trying to install charlock_holmes gem, I had this error:
charlock_holmes-0.7.3/mkmf.log
have_library: checking for main() in -licui18n... -------------------- no
I fixed it by running the first command of #VonC:
sudo apt-get install libicu-dev
Hope I helped someone!

Gem Install Error

When trying to run gem install rake bundler I get the following error
rvmsudo gem install rake bundler
ERROR: Loading command: install (LoadError)
cannot load such file -- zlib
ERROR: While executing gem ... (NameError)
uninitialized constant Gem::Commands::InstallCommand
What might be causing this problem and how do I fix it?
OS: Ubuntu 10.10 32 bit
Sounds like your missing the zlib package.
try:
rvm pkg install zlib
then uninstall and reinstall your gem version with rvm

Resources