簡體   English   中英

無法生成Rails腳注

[英]Unable to generate rails footnote

我正在嘗試按照GitHub上的說明在Rails 3.0上安裝名為rails-footnotes的調試工具。 運行檢查包顯示的rails-footnotes表明我安裝了rails-footnotes-3.7.4。 但是,當我跑步時

rails generate rails_footnotese:install
>>Could not find generator rails_footnotese:install.

我希望有人遇到過同樣的問題可以幫助我。 謝謝。

版本3.7.4不使用生成器,僅使用較新的3.7.5(尚未發布)。 另外,自述文件中有一個錯字。 它應該是rails_footnotes:install ,不rails_footnotese:install (已經有一個拉請求解決這個問題)。

如果要保留在穩定的3.7.4上,生成器命令所config/initializers/rails_footnotes.rb就是添加config/initializers/rails_footnotes.rb文件,其內容與自述文件中的內容相同:

if defined?(Footnotes) && Rails.env.development?
  Footnotes.run! # first of all

  # ... other init code
end

和一個.rails_footnotes文件,其內容如下:

#this code temporarily disables notes for all controllers
# Footnotes::Filter.notes = []

否則,使用git版本使生成器工作:

gem 'rails-footnotes', :git => "git://github.com/josevalim/rails-footnotes.git"

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM