简体   繁体   English

未初始化的常量Rails :: Server(NameError)

[英]uninitialized constant Rails::Server (NameError)

Currently while trying to set up my ruby files, i am running into this problem. 目前,在尝试设置我的ruby文件时,我遇到了这个问题。 Im not sure what the problem is, as Rails is correctly installed. 我不确定是什么问题,因为正确安装了Rails。 I am mostly new to Rails/Ruby, and am picking up rails. 我主要是Rails / Ruby的新手,并且正在学习Rails。 I haven't seen this problem else where. 我还没有在其他地方看到这个问题。

I am working on windows 10, all gems are installed, and rails is installed. 我正在Windows 10上工作,已安装所有gems,并已安装rails。 Im am running this in RubyMine. 我正在RubyMine中运行它。

Here is the line where the error is thrown: 这是引发错误的行:

config.action_mailer.asset_host = ' http://localhost :' + Rails::Server.new.options[:Port].to_s config.action_mailer.asset_host =' http:// localhost :'+ Rails :: Server.new.options [:Port] .to_s

Here is an image of the console Console 这是控制台的图像控制台

Your need 您的需要

require 'rails/commands/server

before call Rails::Server 在调用Rails::Server之前

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM