SOLVED: Vagrant appears not be setting a real localhost

(Gustavo Souza) #1

hello, Im trying to set up the discourse’s environment.

but after do

vagrant up
vagrant ssh
bundle install
bundle exec rake db:migrate
bundle exec rails s

everything look fine (no errors or warnings). But when I try to run http://localhost:3000 (or 4000) on the browser it is like nothing happens.

but console still show:

[vagrant@precise32:/vagrant (master)]$ bundle exec rails s
=> Booting Thin
=> Rails 4.2.4 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
Thin web server (v1.6.4 codename Gob Bluth)
Maximum connections set to 1024
Listening on localhost:3000, CTRL+C to stop

I’m using Ubuntu 14.04

I would be grateful, if I had some directions.

SOLVED: "The connection was reset" with Discourse Vagrant
Sporadic missing letter avatars (cache problem?)
(Matt Palmer) #2

Can you be more specific than “nothing happens”? Something will definitely happen, whether that be an error message, or a lengthy period of trying to load the page followed by a timeout, or something completely different.

A couple of things you can try, to help narrow down the cause:

  • Does netstat -ltnp as root on the host machine show port 4000 as being open? If so, by what process?
  • What happens (ie exactly what output do you get, and how long does it take to return to a shell prompt) when you run telnet localhost 4000 on the host machine?

(Mittineague) #3

Those commands always worked for me until recently, now I need to do

bundle exec rails s -b

(cpradio) #4

Yeah, that is due to the default for rails 4.2 specifying as the only connection, the -b allows you to connect from any IP.

(Gustavo Souza) #5

You guys were amazing, thanks a lot.

telnet was showing:

Connected to localhost.
Escape character is ‘^]’.
Connection closed by foreign host.

but -b tip solved my problems.

(Everaldo Gomes) #6

Dear @eviltrout,

I’ve installed Discourse through Vagrant and I’m testing Comments Embedding.

All seems to work fine: a topic was created on Discourse.

But, In my blog, the link “Start Discussion” points to localhost:3000

My discourse instance is accessible through

Do you know what I have to do, when using Vagrant, to change Discourse hostname?

Many thanks!


(Everaldo Gomes) #7

Dear @eviltrout,

I managed to solve. Thanks!

I went to Admin -> Settings -> Developer -> force hostname