Getting browsermob/proxy (LoadError) in windows 7 - ruby

I am trying to run Browsermob proxy tool using selenium cucumber with a ruby in windows 7 but am facing with browsermob/proxy (LoadError) while importing browsermob/proxy libriary. I installed all required gems. could someone help me with this issue
This is my code:
require 'browsermob/proxy'
require 'selenium-webdriver'
require 'rspec/expectations'
include RSpec::Matchers
This is the error message:
C:/Ruby23-x64/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in
require': cannot load such file -- browsermob/proxy (LoadError)
from C:/Ruby23-x64/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_req
uire.rb:55:in 'require'
from bandwidth_limit.rb:3:in '<main>'
What can I do to fix this?

Install Browsermob proxy using gem install. give below command in command prompt
gem install browsermob-proxy

Related

Ruby - Can't require gem properly

I'm trying to require the gem 'cerebrum'. I tried requiring it using the irb, and that worked, and also running the program in JRuby worked too. However, Ruby throws a LoadError.
C:/Ruby23-x64/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- cerebrum (LoadError)
from C:/Ruby23-x64/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
What am I doing wrong? Has anyone had that issue too?
You get the load error when gem is not installed. First check if this gem is installed in this ruby version using gem list cerebrum. It may be installed in your jruby that's why it didn't throw error.

Cannot load libxml_ruby.so for libxml-ruby gem

I installed the libxml-ruby gem, with the --platform=x86_64 flag, and whenever I try to require 'xml' I get an error.
Ruby24-x64/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require':
126: The specified module could not be found.
- I:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/libxml-ruby-3.0.0/lib/libxml_ruby.so (LoadError)
I checked, and libxml_ruby.so is in that directory. Any ideas on how to fix this?
I am using Ruby version 2.4.1 on Windows 10.

LoadError when executing ruby code in /etc/rc.d/rc.local

I use CentOS 6.6. I want to execute a Ruby code on startup, so I added the following command to execute the code to /etc/rc.d/rc.local.
ruby /ruby/send_mail.rb
In send_mail.rb, there is require 'mail', but error occurred like the following.
/usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- mail (LoadError)
from /usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /ruby/send_mail:23:in `<main>'
(I got this error by using ruby /ruby/send_mail.rb &> error_output)
I did gem install mail. And "send_mail.rb" works properly when I run this manually. Would you tell me what I should do?
Try running ruby using the RVM wrappers, as described here:
/usr/local/rvm/wrappers/ruby-2.2.2/ruby /ruby/send_mail.rb

Ruby can not find the module (LoadError) under Windows

I tried to connect to the database using Ruby (under Windows).
For that:
install Ruby in C:\Ruby193
install devkit (c:\ruby193\devkit). Run "ruby dk.rb init", "ruby dk.rb install"
downloaded rubygems (1.8.25). Executed ruby setup.rb
and: gem install rubyfb (adapter Ruby for Firebird)
After that I wrote short rb-script:
require 'rubygems'
require 'rubyfb'
include Rubyfb
db = Database.new('test.gdb')
And got error:
C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': 126: Can't find module - C:/Ruby193/lib/ruby/gems/1.9.1/gems/rubyfb-0.6.7/lib/rubyfb_lib.so (LoadError)
This is the file exists, but Ruby can not find it.
All my attempts to rectify the situation failed.
I installed another adapter, but the situation repeated - Ruby can not find another file.
Please advise.
I was having the same problem. All I had to do was copying C:\Program Files\Firebird\Firebird_2_5\bin\fbclient.dll to C:\Ruby\bin.

Missing gem watir?

ahmet#Ubuntu:~/test$ ruby hello.rb
/home/ahmet/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': no such file to load -- watir (LoadError)
from /home/ahmet/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from hello.rb:2:in `<main>'
I have required rubygems in my .rb but still get this error
require 'rubygems'
require 'watir'
According to Watir Readme you have to install and require firewatir. Also you may want to install watir-webdriver instead.
I encountered a similar problem with a different gem a while back on Ubuntu using RVM. I know the gem was installed, because I had just installed it. I did the following:
rvm get latest
rvm reload
gem update --system
Then for good measure I reinstalled the gem, and everything worked. Hope this helps you as well.
Read this: https://github.com/zeljkofilipin/watirbook/blob/master/installation/ubuntu.md
The require should be either 'firewatir' or 'watir-webdriver'
require 'firewatir'
or
require 'watir-webdriver'

Resources