【问题标题】:Completed 500 Internal Server Error in 4ms NameError (uninitialized constant Site::Whois)Completed 500 Internal Server Error in 4ms NameError (未初始化常量 Site::Whois)
【发布时间】:2013-02-23 20:21:03
【问题描述】:

我正在使用 whois gem,并且在开发方面工作出色。当我在生产中上传它时出现这样的错误:

Completed 500 Internal Server Error in 4ms
NameError (uninitialized constant Site::Whois):
app/models/site.rb:11:in `get_whois'
app/controllers/whois_controller.rb:11:in `show'

我的 get_whois 方法是

  def get_whois
    c = Whois::Client.new
    @array = c.query(@site_domain)
  end

错误是 Whois::Client.new

【问题讨论】:

    标签: ruby-on-rails ruby whois


    【解决方案1】:

    当您尝试在 Site 模型中使用 Whois 库时,您的生产环境中似乎未正确加载它。

    【讨论】:

    • 如何测试它在模型中的加载方式?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-03-13
    • 1970-01-01
    • 2015-01-19
    • 2015-10-29
    • 2018-05-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多