cannot load such file -- 2.2/gherkin_lexer_en, how to fix? - ruby

I need a little help. How do I resolve this problem?
When I call cucumber I get the following error:
*** WARNING: You must use ANSICON 1.31 or higher (https://github.com/adoxa/ansic
on/) to get coloured output on Windows
WARNING: cannot load such file -- 2.2/gherkin_lexer_en
Couldn't load 2.2/gherkin_lexer_en
The $LOAD_PATH was:
lib
C:/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-1.3.19/bin/../lib
C:/Ruby22/lib/ruby/gems/2.2.0/gems/builder-3.2.2/lib
C:/Ruby22/lib/ruby/gems/2.2.0/gems/diff-lcs-1.2.5/lib
C:/Ruby22/lib/ruby/gems/2.2.0/gems/multi_json-1.11.0/lib
C:/Ruby22/lib/ruby/gems/2.2.0/gems/gherkin-2.12.2-x86-mingw32/lib
[...]
System:
Windows 8.1 x64
Ruby 2.2.1 installer
I got answer:
https://github.com/cucumber/cucumber/issues/830#issuecomment-90837546
I'm afraid Cucumber on Windows/Ruby requires ruby 2.0.0 (x86). The
reason is that the gherkin gem doesn't yet ship with compiled binaries
for more recent versions or Ruby, and not for x64.
We're working on a Gherkin3 which will address this issue. See this
post for background. I cannot give you an ETA, but it's at least a few
months away.

I download Ruby 2.0 x86 from http://rubyinstaller.org/downloads/
Install exe
Command in cmd: gem install calabash-android
ERROR: Error installing calabash-android:
The 'json' native gem requires installed build tools.
Download from http://rubyinstaller.org/downloads/ DevKit-mingw64-32-4.7.2-20130224-1151-sfx.exe
Extract DevKit to path C:\Ruby200\DevKit
Run cd C:\Ruby200\DevKit
Run ruby dk.rb init
Run ruby dk.rb review
Run ruby dk.rb install
And again use command gem install calabash-android

I have simply solved by removing Gherkin and reinstalling it by bundle install
gem uninstall gherkin
>> select all
bundle install

This problem looks like this issue. Maybe you can resolve by following comments in it. (y)
sanjaykumar5115 commented,
my probelm have been solved after uninstalling gherkin and installing gherkin-2.12.1-x86-mingw32

Related

