How to resolve Rails model namespace collision

后端 未结 3 1060
别跟我提以往
别跟我提以往 2020-12-15 00:36

The story so far:

I have a rails app with a model named \"Term\". All is well until trying to install Cucumber. Upon running

rake cucumber

3条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-15 01:00

    Here's what I did:

    sudo gem uninstall term-ansicolor
    sudo gem uninstall cucumber

    Download sources for term-ansicolor and cucumber from github
    Search term-ansicolor source for "module Term" and replace with "module ANSITerm"
    Search cucumber source for "include Term" and replace with "include ANSITerm"
    Search cucumber source for "::Term" and replace with "::ANSITerm"

    sudo gem install term-ansicolor from my local repository
    sudo gem install cucumber from my local repository

    Now I have two gems to maintain, but that seems easier than changing all the model references in my app.

    Comments/suggestions welcome.

提交回复
热议问题