From owner-freebsd-ruby@freebsd.org Tue Jan 3 00:08:06 2017 Return-Path: Delivered-To: freebsd-ruby@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67720C9C802 for ; Tue, 3 Jan 2017 00:08:06 +0000 (UTC) (envelope-from jjuanino@gmail.com) Received: from mail-wm0-x22e.google.com (mail-wm0-x22e.google.com [IPv6:2a00:1450:400c:c09::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F17841FB4 for ; Tue, 3 Jan 2017 00:08:05 +0000 (UTC) (envelope-from jjuanino@gmail.com) Received: by mail-wm0-x22e.google.com with SMTP id a197so374211884wmd.0 for ; Mon, 02 Jan 2017 16:08:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version:content-disposition :content-transfer-encoding:user-agent; bh=fNl6DtqC7fw8C8eRFUw4h/RNGLhOAPxSASF7LfzKsi4=; b=GTRmObMx4W0GhbZYe3uXsMyVZBBFOTTKAVslcElYtGMKzjdI5AuKeg9PpIRwzMoJAt E1Cn+udH0VYy+GNEADikuqU/W5ruQ/GJXYsT7y2vWXp2Y/WcSyMBFxMIadUtpbxJfujR a7qFvyutJpE2jvAMad8uuod/DnlrxAcfU5iOHzLd6nuynLQbKtA9bV7sRSzf7N3e+P2S Qk+CGMWh/GjHFymWwSYOj+9NjrKBrW26hsgvIxu34zFVmK/dh+IcIRxby0zS8+64k5me Xm42X9tWBXnS1FzFfdJ5Q71OHHpfhNbpnSAgVgQmHC/eG3RTEj7faP7vduZt0UHoPBt7 V7ZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:content-transfer-encoding:user-agent; bh=fNl6DtqC7fw8C8eRFUw4h/RNGLhOAPxSASF7LfzKsi4=; b=Et3nADe5Jre1p6Jbj5ucqoHSuO9g90zfZKM289fmP9QMPbT4ndyD5MH3fJQ2clq1Mr DJbW3WQI5YhyX1lRXr2ynf9XFhSJWbrrmVvNor9kVtuRQKlErUmqcwMjB0xGE9Ze5iYM VrePXVCb2pnL/z4fAMt+Qn436M8tF+EOEFOvPdOzQWUtP4s5Yuu0y+tutF8vsb4ZDFFz esy/Ue9v/96W9FX3FYgCvAgproQn5YFltwQ8v44Ix8Itb7Qc7O5z3vg8YbtZTcZFjCEV 93gAws5D7bex29gJkN4lQA4jWRfQEB0Cpy5zbf2G+a2cZnDheafUNZaZcVSgbEreOyyU rxqQ== X-Gm-Message-State: AIkVDXJM5AcBfWekZ7d1xoxrfHhYROrDHkOV2vw/ip4vEEJW6XMaBY02m8GHUm4E4YMFeg== X-Received: by 10.28.22.193 with SMTP id 184mr52328249wmw.100.1483402082694; Mon, 02 Jan 2017 16:08:02 -0800 (PST) Received: from abel.home.inet (79.108.83.135.dyn.user.ono.com. [79.108.83.135]) by smtp.gmail.com with ESMTPSA id l67sm86509869wmf.20.2017.01.02.16.08.01 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 02 Jan 2017 16:08:02 -0800 (PST) Date: Tue, 3 Jan 2017 01:07:58 +0100 From: =?iso-8859-1?Q?Jos=E9_G=2E?= Juanino To: freebsd-ruby@freebsd.org Subject: PREFIX enviroment variable pollutes gem search path Message-ID: <20170103000758.pnoglvxtseec2xpn@abel.home.inet> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Operating-System: FreeBSD 11.0-RELEASE-p2 User-Agent: NeoMutt/20161126 (1.7.1) X-BeenThere: freebsd-ruby@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: FreeBSD-specific Ruby discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2017 00:08:06 -0000 Hi, I am suffering an annoying issue loading gem libraries; I am not sure if it is FreeBSD specific. Install some gem, for example rubygem-test-unit-3.1.9, and take a look at the following code: $ ruby22 -r test/unit -e 'puts' $ PREFIX=1 ruby22 -r test/unit -ne 'puts' /usr/local/lib/ruby/site_ruby/2.2/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- test/unit (LoadError) from /usr/local/lib/ruby/site_ruby/2.2/rubygems/core_ext/kernel_require.rb:55:in `require' In short: you cannot load any gem if your environment contains the PREFIX variable. When this happens, ruby uses the assigned value instead of /usr/local to search the proper files. This breaks a lot of existent code. The relevant ports are, installed via pkg: ruby-2.2.5_1,1 ruby22-gems-2.6.4 ruby23-2.3.1_1,1 The FreeBSD version is 11.0-RELEASE. This issue did not happen in ruby20, I think. Regards -- José G. Juanino