简体   繁体   中英

How do you fix a namespace conflict with a third-party gem on your Rails app

I want to use Nunemaker's twitter gem for my Rails project but I already have a model/controller called Twitter and this conflicts with the Twitter gem.

Can someone please advise how I can namespace the Twitter gem to something else? What's the best way to handle this for my Rails app.

You don't want to namespace the gem because that would break your app if you ever update the gem ( About monkeypatching ).

Better change the name of your controller, or namespace your controller. This is the better approach and less time-consuming.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM