Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Mar 2010 01:21:56 GMT
From:      "Aaron D. Gifford" <astounding@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/144568: Ruby 1.9.1 has rubygems version 1.3.1 built in, but some gems require a newer version. 1.3.5 is available by the ports, but needs the following changes.
Message-ID:  <201003090121.o291Lu17079143@www.freebsd.org>
Resent-Message-ID: <201003090130.o291U1t1016624@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         144568
>Category:       ports
>Synopsis:       Ruby 1.9.1 has rubygems version 1.3.1 built in, but some gems require a newer version.  1.3.5 is available by the ports, but needs the following changes.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Tue Mar 09 01:30:00 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Aaron D. Gifford
>Release:        8.0-STABLE
>Organization:
>Environment:
FreeBSD example.org 8.0-STABLE FreeBSD 8.0-STABLE #0: Wed Jan 27 19:46:39 MST 2010     root@example.org:/usr/obj/usr/src/sys/VIN.TAMBLER.COM  amd64

>Description:
When using Ruby 1.9.1, rubygems version 1.3.1 comes built-in.  However, some gems want the newer version.  There are two ways to achieve this:

1) Do 'gem update --system' and have rubygems do the update

PROBLEM: This will break installed gems and mess up the gem environment requiring manual patching of the file /usr/local/lib/ruby/site_ruby/1.9/rubygems/defaults.rb to correct the gem environment paths.

The other alternative is:

2) Use the devel/ruby-gems port.

PROBLEM: The port is disabled when using Ruby 1.9.  This is a BUG and should be fixed/removed, since 1.3.5 is the latest rubygems port version and 1.3.1 (older) is the built-in version.  Users will WANT to install the port to get a FreeBSD-compatible update of the gem system.

SOLUTION to PROBLEM #2:

Apply this patch (or one that accomplishes something similar) to the port Makefile, and add a new patch file that fixes the gem environment.


>How-To-Repeat:
See above.  See patches below for fix.
>Fix:
PATCH TO MAKEFILE:

Also available online at:
  http://www.aarongifford.com/ruby-gems-makefile-patch.txt

--- Makefile.orig	2010-03-08 17:49:32.247247288 -0700
+++ Makefile	2010-03-08 18:08:25.939477863 -0700
@@ -43,9 +43,7 @@
 
 .include <bsd.port.pre.mk>
 
-.if ${RUBY_VER} == 1.9
-IGNORE=	already included in this ruby distribution
-.endif
+RUBYSTVER=${RUBY_VER:S/.//g}
 
 do-install:
 	cd ${WRKSRC}; ${RUBY} ${RUBY_SETUP} ${RUBY_SETUP_OPTIONS}
@@ -53,7 +51,7 @@
 post-install:
 	@${MKDIR} ${PREFIX}/${GEMS_DOC_BASE_DIR}/
 	@${TOUCH} ${PREFIX}/${GEMS_DOC_BASE_DIR}/.keep_this
-	@${LN} -sf ${PREFIX}/bin/gem18 ${PREFIX}/bin/gem
+	@${LN} -sf ${PREFIX}/bin/gem${RUBYSVER} ${PREFIX}/bin/gem
 
 .if !defined(NOPORTDOCS)
 	@${FIND} -ds ${PREFIX}/lib/ruby/gems/${RUBY_VER}/doc/${DISTNAME} \
@@ -69,8 +67,8 @@
 # This target is only meant to be used by the port maintainer.
 x-generate-plist:
 	${ECHO} bin/gem > pkg-plist.new
-	${ECHO} bin/gem18 >> pkg-plist.new
-	${ECHO} bin/update_rubygems18 >> pkg-plist.new
+	${ECHO} bin/gem${RUBYSVER} >> pkg-plist.new
+	${ECHO} bin/update_rubygems${RUBYSVER} >> pkg-plist.new
 	${ECHO} ${GEMS_VER_DIR_P}/cache/sources-0.0.2.gem >> pkg-plist.new
 	${FIND} ${PREFIX}/${GEMS_VER_DIR}/gems/sources-0.0.2 -type f | ${SORT} | ${SED} -e 's,${PREFIX}/${GEMS_VER_DIR},${GEMS_VER_DIR_P},' >> pkg-plist.new
 	${ECHO} ${GEMS_VER_DIR_P}/specifications/sources-0.0.2.gemspec >> pkg-plist.new







PATCH TO GEM ENVIRONMENT SO THE PATH IS FREEBSD COMPATIBLE:

Belongs in:
  /usr/ports/devel/ruby-gemsfiles/patch-lib__rubygems__defaults.rb

Also available online at:
  http://www.aarongifford.com/ruby-gems-patch-lib__rubygems__defaults.rb.txt

--- lib/rubygems/defaults.rb.orig	2010-03-08 17:55:51.672926090 -0700
+++ lib/rubygems/defaults.rb	2010-03-08 17:55:58.233799211 -0700
@@ -20,10 +20,6 @@
     if defined? RUBY_FRAMEWORK_VERSION then
       File.join File.dirname(ConfigMap[:sitedir]), 'Gems',
                 ConfigMap[:ruby_version]
-    # 1.9.2dev reverted to 1.8 style path
-    elsif RUBY_VERSION > '1.9' and RUBY_VERSION < '1.9.2' then
-      File.join(ConfigMap[:libdir], ConfigMap[:ruby_install_name], 'gems',
-                ConfigMap[:ruby_version])
     else
       File.join(ConfigMap[:libdir], ruby_engine, 'gems',
                 ConfigMap[:ruby_version])


>Release-Note:
>Audit-Trail:
>Unformatted:



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