LoadError: cannot load such file -- feedtools

This problem is found when typing the following code into irb after
feedtools is installed:

irb(main):001:0> require ‘feedtools’
LoadError: cannot load such file – feedtools
from /usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in
require' from /usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb:36:inrequire’
from (irb):1
from /usr/local/bin/irb:12:in `’

And here is what the messages show during gem installation:

sudo gem install feedtools

FeedTool’s caching schema has changed to allow Feed objects to be
serialized to the cache. This should offer some limited speed up
in some cases.

Successfully installed feedtools-0.2.29
1 gem installed
Installing ri documentation for feedtools-0.2.29…
unable to convert “\xA6” from ASCII-8BIT to UTF-8 for
lib/feed_tools/vendor/html5/testdata/encoding/chardet/test_big5.txt,
skipping
Installing RDoc documentation for feedtools-0.2.29…
unable to convert “\xA6” from ASCII-8BIT to UTF-8 for
lib/feed_tools/vendor/html5/testdata/encoding/chardet/test_big5.txt,
skipping

Again, any help appreciated.

Please try the following:
$ require ‘feed_tools’

This gem follows the ruby naming convention: CamelCase => snake_case.

Thank you very much for the prompt reply.

The response will be as follows:

irb(main):001:0> require ‘feed_tools’
/usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in require': iconv will be deprecated in the future, use String#encode instead. SyntaxError: /usr/local/lib/ruby/gems/1.9.1/gems/feedtools-0.2.29/lib/feed_tools/helpers/uri_helper.rb:43: invalid multibyte char (US-ASCII) /usr/local/lib/ruby/gems/1.9.1/gems/feedtools-0.2.29/lib/feed_tools/helpers/uri_helper.rb:43: invalid multibyte char (US-ASCII) /usr/local/lib/ruby/gems/1.9.1/gems/feedtools-0.2.29/lib/feed_tools/helpers/uri_helper.rb:43: syntax error, unexpected $end, expecting ')' if IDN::Idna.toASCII('http://www.詹姆斯.com/') == ^ from /usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb:36:inrequire’
from /usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in
require' from /usr/local/lib/ruby/gems/1.9.1/gems/feedtools-0.2.29/lib/feed_tools/helpers/retrieval_helper.rb:25:in<top (required)>’
from /usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in
require' from /usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb:36:inrequire’
from
/usr/local/lib/ruby/gems/1.9.1/gems/feedtools-0.2.29/lib/feed_tools/feed.rb:27:in
<top (required)>' from /usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb:36:inrequire’
from /usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in
require' from /usr/local/lib/ruby/gems/1.9.1/gems/feedtools-0.2.29/lib/feed_tools.rb:170:in<top (required)>’
from /usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb:59:in
require' from /usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb:59:inrescue in require’
from /usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb:35:in
require' from (irb):1 from /usr/local/bin/irb:12:in

Plus, after “gem install heroku”, typed “heroku login”
the similar error message shows

/usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in require': cannot load such file -- readline (LoadError) from /usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb:36:inrequire’
from /usr/local/heroku/lib/heroku/command/run.rb:1:in <top (required)>' from /usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb:36:inrequire’
from /usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in
require' from /usr/local/heroku/lib/heroku/command.rb:14:inblock in
load’
from /usr/local/heroku/lib/heroku/command.rb:13:in each' from /usr/local/heroku/lib/heroku/command.rb:13:inload’
from /usr/bin/heroku:26:in `’

Any help appreciated please.

Ruby supposes the source files to be encoded in ASCII, but the file
</usr/local/lib/ruby/gems/1.9.1/gems/feedtools-0.2.29/lib/feed_tools/helpers/uri_helper.rb>
contains a non ASCII character on the line 43, which results in a
parsing error.
Under Ruby 1.8 it was possible to define the source encoding using the
<-K> option or with the $KCODE variable. Under Ruby 1.9 they are not the
preferred way.
The source file encoding can be provided in the source code itself by a
comment:

coding: utf-8

Since I’m using Emacs, I simply write:

-- encoding: utf-8 --

You can hack into the file mentioned above and add this comment on the
very top of the file.

You seem to have compiled Ruby from source. Ensure you’ve done it with
the readline support. Search for using your package
manager, e.g.:
$ aptitude search readline | grep ruby

  1. You are right, I can see the true response after adding that comment
    on the very top of the uri_helper.rb file. it seems that the problem is
    almost solved.
    Here is the message after the code

irb(main):001:0> require ‘feed_tools’
/usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require’:
iconv will be deprecated in the future, use String#encode instead.
=> true

  1. Here is another search result as well.
    aptitude search readline | grep ruby
    v libreadline-ruby -
    v libreadline-ruby1.8 -
    v libreadline-ruby1.9.1 -

I also tried to make and make install ruby again from the source code.
But it seems that nothing has changed. It might not be related to the
installation process.

p.s. I am new to Ruby, just try to experiment the power of it after some
readings

The second one, a solution is found. I need to install the readline.
To do so, I type
sudo apt-get install libreadline5-dev

And then go to my ruby directory, type
cd ext/readline
ruby extconf.rb
make
sudo make install

So, it works.

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