You are not logged in.

#1 2010-09-03 12:04:21

Rydgel
Member
From: France
Registered: 2008-09-04
Posts: 166
Website

[SOLVED] Ruby 1.9.2

I can't get the new Ruby to work. It's ruby 1.9.2 from Extra. Here is what I get when I run gem:

[root@xhkr ruby]# gem
/usr/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:68:in `installed_spec_directories': undefined method `path' for Gem:Module (NoMethodError)
    from /usr/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:58:in `from_installed_gems'
    from /usr/lib/ruby/site_ruby/1.9.1/rubygems.rb:883:in `source_index'
    from /usr/lib/ruby/site_ruby/1.9.1/rubygems/gem_path_searcher.rb:81:in `init_gemspecs'
    from /usr/lib/ruby/site_ruby/1.9.1/rubygems/gem_path_searcher.rb:13:in `initialize'
    from /usr/lib/ruby/site_ruby/1.9.1/rubygems.rb:841:in `new'
    from /usr/lib/ruby/site_ruby/1.9.1/rubygems.rb:841:in `block in searcher'
    from <internal:prelude>:10:in `synchronize'
    from /usr/lib/ruby/site_ruby/1.9.1/rubygems.rb:840:in `searcher'
    from /usr/lib/ruby/site_ruby/1.9.1/rubygems.rb:479:in `find_files'
    from /usr/lib/ruby/site_ruby/1.9.1/rubygems.rb:983:in `load_plugins'
    from /usr/lib/ruby/site_ruby/1.9.1/rubygems.rb:1139:in `<top (required)>'
    from <internal:lib/rubygems/custom_require>:29:in `require'
    from <internal:lib/rubygems/custom_require>:29:in `require'
    from /usr/bin/gem:8:in `<main>'

I think the package is not correctly built, I don't understand why there is still 1.9.1 in the path.
I tried to remove the package, reinstall.. Same problem.

But with my PKGBUILD it works :

# $Id: PKGBUILD 84971 2010-07-06 01:35:46Z eric $
# Maintainer: Allan McRae <allan@archlinux.org>
# Contributor: John Proctor <jproctor@prium.net>
# Contributor: Jeramy Rutley <jrutley@gmail.com>

pkgname=('ruby' 'ruby-docs')
pkgver=1.9.2_p0
_pkgver=1.9.2-p0
_version=1.9.2
pkgrel=1
pkgdesc="An object-oriented language for quick and easy programming"
arch=('i686' 'x86_64')
url="http://www.ruby-lang.org/en/"
license=('custom')
makedepends=('gdbm' 'db' 'openssl' 'zlib' 'readline' 'tk')
options=('!emptydirs')
source=("ftp://ftp.ruby-lang.org/pub/ruby/1.9/${pkgname}-${_pkgver}.tar.bz2")
md5sums=('d8a02cadf57d2571cd4250e248ea7e4b')
sha1sums=('c0fc7e1047f1eac7e554e9818513593b0d398698')

build() {
  cd "${srcdir}/${pkgname}-${_pkgver}"
  # see http://cvs.fedoraproject.org/viewvc/rpms/ruby/devel/
  #patch -p1 -i "${srcdir}/openssl-1.0.patch"
  ./configure --prefix=/usr --enable-shared --enable-pthread --with-ruby-version=${_version}
  make
}

package_ruby()
{
  depends=('gdbm' 'db' 'openssl' 'zlib' 'readline')
  provides=('rubygems' 'rake')
  conflicts=('rubygems' 'rake')
  optdepends=('tk: for Ruby/TK')

  cd "${srcdir}/${pkgname}-${_pkgver}"
  make DESTDIR="${pkgdir}" install
  install -Dm644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/COPYING"
}

package_ruby-docs()
{
  pkgdesc="Documentation files for ruby"
  #arch=('any')
  depends=('ruby')

  cd "${srcdir}/${pkgname}-${_pkgver}"
  make -j1 DESTDIR="${pkgdir}" install-doc
  install -Dm644 COPYING "${pkgdir}/usr/share/licenses/ruby-docs/COPYING"
}

The only difference is "--with-ruby-version=${_version}".

Has anyone the same problem with the pre-compiled package of Ruby ?

Edit : Working fine in my desktop box. So the Ruby from pacman is ok. Don't understand this strange behavior on my server. How can I remove *everything* from the ruby package, to try to reinstall it properly ?

Last edited by Rydgel (2010-09-06 08:18:46)

Offline

#2 2010-09-03 13:24:41

giddie
Member
From: Birmingham, UK
Registered: 2009-03-25
Posts: 125

Re: [SOLVED] Ruby 1.9.2

I see exactly the same problem.  I'm guessing I'll need to install my gems again for 1.9.2, so I've just reverted back to 1.9.1 for now.

Offline

#3 2010-09-03 15:34:44

awkwood
Member
From: .au <=> .ca
Registered: 2009-04-23
Posts: 91

Re: [SOLVED] Ruby 1.9.2

The path will continue to be 1.9.1 for the time being.
The info below comes from the 1.9.2 release announcement late last month.
http://blade.nagaokaut.ac.jp/cgi-bin/sc … alk/367983

