【发布时间】:2017-03-10 07:55:39
【问题描述】:
所以我有这些代码
require_relative '../classes/obj/objs.rb'
class ObjController < ActionController::Base
def get_objs
objs = Objs::get_objs
render :json => objs
end
end
在 objs.rb 中
module Objs
def Objs.get_objs
objs = {
1 => 2,
}
return objs
end
end
在我的流浪环境中,代码运行良好,但是当我上传到我的 EC2 实例时,它最终会抱怨:
NameError in ObjController#get_objs
uninitialized constant ObjController::Objs
两个环境都使用 ruby 2.3.1p112 (2016-04-26) [x86_64-linux-gnu]
关于如何解决此问题的任何想法?
【问题讨论】:
标签: ruby-on-rails ruby amazon-web-services amazon-ec2