문제

I need to host different Ruby applications on a single server. Applications have mutually-incompatible ruby versions and gems. Is there a way to install RVM in system-wide mode and have gemsets which are also system-wide, and not tied to a specific user and their $HOME directory? Or is there a better approach altogether for hosting different Ruby apps on the same machine?

도움이 되었습니까?

해결책

Use mixed mode installation of RVM basically you get system installation and as every user that should have his own gemsets run:

rvm user gemsets

다른 팁

Because of numerous problems with RVM in system-wide mode (rvmsudo not working, directories being created in filesystem root by RVM, etc.) I've decided to go down the vendor/bundle route.

I installed ruby 1.9.3 w/ latest patches using my distro's package manager and then ran gem install bundler --no-user-install which installed bundler gem system wide.

I then ran in each app's directory bundle install --path vendor/bundle --without development test which installed required production gems in app's vendor/bundle directory. If there were any rake tasks or plain ruby files to run as part of app's setup then those were prefixed with bundle exec ... (which uses the gem environment from vendor/bundle when running the command).

In the end all apps were directly runnable without any prior environment setup or RVM magic, and each have separate gems.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top