`require': no such file to load -- rubygems (LoadError) - ruby

I am trying to create aws pipeline on vm for which i am using ruby1..3 and rubygems 2.0.3.While trying to create pipeline I am getting following error.
./aws/core/client.rb:14:in `require': no such file to load -- rubygems (LoadError)
Please help me with this problem....

It seems like you are having problems with your ruby/gem installation.
Maybe you have 2 ruby version installed simultaneously on the same machine?
Although not exactly the same question, but it seems that you can try the solutions described in this stackoverflow thread.

Related

cannot load such file -- rubygems.rb (LoadError)

I'm new to ruby. I removed ruby 1.9 with sudo apt-get purge ruby and then
I installed ruby 2.3.0 using ruby-install. But I got the following error
<internal:gem_prelude>:4:in `require': cannot load such file -- rubygems.rb (LoadError)
from <internal:gem_prelude>:4:in `<internal:gem_prelude>
when running rspec my_script.rb.
Still can't fix this after googling! Anyone can help me out?
It seems that the rspec binary was only installed for your previous ruby version. Therefore it is found, but not guaranteed to work.
I'd recommend to use something like rvm (https://rvm.io/) or rbenv (https://github.com/rbenv/rbenv). Both of them can easily handle different ruby versions while maintaining dependencies (e.g. different load paths, different gem versions, etc.). I'd even use rvm if there is only one single ruby version installed on a system.

cannot load such file -- ntlm/http (LoadError) - ruby

I'm using ntlm-http gem to verify Windows authentication. This works fine when I run in my test Ruby code, but when I implement it using Cucumber it complains of:
cannot load such file -- ntlm/http (LoadError)
Can any one help me with this please?
Try the following:
require 'net/ntlm_http'
Worked for me!

Rails Sinatra application not loading Gems. Do I have them in the wrong place?

I hope you can help me.
I am working on a small Sinatra Rails application. I have Ruby installed on Mac OSX using RVM (currently using ruby 1.9.2)
I changed my app to include some new gems and to use bundler/setup but I receive the following error when I start the server:
/Users/Matt/.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 -- bundler/setup (LoadError)
from /Users/Matt/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from application.rb:2:in `<main>'
I am fairly sure I have something going wrong here, I'm just not sure what or how to fix it.
Running the which commands receives the following output:
which ruby: /Users/Matt/.rvm/rubies/ruby-1.9.2-p290/bin/ruby
which bundle: /Users/Matt/.rvm/gems/ruby-1.9.2-p290/bin/bundle
which gem: /Users/Matt/.rvm/rubies/ruby-1.9.2-p290/bin/gem
Please can someone help me as this is starting to drive me a little crazy.
Many thanks in advance for your help.
from the #stephenmurdoch's comment above:
try running gem install bundler followed by bundle install from inside your application.

Including gems in ubuntu 11.04

I've got a problem with running an additional gem under ubuntu 11.04. I installed spiceweasel via gem install - which put it in /var/lib/gems/1.8/gems/spiceweasel. When I try to run it, I get:
`require': no such file to load -- spiceweasel/version (LoadError)
The file is in /var/lib/gems/1.8/gems/spiceweasel-0.7.1/lib/spiceweasel/version.rb but cannot be loaded. This happens both with and without -rubygems.
How do I fix this?
It seems to be the same problem like here: Ruby: require 'irbtools' raises LoadError
The gem author published the gem with wrong permissions. You should contact the gem author.

Need help with require while modifiying a gem (active_merchant)

I'm trying to add a new gateway to the active_merchant gem and I'm having 'require' issues when I try to run it from source.
(I think my problem is not active_merchant-specific, but more of a general Ruby environment issue, so I dont think the specific gem in use has to do with it.)
This is what I've done:
Cloned the Git repo for AM, to my local directory "C:\Users\jb\Documents\Aptana Studio 3 Workspace\active_merchant"
Went about doing the changes in the "billing/gateways" directory (this is just background info..)
Copied the "Sample Usage" example on AM's Git repo to C:\Users\jb\Documents\Aptana Studio 3 Workspace\simple_gw_test.rb, which starts with:
require 'rubygems'
require 'active_merchant'
Ran "ruby simple_gw_test.rb" and got the error message:
<internal:lib/rubygems/custom_require>:29:in `require': no such file to load --
active_merchant (LoadError)
from <internal:lib/rubygems/custom_require>:29:in 'require'
from simple_gw_test.rb:3:in '<main>'
This is understandable, since I don't have active_merchant gem installed
However, I want to use the downloaded source in the sample file, since I'm modifying the gateway source continually.
I tried
require '/Users/jb/Documents/Aptana Studio 3 Workspace/active_merchant'
And then got the same error:
<internal:lib/rubygems/custom_require>:29:in require': no such file to load --
/Users/jb/Documents/Aptana Studio 3 Workspace/active_merchant (LoadError)
from <internal:lib/rubygems/custom_require>:29:inrequire'
from simple_gw_test.rb:2:in `<main>';
Any Ruby Guru who can shed some light greatly appreaciated!
--jb
PS: I'm using MRI 1.9.2 on Windows 7 x64.
Make sure you have read access to that file. Ruby has given me that error before when I didn't have correct permissions.
I guess I scratched my own itch: After a couple of hours of "Pickaxe book-ing" and googling, I got the code necessary to bootstap the gem without it being installed:
require_relative 'active_merchant/lib/active_merchant'

Resources