Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/csharp-4.0/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails Rails拥有gem和未初始化常量_Ruby On Rails_Gem_Ruby On Rails 3.2 - Fatal编程技术网

Ruby on rails Rails拥有gem和未初始化常量

Ruby on rails Rails拥有gem和未初始化常量,ruby-on-rails,gem,ruby-on-rails-3.2,Ruby On Rails,Gem,Ruby On Rails 3.2,我在试着做我自己的宝石,但我还是有一个错误 以下是我的宝石结构: 秩序 -应用程序 -控制器 -order_controller.rb -解放党 -命令 order.rb 和订单的内容_controller.rb: class Order::OrderController < ApplicationController def index puts "asd" end end 但当我尝试访问主页时,我得到: 未初始化的常量顺序::OrderControlle

我在试着做我自己的宝石,但我还是有一个错误

以下是我的宝石结构: 秩序 -应用程序 -控制器 -order_controller.rb -解放党 -命令 order.rb

和订单的内容_controller.rb:

class Order::OrderController < ApplicationController
    def index
       puts "asd"
    end
end
但当我尝试访问主页时,我得到:

未初始化的常量顺序::OrderController


我做错了什么?

在gem文件中添加gem后,是否运行了bundle安装?顺便问一下,为什么要为该结构制作一个gem而不是用该结构制作一个Rails项目?

我尝试了两种方法,另外我也尝试了中描述的解决方案,但输出总是一样的。。。
root :to => "order/order#index"