From owner-freebsd-ports@FreeBSD.ORG Mon Apr 13 11:33:34 2009 Return-Path: Delivered-To: freebsd-ports@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D9801065735 for ; Mon, 13 Apr 2009 11:33:34 +0000 (UTC) (envelope-from kim@westryn.net) Received: from mail3.westryn.net (mail3.westryn.net [98.124.190.3]) by mx1.freebsd.org (Postfix) with ESMTP id F2D1C8FC13 for ; Mon, 13 Apr 2009 11:33:33 +0000 (UTC) (envelope-from kim@westryn.net) Received: from sneffels.westryn.net (204.16.225.169.westryn.net [204.16.225.169]) by mail3.westryn.net (Postfix) with ESMTP id 4B63444A41C for ; Mon, 13 Apr 2009 06:14:24 -0500 (CDT) Message-Id: From: Kim Shrier To: freebsd-ports@FreeBSD.org Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v930.3) Date: Mon, 13 Apr 2009 05:17:30 -0600 X-Mailer: Apple Mail (2.930.3) Cc: Subject: require gem is not working for ruby19 X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2009 11:33:38 -0000 Hello, I am running FreeBSD 7.1 RELENG and I have installed ruby 1.9 using the port in /usr/ports/lang/ruby19. I have installed a gem named tmail that I want to include in my script. According to the ruby docs, I should be able to just say: require 'tmail' However, this fails and reports that it cannot find the gem. If I use the folloowing statements: require 'rubygems' gem 'tmail' require 'tmail' I can load the gem and use it. I also get 20 or so warning messages like the following: /usr/local/lib/ruby/1.9/rubygems/defaults.rb:11: warning: method redefined; discarding old default_sources /usr/local/lib/ruby/1.9/rubygems/defaults.rb:19: warning: method redefined; discarding old default_dir /usr/local/lib/ruby/1.9/rubygems/defaults.rb:31: warning: method redefined; discarding old user_dir /usr/local/lib/ruby/1.9/rubygems/defaults.rb:39: warning: method redefined; discarding old default_path ... /usr/local/lib/ruby/1.9/rubygems.rb:46: warning: method redefined; discarding old gem /usr/local/lib/ruby/1.9/rubygems.rb:306: warning: method redefined; discarding old dir ... It would appear that I am redefining methods that are already defined, both with the require 'rubygems' statement and the gem 'tmail' statement. However, if I don't include these 2 statements in my source, the require 'tmail' statement fails with the following error: ./test.rb:24:in `require': no such file to load -- tmail (LoadError) from ./test.rb:24:in `
' Is there some problem with the rubygems support that is built in to ruby19? Thanks, Kim -- Kim Shrier - principal, Shrier and Deihl - mailto:kim@westryn.net Remote Unix Network Admin, Security, Internet Software Development westryn.net - Superior FreeBSD-based Web Hosting http://www.westryn.net/