Github pages installation: Jekyll -v output `require': cannot load such file -- google/protobuf_c (LoadError)

I'm trying to follow this guide on setting up a GitHub page website. I installed Homebrew, chruby, and Jekyll following this jekyllrb.com tutorial.
When I run ruby -v I get ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-darwin18]. When I run chruby -V I get chruby: 0.3.9. After installing Jekyll with gem install jekyll I get Successfully installed jekyll-4.3.1 Parsing documentation for jekyll-4.3.1 Done installing documentation for Jekyll after 0 seconds 1 gem installed.
But when I run jekyll -v (or any Jekyll command) I get a very long message with the following error:
<internal:/Users/my_username/.rubies/ruby-3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require': dlopen(/Users/my_username/.gem/ruby/3.1.2/gems/google-protobuf-3.21.12-x86_64-darwin/lib/google/3.1/protobuf_c.bundle, 9): no suitable image found. Did find: (LoadError)
/Users/my_username/.gem/ruby/3.1.2/gems/google-protobuf-3.21.12-x86_64-darwin/lib/google/3.1/protobuf_c.bundle: cannot load 'protobuf_c.bundle' (load command 0x80000034 is unknown)
/Users/my_username/.gem/ruby/3.1.2/gems/google-protobuf-3.21.12-x86_64-darwin/lib/google/3.1/protobuf_c.bundle: cannot load 'protobuf_c.bundle' (load command 0x80000034 is unknown) - /Users/my_username/.gem/ruby/3.1.2/gems/google-protobuf-3.21.12-x86_64-darwin/lib/google/3.1/protobuf_c.bundle
I spent hours looking at what this error means and found very specific (to some version of Ruby or other libraries) questions like Ruby 2.7.2 google/protobuf_c problem (M1), Ruby: Gem version 3.11.2 doesn't load on Ruby 2.7, and many others.
It's the first time I even hear about Ruby or Jekyll or anything else here and I can't figure out how to properly install these to just make a website on GitHub. I also tried to install Ruby using rvm instead of chruby but that gave the same error. I also tried to install different versions of Ruby, like 3.1.3 and 3.2.0.
When gems have native extensions that need to be compiled it's possible for the gem author to build the extensions in advance and include them in the package so that the gem can install faster than if it were being compiled from scratch. Unfortunately Google has broken this implementation repeatedly.
This has been a problem for about two years with google-protobuf. Google has periodically fixed it and broken it again. They also periodically claim to understand the problem without understanding it and claim to have fixed it without fixing it. And their GitHub issues frequently pass the buck when they're the only ones that can fix it.
Anytime you're dealing with google-protobuf on macOS it's best to ensure that you are compiling it from scratch. This can be done with the --platform argument:
gem install --platform ruby google-protobuf
The platform ruby means don't use any pre-compiled binaries and force compilation from source.
The platform x86_64-darwin means use the pre-compiled binaries for macOS with Intel processors. That's the version that the gem installer identified for your system and used automatically but the error no suitable image found is a macOS error that means this library was not compiled in a way that I can understand.

TheRubyRacer error while installing Beef in Windows 10 - 64 bit

I am trying to install Beef in a WIndows 10 - 64 bit PC.
I followed the instructions provided in the following link:
https://github.com/beefproject/beef/blob/master/INSTALL.txt
But I keep getting this error:
An error occurred while installing therubyracer (0.11.4), and Bundler
cannot continue. Make sure that gem install therubyracer -v '0.11.3'
succeeds before bundling.
I drilled down a bit & found that the installed version of therubyracer is 0.11.0beta1 x86-mingw32 whereas the installer is searching for version 0.11.3
In the link provided above, the following lines are mentioned in line 38:
Finally, edit beef's gem lock file by replacing the required ruby racer version with the version downloaded from the link above.
But when I do that I get this error:
Your lockfile is unreadable. Run rm Gemfile.lock and then bundle
install to generate a new lockfile.
Can anyone please help me out with this?
Doing what the error message suggests should do the trick. Just remove existing Gemfile.lock in beef project and then run bundle install command once again.
The Gemfile has the the following check:
# Windows support
if RUBY_PLATFORM.downcase.include?('mswin') || RUBY_PLATFORM.downcase.include?('mingw')
# make sure you install this gem following https://github.com/eakmotion/therubyracer_for_windows
gem 'therubyracer', '~> 0.11.0beta1'
elsif !RUBY_PLATFORM.downcase.include?('darwin')
gem 'therubyracer', '0.11.3'
end
So, it will generate a new Gemfile.lock file specific to Windows. The one in the repo is for Ubuntu/Debian.
Even after trying out the solution given by Uzbekjon, I wasn't able to get past the error. Beef requires a javascript runtime for the login page to properly show up. As suggested in the post given here, I got a workaround by installing Node.js

Installing Ruby version 2.2.4 on Windows 7

I had an old version of Ruby (1.9.3) that I am using with Selenium Webdriver.But I was getting errors while running my script.So I downloaded Ruby installer 2.2.4 version and ran it. Can someone tell me what is the command line steps to fully install it ? I tried "gem update --system" and I get the error "error fetching data". I tried "gem install ruby" and it says "successfully installed rubyzip 1.1.7"
Installing Ruby on Windows is best done by downloading the installer from the Ruby Installer site and executing the binary. There are a few things to look out for:
Make sure the correct Ruby is in your PATH. E.g.:
echo %PATH%
should include a string like C:\Ruby200\bin. The installation path may be different for your version of Ruby. If you are installing a new version, you might need to edit the path using the Windows dialog so that new sessions include it.
Also, read the instructions for installing the Ruby DevKit. You'll need it for installation of gems with native extensions.
Once Ruby is installed correctly you should be able to run ruby -v in a command window to see that the expected version is there.
\

Trouble with sqlite3 ruby 2.0 on Windows

I'm a newbie to programming, with ruby/rails successfully installed on my (mac) home computer. I'm trying to get ruby 2.0.0p195 (and Rails) set up on Windows at work (Windows 7, 32bit) and I'm failing on the sqlite3 installation. I've been through most of the solutions/suggestions I can find on the web, but just can't get it to work - the frustrating thing is that it tells me it's installed, but it doesn't work:
- I've tried the knapsack installation http://www.ruby-forum.com/topic/4413168
- If I try to install --with-opt-dir=c:/sqlite3 (or any of the many variations suggested) it gives a native extension error.
- I've put the .dll file in Ruby/bin, which is also in my PATH
- I have the devkit installed
The 'gem install sqlite3' command is successful, and if I do 'gem list', sqlite3 v1.3.7 x86-mingw32 appears in the list, but if I 'require sqlite3' in IRB I get:
LoadError: cannot load such file -- sqlite3/sqlite3_native
And the mkmf log says:
find_header: checking for sqlite3.h... -------------------- no
But I've confirmed the sqlite3.h file (and the sqlite3.c, sqlite3.o, and sqlite3.h files) is in my c:\sqlite3 directory, and as noted above, I've also tried installing '--with-opt-dir'.
So next I trace the error when I 'require' sqlite to a file '\kernel_require.rb' in ruby/lib, and it references to this:
if Gem::Specification.unresolved_deps.empty? then
return gem_original_require(path)
end
I'm lost, and WAY out of my depth. At this point my only solution would be either to completely uninstall and start again, or to downgrade to ruby 1.9.x, but others seem to have sqlite3 and ruby 2.0 working so it's obviously (?) semi-stable. Help?
UPDATE: I've now tried downgrading to ruby 1.9.3, and apart from pik reverting to the most recent version of ruby every time I shut the command line, I can actually get the server to run etc. So it seems this issue is related specifically to ruby 2.0.
I am encountering the same issue, except that I don't really think that it is related to Ruby 2, but to rails 4 instead.
I have managed to install the sqlite3 gem by downloading the source, dll and exec (dll and executables need to be added to PATH accessible) and installying the gem with the follwing process:
Download:
http://www.sqlite.org/2013/sqlite-amalgamation-3071700.zip
http://www.sqlite.org/2013/sqlite-dll-win32-x86-3071700.zip
Extract and put the files in a location on your C drive or wherever you want. Then copy sqlite.dll and sqlite.def to the Ruby/bin directory.
Then you go to the DevKit directory and run msys.bat, in which you issue the following command:
gem install sqlite3 --platform=ruby -- --with-sqlite3-dir=path-to-sqlite --with-sqlite3-include=path-to-sqlite
This allowed me to install the gem successfully (using Ruby-2.0.0-p247 x86 and devkit). I validated through irb doing:
require 'sqlite3'
SQLite3::SQLITE_VERSION
I'm still trying to figure out this issue.
I get the same error message when I try to start the server or whenever I try to run the rails console.
I'd love to get this issue fixed...

cannot load such file --zlib

Ruby & Rails beginner here! Attempting to code out of my iPad 3rd gen using iSSH, Digital Ocean Server (using Ubuntu 12.10), DropBox, and Textastic editor. (There is always somebody trying to ice skate uphill!)
In my installation of Ruby I am following these directions: https://www.digitalocean.com/community/articles/how-to-install-ruby-on-rails-on-ubuntu-12-04-from-source
When I do step 3: sudo gem update --system
ERROR: Loading command: update (LoadError)
cannot load such file -- zlib
ERROR: While executing gem ... (NameError)
uninitialized constant Gem::Commands::UpdateCommand
I've seen some posts that talk about RVM. Do I need to uninstall everything and start over with RVM? If so do I just delete the directory or is there an uninstall command for Ruby? Do I need to uninstall the libraries? How?
Any and all help is greatly appreciated.
try installing zlib package if you are using RVM.
https://rvm.io/packages/zlib/
rvm pkg install zlib
and reinstall all your rubies

Resources