我在开发环境中使用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'
是否需要在资产组之外?
答案 0 :(得分:2)
是的,您应该将best_in_place
gem移出assets
组。
资产组仅在资产编译部署期间包含,而不是在运行时期间。