- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个 Rails 3.2 项目。我还使用 haml 作为我的模板引擎,但我决定使用 slim 而不是 haml。所以我用 slim 重写了一些 View 。但是当我将此更改推送到服务器时,我在生产中遇到了奇怪的错误。
该错误仅出现在使用 slim 作为模板引擎的页面上。在我的开发机器上,页面打开得很好。为了设置服务器,我使用了 Rayan Byte's screencast
我该如何解决?
错误:
Started GET "/" for 128.69.76.116 at 2013-04-12 11:19:31 +0000
Started GET "/ru/articles" for 128.69.76.116 at 2013-04-12 11:19:31 +0000
Processing by ArticlesController#index as HTML
Parameters: {"locale"=>"ru"}
Completed 500 Internal Server Error in 180ms
ActionView::MissingTemplate (Missing template articles/index, application/index with {:locale=>[:ru], :formats=>[:html], :handlers=>[:erb, :builder, :haml]}. Searched in:
* "/home/deployer/apps/Chirch_app/releases/20130412101936/app/views"
* "/home/deployer/apps/Chirch_app/shared/bundle/ruby/1.9.1/gems/gmaps4rails-1.5.6/app/views"
* "/home/deployer/apps/Chirch_app/shared/bundle/ruby/1.9.1/gems/kaminari-0.14.0/app/views"
* "/home/deployer/apps/Chirch_app/shared/bundle/ruby/1.9.1/gems/devise-2.1.2/app/views"
):
actionpack (3.2.8) lib/action_view/path_set.rb:58:in `find'
actionpack (3.2.8) lib/action_view/lookup_context.rb:109:in `find'
actionpack (3.2.8) lib/action_view/renderer/abstract_renderer.rb:3:in `find_template'
actionpack (3.2.8) lib/action_view/renderer/template_renderer.rb:34:in `determine_template'
actionpack (3.2.8) lib/action_view/renderer/template_renderer.rb:10:in `render'
actionpack (3.2.8) lib/action_view/renderer/renderer.rb:36:in `render_template'
actionpack (3.2.8) lib/action_view/renderer/renderer.rb:17:in `render'
actionpack (3.2.8) lib/abstract_controller/rendering.rb:110:in `_render_template'
actionpack (3.2.8) lib/action_controller/metal/streaming.rb:225:in `_render_template'
actionpack (3.2.8) lib/abstract_controller/rendering.rb:103:in `render_to_body'
actionpack (3.2.8) lib/action_controller/metal/renderers.rb:28:in `render_to_body'
actionpack (3.2.8) lib/action_controller/metal/compatibility.rb:50:in `render_to_body'
actionpack (3.2.8) lib/abstract_controller/rendering.rb:88:in `render'
actionpack (3.2.8) lib/action_controller/metal/rendering.rb:16:in `render'
actionpack (3.2.8) lib/action_controller/metal/instrumentation.rb:40:in `block (2 levels) in render'
activesupport (3.2.8) lib/active_support/core_ext/benchmark.rb:5:in `block in ms'
/home/deployer/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/benchmark.rb:295:in `realtime'
activesupport (3.2.8) lib/active_support/core_ext/benchmark.rb:5:in `ms'
actionpack (3.2.8) lib/action_controller/metal/instrumentation.rb:40:in `block in render'
actionpack (3.2.8) lib/action_controller/metal/instrumentation.rb:83:in `cleanup_view_runtime'
activerecord (3.2.8) lib/active_record/railties/controller_runtime.rb:24:in `cleanup_view_runtime'
actionpack (3.2.8) lib/action_controller/metal/instrumentation.rb:39:in `render'
actionpack (3.2.8) lib/action_controller/metal/implicit_render.rb:10:in `default_render'
actionpack (3.2.8) lib/action_controller/metal/implicit_render.rb:5:in `send_action'
actionpack (3.2.8) lib/abstract_controller/base.rb:167:in `process_action'
actionpack (3.2.8) lib/action_controller/metal/rendering.rb:10:in `process_action'
actionpack (3.2.8) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
activesupport (3.2.8) lib/active_support/callbacks.rb:436:in `_run__609582508__process_action__934117167__callbacks'
activesupport (3.2.8) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.8) lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
activesupport (3.2.8) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.8) lib/abstract_controller/callbacks.rb:17:in `process_action'
actionpack (3.2.8) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (3.2.8) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
activesupport (3.2.8) lib/active_support/notifications.rb:123:in `block in instrument'
activesupport (3.2.8) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (3.2.8) lib/active_support/notifications.rb:123:in `instrument'
actionpack (3.2.8) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
actionpack (3.2.8) lib/action_controller/metal/params_wrapper.rb:207:in `process_action'
activerecord (3.2.8) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (3.2.8) lib/abstract_controller/base.rb:121:in `process'
actionpack (3.2.8) lib/abstract_controller/rendering.rb:45:in `process'
actionpack (3.2.8) lib/action_controller/metal.rb:203:in `dispatch'
actionpack (3.2.8) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
actionpack (3.2.8) lib/action_controller/metal.rb:246:in `block in action'
actionpack (3.2.8) lib/action_dispatch/routing/route_set.rb:73:in `call'
actionpack (3.2.8) lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
actionpack (3.2.8) lib/action_dispatch/routing/route_set.rb:36:in `call'
journey (1.0.4) lib/journey/router.rb:68:in `block in call'
journey (1.0.4) lib/journey/router.rb:56:in `each'
journey (1.0.4) lib/journey/router.rb:56:in `call'
actionpack (3.2.8) lib/action_dispatch/routing/route_set.rb:600:in `call'
warden (1.2.1) lib/warden/manager.rb:35:in `block in call'
warden (1.2.1) lib/warden/manager.rb:34:in `catch'
warden (1.2.1) lib/warden/manager.rb:34:in `call'
actionpack (3.2.8) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
rack (1.4.4) lib/rack/etag.rb:23:in `call'
rack (1.4.4) lib/rack/conditionalget.rb:25:in `call'
actionpack (3.2.8) lib/action_dispatch/middleware/head.rb:14:in `call'
actionpack (3.2.8) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.2.8) lib/action_dispatch/middleware/flash.rb:242:in `call'
rack (1.4.4) lib/rack/session/abstract/id.rb:210:in `context'
rack (1.4.4) lib/rack/session/abstract/id.rb:205:in `call'
actionpack (3.2.8) lib/action_dispatch/middleware/cookies.rb:339:in `call'
activerecord (3.2.8) lib/active_record/query_cache.rb:64:in `call'
activerecord (3.2.8) lib/active_record/connection_adapters/abstract/connection_pool.rb:473:in `call'
actionpack (3.2.8) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
activesupport (3.2.8) lib/active_support/callbacks.rb:405:in `_run__319658905__call__322020128__callbacks'
activesupport (3.2.8) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.8) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
activesupport (3.2.8) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.8) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (3.2.8) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
actionpack (3.2.8) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
actionpack (3.2.8) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.8) lib/rails/rack/logger.rb:26:in `call_app'
railties (3.2.8) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.8) lib/action_dispatch/middleware/request_id.rb:22:in `call'
rack (1.4.4) lib/rack/methodoverride.rb:21:in `call'
rack (1.4.4) lib/rack/runtime.rb:17:in `call'
activesupport (3.2.8) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.4.4) lib/rack/lock.rb:15:in `call'
rack-cache (1.2) lib/rack/cache/context.rb:136:in `forward'
rack-cache (1.2) lib/rack/cache/context.rb:245:in `fetch'
rack-cache (1.2) lib/rack/cache/context.rb:185:in `lookup'
rack-cache (1.2) lib/rack/cache/context.rb:66:in `call!'
rack-cache (1.2) lib/rack/cache/context.rb:51:in `call'
railties (3.2.8) lib/rails/engine.rb:479:in `call'
railties (3.2.8) lib/rails/application.rb:223:in `call'
railties (3.2.8) lib/rails/railtie/configurable.rb:30:in `method_missing'
unicorn (4.5.0) lib/unicorn/http_server.rb:552:in `process_client'
unicorn (4.5.0) lib/unicorn/http_server.rb:628:in `worker_loop'
unicorn (4.5.0) lib/unicorn/http_server.rb:500:in `spawn_missing_workers'
unicorn (4.5.0) lib/unicorn/http_server.rb:511:in `maintain_worker_count'
unicorn (4.5.0) lib/unicorn/http_server.rb:277:in `join'
unicorn (4.5.0) bin/unicorn:121:in `<top (required)>'
/home/deployer/apps/Chirch_app/shared/bundle/ruby/1.9.1/bin/unicorn:23:in `load'
/home/deployer/apps/Chirch_app/shared/bundle/ruby/1.9.1/bin/unicorn:23:in `<main>'
gem 文件:
source 'https://rubygems.org'
gem 'rails', '3.2.13'
gem 'pg', '0.15.1'
gem 'jquery-rails', '2.2.1'
gem 'haml', '4.0.2'
gem 'therubyracer', :platform => :ruby
gem 'devise', '2.2.3'
gem 'simple_form', '2.1.0'
gem 'bootstrap-wysihtml5-rails', "0.3.1.19"
gem 'kaminari', '0.14.0'
gem "cancan", '1.6.9'
gem "carrierwave", '0.8.0'
gem "rmagick", '2.13.2'
gem 'gmaps4rails', '1.5.6'
gem 'unicorn', '4.6.2'
gem 'capistrano', '2.14.2'
gem 'less-rails', '2.3.2'
gem 'slim', '1.3.8'
gem 'haml2slim'
group :assets do
gem 'sass-rails', '~> 3.2.4'
gem 'coffee-rails', '~> 3.2.2'
gem 'twitter-bootstrap-rails', '2.2.6'
gem 'uglifier', '>= 1.2.3'
end
group :development do
gem 'annotate', '~> 2.5.0'
gem 'better_errors'
gem 'binding_of_caller'
gem 'brakeman'
gem 'meta_request'
end
group :development, :test do
gem 'rspec-rails', '2.13.0'
gem 'rb-fsevent'
gem 'guard-rspec', '2.5.2'
gem 'terminal-notifier-guard'
gem 'launchy'
end
group :test do
gem 'capybara', '2.1.0'
gem 'factory_girl_rails', '4.2.1'
gem 'database_cleaner', '0.9.1'
gem 'selenium-webdriver', '2.32.1'
end
最佳答案
我发现了问题。经过长时间的研究(unicorn 和 nginx 重启没有帮助)我只是重新启动了整个操作系统,然后 Slim
页面出现了。
关于ruby-on-rails-3 - Rails + Slim - MissingTemplate(生产中),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15969288/
将 mysite 部署到 VPS 后,我面临此运行时错误。请注意,在我的本地机器上,一切正常。 当我尝试通过 Controller 路由访问任何 View 时,可以说 PostsController#
我在 Rails 中遇到一些路由问题。 我已经为 Project 模型准备了一个模型,所以我使用 rails generate scaffold_controller 生成了一些默认 Controll
当 Google 机器人尝试访问我的某个 Controller 时,我收到此错误消息。 ActionView::MissingTemplate: Missing template channels/s
我正在测试 Rails Controller 并尝试使用代码执行获取: delete :remove_logs, :id => 3 它始终返回一个 ActionView::MissingTemplat
现在,我不得不承认,我是 Ruby on Rails 的新手,并不是很了解每个概念。我已经安装了 Devise 进行身份验证并遵循了 this guide在我的 View 中包含注册和登录链接。 这是
我的 Rails 应用程序从 Rails 6 升级到 Rails 7 后遇到问题。当我尝试 render_to_string 模板时,我收到 ActionView::MissingTemplate 异
我已经使用 capistrano 部署了我的应用程序在 AWS , 与 nginx和 unicorn .当我打开我的主页时,它是空的。这是我的unicorn日志 Started GET "/" for
在从根路径上的某些 IP 地址进行生产时,我随机收到此错误。 rails 应用程序不支持格式 :formats=>[:gif, "image/x-xbitmap", :jpeg, "image/pjp
我收到一个我无法弄清楚的错误: ActionView::MissingTemplate (Missing template cluster/delete_stuff.erb in view path
我有一个为我的主页提供服务的操作。它在正常访问时工作正常(即由网络浏览器中的用户访问),但是当被特定的网络爬虫访问时,它会抛出以下错误: A ActionView::MissingTemplate
我有一个 Rails 3.2 项目。我还使用 haml 作为我的模板引擎,但我决定使用 slim 而不是 haml。所以我用 slim 重写了一些 View 。但是当我将此更改推送到服务器时,我在生产
我有一个简单的角轨应用程序,我正在尝试将其连接起来。 这是我的 Rails Controller : class ItemsController false } end end
我正在尝试进行 ajax 调用,但我不想返回任何数据,或者可能只返回 200。 我的错误是 ActionView::MissingTemplate (Missing template .... 我在
我想使用本教程将 AJAX 搜索字段添加到我的应用程序:http://www.rymcmahon.com/articles/11 除搜索 JS 字段外,一切正常。它根本不起作用。我的终端控制台中的错误
在我的一个 Controller 中,我有以下代码: respond_to do |format| format.html{ redirect_to :me, :flash => {:error
升级到 Rails 3.1.0 和以下版本后 David Rice's instructions ,奇怪的是,我所有的 Controller 都找不到他们的 View 了。 # rails s # S
我正在尝试在我的 Rails 应用程序上使用 Rsec 测试一些非常简单的东西。 这是spec/controllers/movies_controller_spec.rb中的测试代码 describ
我正在尝试为 Ruby on Rails 开发一个插件,但在渲染 html View 时遇到了问题。我的目录结构如下所示: 文件结构 ---/vendor |---/plugins
我正在尝试使用 Rails 进行 AJAX 调用。该调用是对我 Controller 中的 change_profile 操作的调用。该 Action 的内容如下: def change_profil
我一直在我的日志中看到类似于以下内容的错误。 谁能告诉我为什么我会间歇性地收到这样的错误?是缓存问题吗? 每次我尝试加载关于我们的页面时,它都能完美加载,但每隔几天我的日志中就会出现这样的错误,但它并
我是一名优秀的程序员,十分优秀!