What's the point of freezing your Rails version/gems?

后端 未结 4 1777
难免孤独
难免孤独 2020-12-10 05:02

What does that mean?

In the instructions for a project, it said to \"freeze the Rails gems\". Is that different from freezing the Rails version?

What\'s free

4条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-10 05:39

    Freezing is great - as others have said it reduces your dependency on your external environment. It's particularly important if you're on shared hosting, or otherwise don't fully control where you deploy.

    However, it can be problematic for programs like rake and capistrano that don't run within your Rails environment. They have their own gem loading path, which you can affect, but you need to be aware of it. Also, a gem with native extensions (libxml, hpricot, ...) can't be frozen, because the OS-specific bits still need to live in the external OS.

    Also, probably not an issue right now but something to be aware of - Rails 3 will be moving to a new method of managing plugins, gems, and the vendor directory in general. It's all kind of a mess at the moment.

提交回复
热议问题