【问题标题】:Unicorn (4.9.0) + Rails (2.2.2) gives me always the same session_id - Do you know how to fix that?Unicorn (4.9.0) + Rails (2.2.2) 总是给我相同的 session_id - 你知道如何解决这个问题吗?
【发布时间】:2018-07-21 14:52:53
【问题描述】:

我尝试让一个旧的 Rails 应用程序与 unicorn 一起运行。

会话设置为 :active_record_store

到目前为止一切都很好......

如果我使用任何浏览器访问应用程序,我的机器上总是相同的 session_id。我将 session_store 设置为 :mem_cache_store 并再次获得相同的 session_id...

当我通过脚本/服务器启动应用程序时,一切都很好,所以我认为问题在于独角兽。

这是我的 config.ru

require File.expand_path('../config/environment', __FILE__)
run ActionController::Dispatcher.new

这是我的 unicorn.rb

app_dir = File.expand_path("../..", __FILE__)
tmp_dir = "#{app_dir}/tmp"
working_directory app_dir

# Set unicorn options
worker_processes 2
preload_app true
timeout 3600

# Path for the Unicorn socket
listen "#{tmp_dir}/sockets/unicorn.sock", :backlog => 64

# Set path for logging
stderr_path "#{app_dir}/log/unicorn.stderr.log"
stdout_path "#{app_dir}/log/unicorn.stdout.log"

# Set proccess id path
pid "#{tmp_dir}/pids/unicorn.pid"

Rails 版本 2.2.2 红宝石版本 1.8.7 独角兽版本 4.9.0

免责声明: 我知道它是一个非常旧的版本。我知道,我的客户也知道——我们已经在开发新的了。但是让那个应用程序运行起来会很好。

【问题讨论】:

    标签: ruby-on-rails unicorn ruby-on-rails-2


    【解决方案1】:

    我使用 Puma 的 2.16.0 版本,现在一切正常。

    【讨论】:

      猜你喜欢
      • 2021-08-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-06-22
      • 2022-11-10
      • 1970-01-01
      • 2011-01-24
      相关资源
      最近更新 更多