Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Because rails app 1 needs version x.y.z and rails app 2 needs version a.b.c and RVM sucks and managing gems sucks.

This is, literally, the reason.

You can replace rails with any similarly bad technology. I got this explanation a few weeks ago at my job:

the java build process (I'm not kidding) has such a complex dependency graph that it must spin up full containers to do each build.

----

If dynamic languages supported better packaging/isolation this entire thing would be research projects.



Does Ruby not have a virtualenv equivalent?

(I am reading through the comments trying to work out if I should learn Docker. I already know how to use a virtualenv and I already know how to use a VM.)


While I'm not familiar with python & virtualenv, the problem of that would be solved by putting rails in a container (isolating the ruby environment in a fairly easily deployable way) was solved many years ago with Gemfiles/bundler[1] that pin your dependencies, and the various ways of deploying multiple rubies. RVM does indeed suck hard, but rbenv[2] is very simple (I've used it personally to develop and deploy a few projects).

One of the preferred ways to deploy rails is (was? I did this ~2 years ago) was to check it in with git and the name/version of the ruby environment to use is stored in the file ".rbenv-version", with dependencies managed by bundler (which you point to a local gem server). Install is then 1) use rbenv/ruby-install to install basic ruby, 2) install app with "git clone", and 3) run bundler. Many tools exist to do this in one step over ssh/etc automagically.

Even better than rbenv, you can just use chruby[3] to point to any rubies you want; just check one into your project itself (or whatever) and configure the siteruby/etc load paths to point to project directories. Really, chruby just fixes up your dev environment to point to a specific ruby; you set the actual project to be self contained with known paths, just like you would do de facto in a container.

While dependency issues were a problem back in the ruby 1.8 / rails 2.x days, this

[1] http://bundler.io/ [2] https://github.com/sstephenson/rbenv [3] https://github.com/postmodern/chruby


There's Bundler, which allows you to install all gems to a local path (e.g. `vendor/`) and then one simply runs `bundle exec <command to run in virtual environment>` to do the needful.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: