1
我正在寫一個類來編寫名爲「BravoManagementXlsReport」的XLS文件。它目前坐在以下目錄:對象無法找到後代?
所有其他報告都來自xls_report
繼承,所以我也一樣。
class BravoManagementXlsReport < XlsReport
attr_reader :file_name
...
end
當我運行工人,我得到:
2014-02-24T16:22:58Z 18204 TID-ovbv17qdg WARN: uninitialized constant BravoManagementXlsReport
,我想我應該重新啓動工人,但沒有工作,所以我重新啓動Rails服務器,但沒有任何工作。在控制檯我嘗試過:
[2] toolkit » ManagementXlsReport // this returns the object
=> ManagementXlsReport < XlsReport
[3] toolkit » BravoManagementXlsReport // this is obviously not finding it
NameError: uninitialized constant BravoManagementXlsReport
[1] toolkit » XlsReport.descendants // this returns everything but the new file
=> [
[0] SocioeconomicDevelopmentXlsReport < XlsReport,
[1] EnterpriseDevelopmentXlsReport < XlsReport,
[2] PreferentialProcurementXlsReport < XlsReport,
[3] IntermediaryBillXlsReport < XlsReport,
[4] ScorecardXlsReport < XlsReport,
[5] TrainingProgramXlsReport < XlsReport,
[6] GeneralXlsReport < XlsReport,
[7] EmploymentEquityXlsReport < XlsReport,
[8] ManagementXlsReport < XlsReport,
[9] SkillsDevelopmentXlsReport < XlsReport
]
有什麼我失蹤?我試着看看我是否有拼寫錯誤,但我看不到它。
也許嘗試對其他報告之一進行項目範圍搜索,看看是否需要首先在某處註冊它。我真的可以推薦[ack](http://beyondgrep.com/)來搜索代碼。例如,你可以執行'ack -i ManagementXlsReport'並查看除了類定義本身以外是否還有結果。 –
是的,我做了一個全系統的搜索,以防萬一有安全功能的東西。在規格中只有其他地方的後代被稱爲。 – TheLegend
您還可以搜索文件名,以防需要在其他地方需要報告。 –