2011-02-07 57 views
1
Rails version: 3.0.3 
Ruby: 1.9.2pre 

在運行的應用程序,我把auto_html(https://github.com/dejan/auto_html)在Gemfile中,然後跑捆綁安裝好。auto_html寶石不加載在Rails 3應用程序(其它寶石的作品!)

但auto_html沒有方法似乎工作。

軌服務器負載正常,但auto_html方法,並auto_html_for不`噸工作 總是得到這樣的錯誤:

undefined method `auto_html' for #<#<Class:0x00000102c63330>:0x00000102c60ae0> 

我知道是一個裝載問題,但我沒有得到任何錯誤,我用許多其他寶石。

任何線索?

+0

加入請告訴我們你是如何試圖調用此方法。 – 2011-03-15 22:25:11

+0

瑞安, 我只是跟進的是在這裏: https://github.com/dejan/auto_html 在一個ERB模板,只是: <%= auto_html(場)%> – 2011-03-16 17:54:17

回答

1

你可能已經發現了,但這:

include AutoHtml 

在某處

0

也許gemfile沒有像庫那樣命名? bcrypt作爲例子在Gemfile中進行定義,如:

gem 'bcrypt-ruby', :require => "bcrypt" 
+3

不,這不是它。請參閱:https://github.com/dejan/auto_html/blob/master/lib/auto_html.rb – 2011-03-15 22:24:19

0

這也許應該在lib來完成自身,但目前使用它一樣,(在模板auto_html方法)你必須包括AutoHtml ApplicationHelper中的模塊。

+0

版本1.4.1執行此操作。 – 2011-07-10 08:20:05