Date: Mon, 25 Jan 2021 12:02:44 -0700 From: Gary Aitken <freebsd@dreamchaser.org> To: Tomasz CEDRO <tomek@cedro.info>, FreeBSD Mailing List <freebsd-questions@freebsd.org> Subject: Re: ruby pkg and user gem/bundle privilege mismatch Message-ID: <3b533461-c2bf-2068-d965-6ca6ed2c70e5@dreamchaser.org> In-Reply-To: <e58efa18-3f79-997f-a93a-7ef7e53707a3@cedro.info> References: <9c121e6b-f6d3-0734-22e3-16a7ad6dda72@dreamchaser.org> <e58efa18-3f79-997f-a93a-7ef7e53707a3@cedro.info>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3b533461-c2bf-2068-d965-6ca6ed2c70e5>