将ROS公寓宝石与Ruby 3.0.0

发布于 2025-01-27 13:13:45 字数 729 浏览 2 评论 0原文

从2.7.4 =&gt更新Ruby版本后; 3.0.0似乎ROS-隔间宝石无法在租户之间切换。

NoMethodError (undefined method `decode' for URI:Module):
  
lib/rescued_tenant_elevator.rb:10:in `block in call'
lib/rescued_tenant_elevator.rb:10:in `call'

在搜索Ros-aptment的文档文档之后,该问题是在致电 @app.call(env)

我的班级以切换租户的

require 'apartment/elevators/subdomain'

class RescuedTenantElevator < ::Apartment::Elevators::Subdomain
  def call(env)
    super
  rescue Apartment::TenantNotFound
    [302, { 'Content-Type' => 'text/hml', 'Location' => Rails.application.routes.url_helpers.root_url }, self]
  end

  # needed to work
  def each
  end
end

任何想法后的通用调用中的问题吗?

After updating ruby version from 2.7.4 => 3.0.0 seems that ros-apartment gem cannot switch between tenants.

NoMethodError (undefined method `decode' for URI:Module):
  
lib/rescued_tenant_elevator.rb:10:in `block in call'
lib/rescued_tenant_elevator.rb:10:in `call'

After searching in documentation of ros-apartment seems that the problem is on generic call after calling @app.call(env)

My class for switching tenants

require 'apartment/elevators/subdomain'

class RescuedTenantElevator < ::Apartment::Elevators::Subdomain
  def call(env)
    super
  rescue Apartment::TenantNotFound
    [302, { 'Content-Type' => 'text/hml', 'Location' => Rails.application.routes.url_helpers.root_url }, self]
  end

  # needed to work
  def each
  end
end

Any idea ??

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

残月升风 2025-02-03 13:13:45

直到公寓宝石释放我修复的任何更改

module URI
  def URI.decode(url)
    url
  end

  def URI.escape(url)
    url
  end
end

Until apartment gem release any change about that i fixed it re-adding the URI methods in init

module URI
  def URI.decode(url)
    url
  end

  def URI.escape(url)
    url
  end
end
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文