Answer the question
In order to leave comments, you need to log in
rails. Ubuntu. Why in Windows in the browser it is impossible to display a site that is running in a virtual machine (ubuntu) via localhost:3000?
In the rails virtual machine, the project (rails s) is launched, but in Windows it does not display anything.
What could be the problem?
Answer the question
In order to leave comments, you need to log in
Actual rails only bind port 3000 to localhost.
Therefore, we fix:
config/boot.rb
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
require 'bundler/setup' # Set up gems listed in the Gemfile.
require 'rails/commands/server'
module Rails
class Server
alias :default_options_alias :default_options
def default_options
default_options_alias.merge!(:Host => '0.0.0.0')
end
end
end
Because you need to forward ports from the virtual machine to the local host machine. In Vagrant, this is done with one line in the virtual machine config.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question