开发者

How to patch a gem to work properly in Rails 3

开发者 https://www.devze.com 2023-01-04 21:52 出处:网络
I am trying to use a particular gem that hasn\'t been updated since the inception of Rails 3. It makes a reference to RAILS_ROOT when the gem is initialized, which give开发者_如何学Gos me this:

I am trying to use a particular gem that hasn't been updated since the inception of Rails 3. It makes a reference to RAILS_ROOT when the gem is initialized, which give开发者_如何学Gos me this:

can't convert #<Class:0x1018695c8> into String (TypeError)

From my understanding, this is because Rails 3 doesn't set Rails.root at this stage of the initialization process. Is there a way I can patch this gem, or add something somewhere to fix this issue?


from what I could find from a quick search, it looks like the way to go is to create a Rails::Railtie for it

see José Valim's comment here:

https://rails.lighthouseapp.com/projects/8994/tickets/4016-railsroot-returns-nil-before-app-initialization-silently-breaking-some-gems

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号