双控制台输出?

2024-02-05

突然,当我在本地运行我的应用程序时,我得到了双控制台输出。有谁知道这可能是什么原因造成的?运行 Thin 和 Unicorn 时都存在该问题

=> Booting Thin
=> Rails 4.0.0 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
>> Thin web server (v1.5.1 codename Straight Razor)
>> Maximum connections set to 1024
>> Listening on 0.0.0.0:3000, CTRL+C to stop
Started GET "/" for 127.0.0.1 at 2013-09-05 22:21:21 +0200
Started GET "/" for 127.0.0.1 at 2013-09-05 22:21:21 +0200
Processing by HomeController#index as HTML
Processing by HomeController#index as HTML
  Rendered home/index.html.erb within layouts/application (299.5ms)
  Rendered home/index.html.erb within layouts/application (299.5ms)
  Rendered layouts/_navbar.html.erb (38.3ms)
  Rendered layouts/_navbar.html.erb (38.3ms)
  Rendered layouts/_footer.html.erb (0.8ms)
  Rendered layouts/_footer.html.erb (0.8ms)
Completed 200 OK in 704ms (Views: 428.1ms | ActiveRecord: 52.4ms)
Completed 200 OK in 704ms (Views: 428.1ms | ActiveRecord: 52.4ms)

这是我的 Gemfile

# Gemfile
source 'https://rubygems.org'

ruby '2.0.0'

gem 'rails'

gem 'actionpack-action_caching'
gem 'asset_sync'
gem 'authlogic', github: 'binarylogic/authlogic'
gem 'bootstrap-sass', github: 'thomas-mcdonald/bootstrap-sass', branch: '3'
gem 'coffee-rails'
gem 'dalli'
gem 'font-awesome-rails'
gem 'highcharts-rails'
gem 'jbuilder'
gem 'jquery-rails'
gem 'memcachier'
gem 'newrelic_rpm'
gem 'pg'
gem 'prawn', '>= 1.0.0.rc2'
gem 'prawn_rails'
gem 'rack-mini-profiler', require: 'rack-mini-profiler'
gem 'rack-timeout'
gem 'rails-i18n'
gem 'rails_12factor' # required by Heroku
gem 'sass-rails'
gem 'uglifier'
gem 'yui-compressor'

group :production do
  gem 'justonedb'
  gem 'unicorn-rails'
end

group :development do
  gem 'annotate'
  gem 'better_errors'
  gem 'binding_of_caller'
  gem 'hirb'
  gem 'lol_dba' # To find table in need of indexes run 'lol_dba db:find_indexes'
  gem 'mailcatcher'
  gem 'pry'
  gem 'quiet_assets'
end

group :test do
  gem 'capybara'
  gem 'capybara-webkit'
  gem 'factory_girl_rails', require: false
  gem 'fuubar'
  gem 'rspec-rails'
  gem 'rails_12factor'
end

我的发展.rb

# development.rb
Beerclub::Application.configure do
  # Settings specified here will take precedence over those in config/application.rb.
  config.log_level = :debug

  # In the development environment your application's code is reloaded on
  # every request. This slows down response time but is perfect for development
  # since you don't have to restart the web server when you make code changes.
  config.cache_classes = false

  # Do not eager load code on boot.
  config.eager_load = false

  # Show full error reports and disable caching.
  config.consider_all_requests_local       = true
  config.action_controller.perform_caching = false

  # Don't care if the mailer can't send.
  config.action_mailer.raise_delivery_errors = false

  # Print deprecation notices to the Rails logger.
  config.active_support.deprecation = :log

  # Raise an error on page load if there are pending migrations
  config.active_record.migration_error = :page_load

  # Debug mode disables concatenation and preprocessing of assets.
  # This option may cause significant delays in view rendering with a large
  # number of complex assets.
  config.assets.compress = false
  config.assets.debug = true
  config.serve_static_assets = true
end

和应用程序.rb

require File.expand_path('../boot', __FILE__)

require 'rails/all'

# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(:default, Rails.env)

module Beerclub
  class Application < Rails::Application
    # Settings in config/environments/* take precedence over those specified here.
    # Application configuration should go into files in config/initializers
    # -- all .rb files in that directory are automatically loaded.

    # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
    # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
    config.time_zone = 'Copenhagen'

    # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
    config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
    config.i18n.default_locale = :da

    # Enable the asset pipeline
    config.assets.enabled = true
    config.assets.version = '1.0'

    # Needs to be false on Heroku
    config.serve_static_assets = false
    config.static_cache_control = "public, max-age=31536000"

    # Add the fonts path
    config.assets.paths << Rails.root.join('app', 'assets', 'fonts')
    config.assets.paths << Rails.root.join('vendor', 'assets', 'fonts')

    # Precompile additional assets
    config.assets.precompile += %w( *.svg *.eot *.woff *.ttf )
    config.assets.precompile += %w( *.png *.jpg *.jpeg *.gif )
  end
end

关于rails_12factor - 如果您将 Gemfile 中的行更改为:

gem 'rails_12factor', group: :production

在调试等过程中,您将不再在控制台中看到双输出。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

双控制台输出? 的相关文章

