ruby在rails-3 – Rails 3咖啡处理程序丢失

Im使用 Ruby 1.9.3p0,Rails 3.1.2与Apache和Passenger在生产中.当我尝试做一个远程功能,它会给我这个错误:
ActionView::MissingTemplate (Missing template video/loadVideo,application/loadVideo with
{:handlers=>[:erb,:builder],:formats=>[:js,"application/ecmascript","application/x-
ecmascript",:html,:text,:js,:css,:ics,:csv,:xml,:rss,:atom,:yaml,:multipart_form,:url_encoded_form,:json],:locale=>[:en,:en]}. Searched in

正如你所看到的,没有处理程序:咖啡,这就是为什么不处理文件视频/ loadVideo.js.coffee的原因;我运行命令rake assets:预编译,但没有改变.

宝石档案
来源“http://rubygems.org”

gem 'rails','3.1.2'

# Bundle edge Rails instead:
# gem 'rails',:git => 'git://github.com/rails/rails.git'

gem 'will_paginate','~> 3.0'
gem "bcrypt-ruby",:require => "bcrypt"
gem 'mysql'

#Problems in Debian,the error was:
#Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs #for a list of available runtimes. (ExecJS::RuntimeUnavailable)
#Solution: https://stackoverflow.com/questions/6282307/rails-3-1-execjs-and-could-not-find-a-javascript-runtime
gem 'execjs'
gem 'therubyracer'

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails','~> 3.1.5.rc.2'
  gem 'coffee-rails','~> 3.1.1'
  gem 'uglifier','>= 1.0.3'
end

gem 'jquery-rails'

# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby','~> 3.0.0'

# Use unicorn as the web server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'ruby-debug19',:require => 'ruby-debug'

group :test do
  # Pretty printed test output
  gem 'turn','0.8.2',:require => false
end

解决方法

更改您的Gemfile(在资产组之外移动coffee-rails gem)或更改您的application.rb设置 – 例如
if defined?(Bundler)
  # If you precompile assets before deploying to production,use this line
  # Bundler.require(*Rails.groups(:assets => %w(development test)))
  # If you want your assets lazily compiled in production,use this line
  Bundler.require(:default,:assets,Rails.env)
end

在开发环境应用程序默认情况下加载所有的gems:default,:development,:test,:assets groups.咖啡处理器来自咖啡轨道宝石,所以你必须加载它.

相关文章

validates:conclusion,:presence=>true,:inclusion=>{...
一、redis集群搭建redis3.0以前,提供了Sentinel工具来监控各...
分享一下我老师大神的人工智能教程。零基础!通俗易懂!风趣...
上一篇博文 ruby传参之引用类型 里边定义了一个方法名 mo...
一编程与编程语言 什么是编程语言? 能够被计算机所识别的表...
Ruby类和对象Ruby是一种完美的面向对象编程语言。面向对象编...