How to set library path for FileUtils

What is the correct way to set library paths to remove this error when
using FileUtils?

‘require’: no such file to load – FileUtils (LoadError)


Here is the environment listing:

ruby1.9.1 -e “puts $:”
/var/lib/gems/1.9.1/gems/kramdown-0.10.0/bin
/var/lib/gems/1.9.1/gems/kramdown-0.10.0/lib
/usr/local/lib/site_ruby/1.9.1
/usr/local/lib/site_ruby/1.9.1/i486-linux
/usr/local/lib/site_ruby
/usr/lib/ruby/vendor_ruby/1.9.1
/usr/lib/ruby/vendor_ruby/1.9.1/i486-linux
/usr/lib/ruby/vendor_ruby
/usr/lib/ruby/1.9.1
/usr/lib/ruby/1.9.1/i486-linux
.


fileutils.rb is installed - if I replace << require ‘FileUtils’ >> with
<< require ‘/usr/lib/ruby/1.9.1/fileutils.rb’ >> my program runs.


I’m running Linux Mint 9 Isadora and I installed Ruby and Rubygems with
apt-get.

Thanks!

2010/8/19 Mark M. [email protected]:

What is the correct way to set library paths to remove this error when
using FileUtils?

Normally there should be no change necessary since it’s part of the std
lib.

/usr/local/lib/site_ruby/1.9.1/i486-linux
fileutils.rb is installed - if I replace << require ‘FileUtils’ >> with
<< require ‘/usr/lib/ruby/1.9.1/fileutils.rb’ >> my program runs.

??? That should not happen. Since /usr/lib/ruby/1.9.1 is in $: it
must be found. How exactly do you require?


I’m running Linux Mint 9 Isadora and I installed Ruby and Rubygems with
apt-get.

Kind regards

robert

On Thu, Aug 19, 2010 at 12:23 PM, Mark M.
[email protected] wrote:

What is the correct way to set library paths to remove this error when
using FileUtils?

‘require’: no such file to load – FileUtils (LoadError)

Use:

require 'fileutils'

The FileUtils module is defined in the “fileutils.rb” file, hence the
lowercase.

– fxn

Xavier N. wrote:

require 'fileutils'

The FileUtils module is defined in the “fileutils.rb” file, hence the
lowercase.

Thank you - this was the problem. Uppercase works on my Windows
installation of Ruby, hence the confusion.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs