Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Jan 2010 18:54:42 -0700
From:      Aaron Gifford <astounding@gmail.com>
To:        Stanislav Sedov <stas@freebsd.org>, freebsd-ruby@freebsd.org
Subject:   Re: Ruby Gem Require LoadError (8-STABLE, Ruby 1.9.1)
Message-ID:  <e58000751001281754g50a65ab8idbe4d9048d11ced6@mail.gmail.com>
In-Reply-To: <20100128165027.f510a468.stas@FreeBSD.org>
References:  <e58000751001281133v42a6613dm61a0c2c7922df93d@mail.gmail.com> <20100128120819.a15e60e0.stas@FreeBSD.org> <e58000751001281326n5fe5f7d9h148c4638cef54434@mail.gmail.com> <20100128143157.e1fd05a4.stas@FreeBSD.org> <e58000751001281611w217e8927td9f7385819409ab3@mail.gmail.com> <20100128165027.f510a468.stas@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Jan 28, 2010 at 5:50 PM, Stanislav Sedov <stas@freebsd.org> wrote:
> On Thu, 28 Jan 2010 17:11:53 -0700
> Aaron Gifford <astounding@gmail.com> mentioned:
>
>> 2010/1/28 Stanislav Sedov <stas@freebsd.org> said:
>> > Oh, so you have ruby 1.9 as a default version?
>>
>> Yes, I manually symlinked all /usr/local/bin/*19 executables to make
>> 1.9 my default ruby. =A0(I much prefer 1.9 :)
>>
>
> Oh, that might be a problem. =A0Use RUBY_VER=3D1.9 in make.conf instead.

I'll immediately give that a try.  However, it seems that it ought NOT
to be an issue, as I didn't symlink stuff until AFTER I built and
installed ruby 1.9.1 AND all the ports (gems).  Only THEN did I create
the symlinks.

Oh, okay.  I get it.  By default, the ruby based ports are expecting
to be installed with 1.8, and even though the build and install WORKS
with 1.9, since I did not set RUBY_VER to 1.9 in make.conf when I
built them. So something somewhere is still thinking "1.8" whether or
not 1.8 even existed (and it did not on my system).


I just uninstalled all gems and ruby related ports, then rebuilt with
RUBY_VER=3D1.9 in /etc/make.conf.  NOTE: The net/ssh gem was rebuilt and
reinstalled with the ports system.  The mtik gem was directly
installed with 'gem19 install mtik-3.0.1.gem' from the command-line.
I wanted to see if installation method made a different.

ALSO when make was building/installing the gems, I noted these lines
in the output:

=3D=3D=3D>  Cleaning for rubygem-net-ssh-2.0.15
=3D=3D=3D>  Vulnerability check disabled, database not found
=3D=3D=3D>  Extracting for rubygem-net-ssh-2.0.15
=3D> MD5 Checksum OK for rubygem/net-ssh-2.0.15.gem.
=3D> SHA256 Checksum OK for rubygem/net-ssh-2.0.15.gem.
=3D=3D=3D>   rubygem-net-ssh-2.0.15 depends on file: /usr/local/bin/ruby19 =
- found
=3D=3D=3D>  Patching for rubygem-net-ssh-2.0.15
=3D=3D=3D>   rubygem-net-ssh-2.0.15 depends on file: /usr/local/bin/ruby19 =
- found
=3D=3D=3D>   rubygem-net-ssh-2.0.15 depends on file: /usr/local/bin/ruby19 =
- found
=3D=3D=3D>  Configuring for rubygem-net-ssh-2.0.15
=3D=3D=3D>  Installing for rubygem-net-ssh-2.0.15
=3D=3D=3D>   rubygem-net-ssh-2.0.15 depends on file: /usr/local/bin/ruby19 =
- found
=3D=3D=3D>   Generating temporary packing list
=3D=3D=3D>  Checking if security/rubygem-net-ssh already installed
/usr/bin/env  /usr/local/bin/gem19 install -l --no-update-sources
--no-ri --install-dir /usr/local/lib/ruby/gems/1.9
/var/ports/distfiles/rubygem/net-ssh-2.0.15.gem   -- --build-args
Successfully installed net-ssh-2.0.15
1 gem installed
Installing RDoc documentation for net-ssh-2.0.15...
=3D=3D=3D>   Registering installation for rubygem-net-ssh-2.0.15

Looking at the above install, the 'gem19' install looks like I think
it ought to.


NOW FOR the BIG TEST:

user@host:/home/user% irb19
irb(main):001:0> require 'net/ssh'
LoadError: no such file to load -- net/ssh
        from (irb):1:in `require'
        from (irb):1
        from /usr/local/bin/irb19:12:in `<main>'
irb(main):002:0> require 'mtik'
LoadError: no such file to load -- mtik
        from (irb):2:in `require'
        from (irb):2
        from /usr/local/bin/irb19:12:in `<main>'
irb(main):003:0> gem 'net-ssh'
Gem::LoadError: Could not find RubyGem net-ssh (>=3D 0)

        from <internal:gem_prelude>:244:in `push_gem_version_on_load_path'
        from <internal:gem_prelude>:14:in `gem'
        from (irb):3
        from /usr/local/bin/irb19:12:in `<main>'
irb(main):004:0> gem 'mtik'
Gem::LoadError: Could not find RubyGem mtik (>=3D 0)

        from <internal:gem_prelude>:244:in `push_gem_version_on_load_path'
        from <internal:gem_prelude>:14:in `gem'
        from (irb):4
        from /usr/local/bin/irb19:12:in `<main>'
irb(main):005:0> require 'rubygems'
=3D> true
irb(main):006:0> require 'mtik'
LoadError: no such file to load -- mtik
        from (irb):6:in `require'
        from (irb):6
        from /usr/local/bin/irb19:12:in `<main>'
irb(main):007:0> require 'net/ssh'
LoadError: no such file to load -- net/ssh
        from (irb):7:in `require'
        from (irb):7
        from /usr/local/bin/irb19:12:in `<main>'
irb(main):008:0> gem 'mtik'
=3D> true
irb(main):009:0> require 'mtik'
=3D> true
irb(main):010:0> require 'net/ssh'
LoadError: no such file to load -- net/ssh
        from (irb):10:in `require'
        from (irb):10
        from /usr/local/bin/irb19:12:in `<main>'
irb(main):011:0> gem 'net-ssh'
=3D> true
irb(main):012:0> require 'net/ssh'
=3D> true
irb(main):013:0>



Argh!  The same problem.

So I removed all ruby ports and tried yet again using
RUBY_DEFAULT_VER=3D1.9 in /etc/make.conf.  Output of the build looked
similar (as above).  And the end result was identical: all attempts to
require the ports failed.



A HA!

This helps:

GEM_HOME=3D/usr/local/lib/ruby/gems/1.9/ irb19
irb(main):001:0> require 'net/ssh'
=3D> true

So if I manually set $GEM_HOME, things work.

Any ideas what might be happening, anyone?

Aaron out.


P.S.
Thanks for your help, Stanislav.  I appreciate your suggestions.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?e58000751001281754g50a65ab8idbe4d9048d11ced6>