简体   繁体   中英

uninitialized constant Rails::Server (NameError)

Currently while trying to set up my ruby files, i am running into this problem. Im not sure what the problem is, as Rails is correctly installed. I am mostly new to Rails/Ruby, and am picking up rails. I haven't seen this problem else where.

I am working on windows 10, all gems are installed, and rails is installed. Im am running this in RubyMine.

Here is the line where the error is thrown:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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