heroku中的best_in_place错误

时间:2013-04-05 13:13:45

标签: jquery ruby-on-rails ruby-on-rails-3 best-in-place

我在开发环境中使用best_in_place gem,但是当我部署到Heroku时,我在视图中收到以下错误:

ActionView::Template::Error (undefined method `best_in_place' for #<#<Class:0x000000036600a0>:0x000000037a12e8>):
2013-04-05T13:00:55+00:00 app[web.1]:     56:               <% end %>
2013-04-05T13:00:55+00:00 app[web.1]:     57:             </div>
2013-04-05T13:00:55+00:00 app[web.1]:     61:           </div>
2013-04-05T13:00:55+00:00 app[web.1]:     62:           <div class="budget_description budget_field">
2013-04-05T13:00:55+00:00 app[web.1]:   app/controllers/budgets_controller.rb:33:in `show'
2013-04-05T13:00:55+00:00 app[web.1]: 
2013-04-05T13:00:55+00:00 app[web.1]:     58:             <div class="budget_name budget_workspace">
2013-04-05T13:00:55+00:00 app[web.1]:     59:               <h1><%= best_in_place @budget, :name, :inner_class => "test" %></h1>

我的宝石文件:

source 'https://rubygems.org'

gem 'rails', '3.2.8'    
gem 'devise'
gem 'pg'
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'
  gem 'uglifier', '>= 1.0.3'
  gem 'jquery-rails'
  gem 'best_in_place'
end

gem 'best_in_place'是否需要在资产组之外?

1 个答案:

答案 0 :(得分:2)

是的,您应该将best_in_place gem移出assets组。

资产组仅在资产编译部署期间包含,而不是在运行时期间。