随机推荐

  • printf 的包装

    我在Arduino下编码 我想开发串行打印格式化功能 所以我尝试使用sprintf未知大小的缓冲区 基本上 我们可以避免谈论 Arduino 及其串行输出 并考虑将文本写入缓冲区 然后使用printf 我试过这个 include
  • matplotlib.mplot3d 立方体表面的底图

    正如标题所示 我试图在 matplotlib mplot3d 线图的 z 0 表面上绘制底图地图 我知道 Axes3D 对象能够在 z 0 表面上绘图 通过 Axes3D plot Axes3D scatter 等 但我不知道如何使用 Ba
  • 从一组坐标中找到最接近的坐标

    我有大约 1000 组地理坐标 纬度 经度 给定一个坐标 我想从该集合中找到最接近的一个 我的方法是测量距离 但每秒数百个请求对于服务器执行所有数学运算来说可能有点粗糙 对此最好的优化解决方案是什么 Thanks 您将想要使用 最近邻算法
  • 在 setter 方法的情况下,为什么 irb 会回显赋值的右侧而不是返回值?

    令人惊讶的是 在所有其他情况下 irb 都会回显方法的返回值 为什么通过 setter 进行分配的行为会有所不同 我正在使用 Ruby 2 2 2 irb main 001 0 gt def x value puts puts from x
  • 统计同一张表上多个条件的SQL

    我正在尝试编写一个查询 返回在 2020 年 1 月 1 日之后购买 镜子 或 自行车 并且在 12 个月内还购买了 书 或 沙发 的客户 使用计数以防他们购买多次 我编写的查询不完整 因此我需要一些帮助 我缺少计算未来 12 个月内订单数
  • 如何将 LINQ 查询相互附加?

    我有一个表单 可以根据他们选择的内容过滤数据 我正在尝试将 linq 查询相互附加 以便最终结果是他们在屏幕上选择的结果 这是我的代码 private void button Search Click object sender Event
  • Spring JPA:从异步方法处理时数据未保存到数据库

    我有一个使用 Spring JPA 的应用程序 并使用 Async spring 注释执行一些后台进程 该过程需要将参数保存在数据库中 或者如果参数已经存在则更新数据库 这不能正常工作 因为在 Async 方法完成后我的数据实体没有保留在数
  • beans.xml 上的文件过早结束

    xml 的内容
  • 通过 Rails 3 中的范围进行预加载

    我一直在尝试根据 Rails3 应用程序中的某些范围急切加载关联 但找不到任何解决方案 我的应用程序有以下型号 class Project has many entries has many to dos class ToDo has ma
  • 强制触摸 UITableViewCell 内的 UICollectionView

    我有一个带有 Tableview 的 viewController 多个 TableViewCell 并且在每个 TableViewCell 中都有一个带有多个 UICollectionViewItems 的 UICollectionVie
  • 纯 JS 幻灯片菜单,能够“在菜单外部单击”关闭它

    我正在尝试重新表述我的问题 并将完成我所做的所有步骤 特别是我失败的地方 我对 JS 的了解并不深 但有通过实践学习的意愿以及社区的帮助 我偶然发现这个答案 https stackoverflow com a 38317768 559718
  • 使用 POST 请求重定向的好方法?

    我需要通过 POST 请求将用户重定向到外部站点 我想到的唯一选择是通过 JavaScript 提交表单 有任何想法吗 不太明白你的意思 所以我们举几个场景 用户应该将表单发布到您自己以外的服务器 很简单 只需将目标指定为表单操作即可
  • (Codesandbox,Vue)“属性或方法“children”未在实例上定义,但在渲染期间引用。”

    我目前正在构建一个状态管理器 它可以集成到多个前端框架中 包括 Vue 为了演示 Vue 中状态管理器的用法 我创建了一个简单的codesandbox 因为有一个实时代码示例总是很好 可以在自述文件中进行推广 但不知何故 我总是在代码和框中
  • Path 中加号的 Data 值是多少

    如何使用 Path 对象中的 data 属性绘制加号和减号 这是我的三角形路径对象 我需要将其更改为加号
  • JS 客户端 Exif 方向:旋转和镜像 JPEG 图像

    数码相机照片通常保存为带有 EXIF 方向 标签的 JPEG 为了正确显示 图像需要根据设置的方向进行旋转 镜像 但浏览器会忽略渲染图像的此信息 即使在大型商业 Web 应用程序中 对 EXIF 方向的支持也可能不稳定1 http www
  • Android:发送数据存储在MySQL中

    Solved 缺少 postData 的视图参数 已更改以反映这一点 我需要一些帮助 将 GPS 数据发送到服务器 该数据将使用 PHP 存储在 MySQL 数据库中 这是在我的 Java 文件中 ArrayList
  • JLabel setText 不更新文本

    我正在尝试使用以下方法更新 JLabelsetText 方法 但我无法重绘 JLabel 我必须使用repaint 方法来做到这一点 这是代码的一部分 我没有收到任何错误 但它没有更新 JLabel public void actionPe
  • 将 infoWindow 放置在远离标记的静态位置(Google 地图)

    我想要实现的 到目前为止找不到任何东西 是 infoWindow 没有附加到标记 我想将其放置在视口中的静态位置 并根据单击的标记交换内容 问 如何将谷歌地图标记信息窗口放置 而不仅仅是偏移 到固定位置 回答我自己的问题 如果有人需要这个
  • 如何禁用 #line 指令写入 T4 生成输出文件

    我在生成 T4 代码时遇到了一个小问题 我已将 T4 模板分解为单独的文件并将它们放置在不同的目录中 我已经这样做了 因此我的代码生成的部分内容可以在多个项目中重复使用 例如模型生成 存储库生成和服务生成都包含核心 EntityGenera
  • 双控制台输出?

    突然 当我在本地运行我的应用程序时 我得到了双控制台输出 有谁知道这可能是什么原因造成的 运行 Thin 和 Unicorn 时都存在该问题 gt Booting Thin gt Rails 4 0 0 application starti