加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

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

发布时间:2020-12-16 22:40:35 所属栏目:百科 来源:网络整理
导读: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,"applicat
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.咖啡处理器来自咖啡轨道宝石,所以你必须加载它.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读