`require': cannot load such file -- rsruby (LoarError) - ruby

I just used the code below to install rsruby on my Mac:
sudo gem install rsruby
Then I tried to load rsruby in my Ruby code:
require 'rsruby'
When running this I get this error:
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- rsruby (LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from graphz.rb:1:in `<main>'
Does the script with require 'rsruby' have to be in the same directory as the rsruby.rb file?

Related

getting this error while running a ruby script

2: from apk-embed-payload.rb:9:in `<main>'
1: from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
/usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require': cannot load such file -- colorize (LoadError)
It looks to me like you have a require 'colorize' in your code, but the gem colorize is not installed. You can install the gem by running:
gem install colorize
I assume you have gem installed. Otherwise you need to install it as well.

Cannot build or serve Jekyll site on OSX

I am running OS X 10.11.6 and I installed Jekyll (using the already existent ruby on my system) by the recommended method: sudo gem install -n /usr/local/bin/ jekyll.
I can happily run jekyll on my system so I made a new site by running jekyll new TestSite which successfully executed.
However, this is where it stops working: if I cd into the site directory and run any jekyll command I get the following error:
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- bundler (LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Library/Ruby/Gems/2.0.0/gems/jekyll-3.2.1/lib/jekyll/plugin_manager.rb:34:in `require_from_bundler'
from /Library/Ruby/Gems/2.0.0/gems/jekyll-3.2.1/exe/jekyll:9:in `<top (required)>'
from /usr/local/bin/jekyll:23:in `load'
from /usr/local/bin/jekyll:23:in `<main>'
Any ideas how to get it working?
It seems you don't have bundler gem. Try
gem install bundler

Failed to build gem native extension ( em-irc )

Trying to install em-irc, got that:
/usr/bin/ruby1.9.1 extconf.rb
/usr/local/lib/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)
from /usr/local/lib/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from extconf.rb:2:in `<main>'
Try running as root: sudo gem install em-irc

Trying to Run Ruby script in terminal but get ERROR

I am trying to run a ruby script to rename some files but I get the following error:
Eccleshall$ ruby rename.rb
<internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- ftools (LoadError)
from <internal:lib/rubygems/custom_require>:29:in `require'
from rename.rb:45:in `<main>'
Thanks for the help.
Change to script to say:
require "fileutils"
instead of
require "ftools"
ftools has been deprecated.

Help Getting Started with Mechanize

I'm new to Ruby and just installed Ruby for Windows.
I want to use the mechanize library (https://github.com/tenderlove/mechanize) and so I'm following the guide at https://github.com/tenderlove/mechanize/blob/master/GUIDE.rdoc.
On the Windows cmd line, I installed mechanize by using the cmd "gem install mechanize".
When I run the following code:
require 'rubygems'
require 'mechanize'
agent = Mechanize.new
I get the error:
<internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- net/http/digest_auth (LoadError)
from <internal:lib/rubygems/custom_require>:29:in `require'
from C:/Ruby192/lib/ruby/1.9.1/mechanize.rb:5:in `<top (required)>'
from <internal:lib/rubygems/custom_require>:29:in `require'
from <internal:lib/rubygems/custom_require>:29:in `require'
from helloworld.rb:2:in `<main>'
Anybody know what's going on?
It seems that some dependencies are missing. Try to install the net-http-digest_auth gem.
gem install net-http-digest_auth
If that solves this problem and another (related) pops up, it's probable that you are missing the net-http-persistent gem. If that's the case, you know what to do! Just install it too.

Resources