== FAQ
:The standard library is installed in /usr/local/lib/ruby/1.9.1
  This version number is "library compatibility version".  Ruby 1.9.2 is
mostly compatible with the 1.9.2, so its library is installed in the
directory.

Regarding the error message, it's because Rubygems are now built into Ruby 1.9.
Try renaming the rubygems.rb file in site_ruby (/usr/lib/ruby/site_ruby/1.9.1/rubygems.rb) to rubygems.bak and try again.
This shouldn't affect your installed gems.

You could also fetch and build the latest version of Rubygems from GitHub.
http://github.com/rubygems/rubygems.git

Cheers!

Last edited by awkwood (2010-09-03 15:46:59)

Offline

#4 2010-09-03 22:17:47

mefistofeles
Member
Registered: 2010-09-03
Posts: 3

Re: [SOLVED] Ruby 1.9.2

Thanks awkwood, that solved the problem in my case.

Offline

#5 2010-09-06 08:18:16

Rydgel
Member
From: France
Registered: 2008-09-04
Posts: 166
Website

Re: [SOLVED] Ruby 1.9.2

Thanks mate, problem solved

Offline

#6 2010-09-09 19:36:50

Xiong Chiamiov
Member
From: central coast, california
Registered: 2008-06-18
Posts: 142
Website

Re: [SOLVED] Ruby 1.9.2

Would've been nice if this was in post_upgrade() wink.

Offline

#7 2010-10-20 23:52:49

tzar
Member
From: Australia
Registered: 2008-08-26
Posts: 21
Website

Re: [SOLVED] Ruby 1.9.2

Encountered this problem today, thank you very much for the solution :-)

Offline

#8 2011-02-02 19:45:14

hughitt1
Member
Registered: 2010-02-18
Posts: 82
Website

Re: [SOLVED] Ruby 1.9.2

Same problem here. Renaming didn't help though:

/usr/lib/ruby/site_ruby/1.9.1/rubygems/gem_runner.rb:14:in `<top (required)>': undefined method `load_env_plugins' for Gem:Module (NoMethodError)
    from <internal:lib/rubygems/custom_require>:29:in `require'
    from <internal:lib/rubygems/custom_require>:29:in `require'
    from /usr/bin/gem:9:in `<main>'

Offline

#9 2011-02-02 21:51:46

awkwood
Member
From: .au <=> .ca
Registered: 2009-04-23
Posts: 91

Re: [SOLVED] Ruby 1.9.2

Hi hughitt1,

Actually it's a different problem, with a different error message smile

What version of Rubygems are you running?

gem -v

There is a known issue installing Rubygems 1.4 on Ruby 1.9.x but Rubygems 1.5 has just been released.
You can upgrade by running:

gem update --system

More info here and here

Offline

#10 2011-02-03 14:11:40

hughitt1
Member
Registered: 2010-02-18
Posts: 82
Website

Re: [SOLVED] Ruby 1.9.2

Hi awkwood,

I probably should have clarified things a little more: I actually do get the same error message as the original poster. For instance, when I try to update gem as you suggested I get:

sudo gem update --system
Password: 
/usr/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:62:in `installed_spec_directories': undefined method `path' for Gem:Module (NoMethodError)
    from /usr/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:52:in `from_installed_gems'
    from /usr/lib/ruby/site_ruby/1.9.1/rubygems.rb:914:in `source_index'
    from /usr/lib/ruby/site_ruby/1.9.1/rubygems/gem_path_searcher.rb:83:in `init_gemspecs'
    from /usr/lib/ruby/site_ruby/1.9.1/rubygems/gem_path_searcher.rb:13:in `initialize'
    from /usr/lib/ruby/site_ruby/1.9.1/rubygems.rb:873:in `new'
    from /usr/lib/ruby/site_ruby/1.9.1/rubygems.rb:873:in `searcher'
    from /usr/lib/ruby/site_ruby/1.9.1/rubygems.rb:495:in `find_files'
    from /usr/lib/ruby/site_ruby/1.9.1/rubygems.rb:1034:in `load_plugins'
    from /usr/lib/ruby/site_ruby/1.9.1/rubygems/gem_runner.rb:84:in `<top (required)>'
    from <internal:lib/rubygems/custom_require>:29:in `require'
    from <internal:lib/rubygems/custom_require>:29:in `require'
    from /usr/bin/gem:9:in `<main>'

When I tried using the above renaming fix, however, that is when I got the other error message in my above post.

I'm running ruby 1.9.2:

ruby -v
ruby 1.9.2p136 (2010-12-25 revision 30365) [i686-linux]

I'll try taking a look at the links you posted.

Thanks for the suggestions smile

Best,
Keith

Offline

#11 2011-09-02 09:56:48

NicolaOrritos
Member
Registered: 2011-09-02
Posts: 4

Re: [SOLVED] Ruby 1.9.2

I solved by using the following commands:
$ sudo pacman -U /var/cache/pacman/pkg/ruby-1.9.1_p429-1-x86_64.pkg.tar.xz  [or equivalent 1.9.1 version]
$ sudo gem update --system
$ sudo pacman -S ruby  [to return to the new ruby (1.9.2)]

Now everything seems to work fine.

Nicola

Offline

Board footer

Powered by FluxBB