RVM vs native installation of ruby

后端 未结 5 512
Happy的楠姐
Happy的楠姐 2021-02-06 08:55

I was wondering if there is any downsides from using rvm in a production server. What should I prefer, rvm or native installation and why?

相关标签:
5条回答
  • 2021-02-06 09:24

    Use RVM, as that way your application has exactly what it needs, and system updates do not interfere or change your requirements. One host I set up had a distro version of 1.8, but I wanted to develop for 1.9.2. Rather than break the distro version, RVM lets me run a custom version. RVM plays well with passenger phusion for rails deployments too.

    0 讨论(0)
  • 2021-02-06 09:36

    Don't do it, err, maybe do it

    Simplicity is always rewarded.

    Rvm is a development tool. Since you will not be switching Ruby versions back and forth dynamically on a production server, it can do no good and could create arbitrary levels of pain and suffering.

    Update: Ok, we've got some excellent comments and know more now. For one, rvm was in fact a production tool first. (Who knew?) It looks like if an application doesn't bundle its own gem environment, rvm will do it at the system level, and that could be useful.

    So there probably isn't a single answer to this question. If only one application runs on the server, or if all server applications are, say, Rails3, then rvm will not be needed. But other scenarios will benefit from the environment management.

    0 讨论(0)
  • 2021-02-06 09:37

    Use RVM. Because it is more simple.

    You'll have all distributions in one place, all gems in one place, and you're using the same tool that you use in development. There are no performance issues either.

    0 讨论(0)
  • 2021-02-06 09:41

    system installation:

    • easier accessible

    rvm installation:

    • possible to switch (fast) ruby
    • allow multiple version if required for multiple apps
    • easy upgrade of ruby version and management of gems update
    0 讨论(0)
  • 2021-02-06 09:50

    Compile your own Ruby and MongoDB, PostgreSQL, MySQL, redis, and whatever other supporting tools you rely on. This way get full control over the versions used everywhere and you can apply any necessary security or bug fix upgrades at will without having to wait for your OS vendor to supply system updates and patches. Compiling your own also makes it easier to ensure that your development, staging, and production environments are all using the same versions of everything you need.

    If using RVM makes it easier for you to build your own toolchain then use RVM. In any case, using the system supplied tools often leaves you a few versions behind and leaves you hanging when you need to apply critical patches.

    0 讨论(0)
提交回复
热议问题