Ruby on rails 钢轨通过发动机制造宝石

Ruby on rails 钢轨通过发动机制造宝石,ruby-on-rails,rubygems,rails-engines,Ruby On Rails,Rubygems,Rails Engines,我想制作一个包含视图助手的gem。我看这个,, 但是我遇到了一些问题 如果您需要更多信息,请点击这里 助手将只打印helloworld app/helpers/google_code.rb module GoogleCode def self.put_code content_tag(:p, "Hello world!") end end lib/google\u prettify\u rails.rb 需要“谷歌美化/version” 助手的名称与助手所在文件

我想制作一个包含视图助手的gem。我看这个,, 但是我遇到了一些问题

如果您需要更多信息,请点击这里

助手将只打印
helloworld

app/helpers/google_code.rb

module GoogleCode
    def self.put_code
        content_tag(:p, "Hello world!")
    end
end
lib/google\u prettify\u rails.rb 需要“谷歌美化/version”


助手的名称与助手所在文件的名称不匹配。只需将
app/helpers/google\u prettify\u rails\u helper.rb的第一行更改为
GooglePrettifyRailsHelper

您的助手的名称与该助手所在的文件的名称不匹配。只需将
app/helpers/google\u prettify\u rails\u helper.rb的第一行更改为
GooglePrettifyRailsHelper

谢谢,它对我真的很有用。谢谢,它对我真的很有用。
module GooglePrettifyRails
    class Engine < ::Rails::Engine
    end
end
Couldn't find GooglePrettifyRailsHelper, expected it to be defined in helpers/google_prettify_rails_helper.rb