From owner-freebsd-questions@freebsd.org Mon Jan 25 19:07:32 2021 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 77F074ECD2D for ; Mon, 25 Jan 2021 19:07:32 +0000 (UTC) (envelope-from freebsd@dreamchaser.org) Received: from nightmare.dreamchaser.org (ns.dreamchaser.org [66.109.141.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "dreamchaser.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DPfWR2KwWz4s8T for ; Mon, 25 Jan 2021 19:07:30 +0000 (UTC) (envelope-from freebsd@dreamchaser.org) Received: from breakaway.dreamchaser.org (breakaway [192.168.151.122]) by nightmare.dreamchaser.org (8.15.2/8.15.2) with ESMTP id 10PJ7RXh033238; Mon, 25 Jan 2021 12:07:27 -0700 (MST) (envelope-from freebsd@dreamchaser.org) Reply-To: freebsd@dreamchaser.org Subject: Re: ruby pkg and user gem/bundle privilege mismatch To: Tomasz CEDRO , FreeBSD Mailing List References: <9c121e6b-f6d3-0734-22e3-16a7ad6dda72@dreamchaser.org> From: Gary Aitken Message-ID: <3b533461-c2bf-2068-d965-6ca6ed2c70e5@dreamchaser.org> Date: Mon, 25 Jan 2021 12:02:44 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (nightmare.dreamchaser.org [192.168.151.101]); Mon, 25 Jan 2021 12:07:27 -0700 (MST) X-Rspamd-Queue-Id: 4DPfWR2KwWz4s8T X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of freebsd@dreamchaser.org designates 66.109.141.57 as permitted sender) smtp.mailfrom=freebsd@dreamchaser.org X-Spamd-Result: default: False [-3.30 / 15.00]; HAS_REPLYTO(0.00)[freebsd@dreamchaser.org]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[66.109.141.57:from]; R_SPF_ALLOW(-0.20)[+mx]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; REPLYTO_ADDR_EQ_FROM(0.00)[]; DMARC_NA(0.00)[dreamchaser.org]; SPAMHAUS_ZRD(0.00)[66.109.141.57:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; RCVD_TLS_LAST(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:21947, ipnet:66.109.128.0/19, country:US]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[freebsd-questions] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2021 19:07:32 -0000 On 1/25/21 10:47 AM, Tomasz CEDRO wrote: > On 25.01.2021 18:26, Gary Aitken wrote: >> (..) I installed rails as root using "gem install rails --version >> '=5.2.4' What's the difference between a pkg install of rails and >> "rem install"? Is it possible to mix a system ruby installation and >> user gem installs? Do I need to install rvm in order to do that? > > Not sure about ruby but in Python you have system wide packages that > you install as root and you can use them but not modify as standard > user. > > Alternatively, you can install you own local Python Virtual > Environment (venv) as standard user, so you can get independent > working environment that does not depend nor modify the system > packages (except you only need Python and VENV packages). You can > then modify that local venv as standard user, add new packages, > remove packages, etc. You can even have multiple different virtual > environments separated for a different tasks (i.e. django web > development, zephyr embedded environment, etc). > > Summing up you should never install local packages as root to use > them as standard user. You should rather create your own small > virtual environment that you can fully control as standard user with > no impact to the system (or when you cannot modify system for > instance on the shared hosting environment). I have lang/ruby26 installed system-wide so it is available to everyone. > This may come helpful: > > https://stackoverflow.com/questions/486995/ruby-equivalent-of-virtualenv Thanks; rather confusing, but in this case setting the environment variable GEM_HOME seems to be all that was needed. Thanks, Gary