[Ruby FAQs] Cannot load such file — xmlrpc/client (LoadError)

xmlrpc/client (LoadError)

This problem is that starting in Ruby 2.4.0, the xmlrpc library that was before bundled with ruby has been extracted to a gem.

1
/Users/cloudolife/.rvm/gems/ruby-2.5.9@camp/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:274:in `require': cannot load such file -- xmlrpc/client (LoadError)

So you must just add this to your Gemfile file and bundle again.

Installation

You can install it as a gem:

1
$ gem install xmlrpc

or add it into a Gemfile (Bundler):

1
2
3
4
5
# Gemfile

# GitHub - ruby/xmlrpc: The Ruby standard library package 'xmlrpc'
# https://github.com/ruby/xmlrpc
gem 'xmlrpc', '0.2.1'

Then, run bundle install.

1
$ bundle install

References

[1] ubuntu - Ruby fog gem causing server not to run: cannot load such file – xmlrpc/client (LoadError) - Stack Overflow - https://stackoverflow.com/questions/41784012/ruby-fog-gem-causing-server-not-to-run-cannot-load-such-file-xmlrpc-client

[2] GitHub - ruby/xmlrpc: The Ruby standard library package ‘xmlrpc’ - https://github.com/ruby/xmlrpc

[3] xmlrpc | RubyGems.org | your community gem host - https://rubygems.org/gems/xmlrpc/