Does the order of gems in your Gemfile make a difference?

后端 未结 2 2032
梦毁少年i
梦毁少年i 2020-12-20 11:18

Is the order in which you list your gems important? Are these two blocks equivalent?

gem \'carrierwave\'
gem \'rmagick\'

And



        
2条回答
  •  离开以前
    2020-12-20 11:53

    When you use Bundle.require (which Rails does), Gems are required in the order they appear in the Gemfile. In wasn’t always like this, but has been this way for a while.

    Since Carrierwave requires RMagick explicitly when it is needed, I don’t think it should matter in your case; but strictly speaking the two blocks are not equivalent.

提交回复
热议问题