ruby pkg and user gem/bundle privilege mismatch
Gary Aitken
freebsd at dreamchaser.org
Mon Jan 25 19:07:32 UTC 2021
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
More information about the freebsd-questions
mailing list