Managing conflicting versions of ruby gems

后端 未结 2 1563
醉梦人生
醉梦人生 2021-01-21 14:05

I am building a framework that loads user provided ruby code. It is basically a plugin mechanism. I want the user provide ruby code to be able to require gems of its own. I i

2条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-21 14:57

    To be blunt, you can't have two versions of the same gem loaded at the same time.

    Bundler does a good (ish) job of looking through all of the required gems and finding a solution to the various overlapping dependencies, but even so it is limited to only loading one version of a gem at a time.

    This leads to plugin developers constantly having to update to support any changes that are made in dependent gems in order to avoid just the situation you describe.

    (Don't get me started on the screw up that results from the various competing JSON implementations and the pain you have to go through when you have several gem dependencies all requiring different ones.)

提交回复
热议问题