Rbenv for production with passenger

I am trying to install rbenv on my Debian 6 system for production. What is the best way to do this? I tried some links on the github wiki page (https://github.com/sstephenson/rbenv/wiki/Using-rbenv-in-production and https://github.com/sstephenson/rbenv/wiki/shared-install-of -rbenv ), but I wonder what the best practice is.

Is it better to install it by deploying a user or system? With the deployment user, it seems that rubies are not available to all users, even if I install it using rbenv global 1.9.3-p125 , and the gem commando is also not available. It must be something with my paths, because I only included

 if [[ -d $HOME/.rbenv ]]; then export PATH="$HOME/.rbenv/bin:$PATH" eval "$(rbenv init -)" fi 

in my user deployment .bashrc file. Does the passenger / apache know where my rubies are? Since apache works with www-data user.

With a system installation (see the link to the general installation above), I ran into some strange error that the rbenv command was not found and could not be compiled.

So what should I do? I want to use it for my production server so that I can easily switch between rubies in the future.

+4
source share
2 answers

I personally would go along the user's deployment route and use the rbenv-sudo plugin for cross cases such as a passenger setting, chef or something like that. I think most people do not use or rbenv rvm for production, so the number of people stuck on 1.8 . This is a shame because, as you said, it would be nice to easily switch Ruby versions. Having said that, production should not switch Ruby, which is often correct? You can easily manage ruby ​​versions yourself using the configure flags from the Ruby source. Just do not install in / usr / bin.

Sstephenson says the general installation is experimental in this shared-install-of-rbenv link. Rbenv global is not going to do anything through user accounts. It is global in the user account.

Outside of a user deployment, how many accounts do you need for production?

+1
source

you must indicate that the user (who uses the passenger) has the privilege of access to your rbenv.

0
source

Source: https://habr.com/ru/post/1401013/


All Articles