Ruby on rails 3.1 Rails 3.1在生产中不起作用

Ruby on rails 3.1 Rails 3.1在生产中不起作用,ruby-on-rails-3.1,asset-pipeline,production-environment,assets,ruby-on-rails-3.2,Ruby On Rails 3.1,Asset Pipeline,Production Environment,Assets,Ruby On Rails 3.2,我有一个视图文件夹,其中包含许多js.coffee文件,在执行各种控制器操作时调用这些文件。在提交远程表单时调用它,并在控制器中由REPORT_with行触发。我以create方法为例。需要注意的是,所有这些在开发模式下都能完美工作。在生产中,我已经确保预编译了我的资产,运行了bundle安装--部署等 用户\u controller.rb def create @user = User.new(params[:user]) if @user.save respond_with

我有一个视图文件夹,其中包含许多js.coffee文件,在执行各种控制器操作时调用这些文件。在提交远程表单时调用它,并在控制器中由REPORT_with行触发。我以create方法为例。需要注意的是,所有这些在开发模式下都能完美工作。在生产中,我已经确保预编译了我的资产,运行了bundle安装--部署等

用户\u controller.rb

def create
  @user = User.new(params[:user])

  if @user.save
    respond_with @user, :location => users_url    #This line is throwing the error in production
  end
end
以下Jquery应该在保存记录后执行,并且在开发模式下可以完美地执行。重要的是要注意,记录是创建的,但是下面的文件永远不会执行

create.js.coffee

$('#errors').empty()
$('#errors').show()
<% if @user.errors.any? %>
  $('<%= escape_javascript(render :partial => "errors", :locals => {:target => @user })%>')
  .appendTo('#errors')
<% else %>
  $('<%= escape_javascript(render(:partial => @user))%>')
  .appendTo('#user_table')
  .hide()
  .fadeIn(200)
  $('#errors').hide()
  $('#new_user')[0].reset()
  $('#users_count').html '<%= users_count %>'
<% end %>
$('#error_close').click ->
$('#errors').fadeOut()

我终于明白了。将coffee rails和uglifier从:资产组中移除,这就解决了问题

ActionView::MissingTemplate (Missing template users/create, application/create with {:locale=>[:en], :formats=>[:js, :html], :handlers=>[:erb, :builder]}. Searched in:
 * "/home/ctilley/Development/RatatouilleCatering/app/views"
 * "/home/ctilley/Development/RatatouilleCatering/vendor/bundle/ruby/1.9.1/gems/wash_out-0.3.1/app/views"
 * "/home/ctilley/Development/RatatouilleCatering/vendor/bundle/ruby/1.9.1/gems/ckeditor-3.7.0.rc2/app/views"
):
app/controllers/users_controller.rb:19:in `create'