I started a simple rails server and set the root url to display an html page. It started on localhost:3000 but when I try to access it using my browser (Internet Explorer 8) it says page cannot be diaplyed. The console is not showing any error. It just says server running on localhost:3000
Console output
=> Booting WEBrick
=> Rails 4.2.6 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2016-04-27 12:32:39] INFO WEBrick 1.3.1
[2016-04-27 12:32:39] INFO ruby 2.2.4 (2015-12-16) [i386-mingw32]
[2016-04-27 12:32:39] INFO WEBrick::HTTPServer#start: pid=5752 port=3000
The most probable problem of that you have firewall and it blocks the requests to server, additionally it could be happened that name localhost is redefined, so I'll propose a 3 steps to fix:
Drop your firewall or reset it to allow accessing to 127.0.0.1, that should be resolved as localhost;
Restart app as:
rails s -b 127.0.0.1
key -b tells your server to bind it on just IP: 127.0.0.1;
Enter url: http://127.0.0.1:3000
Related
Can't access my ROR app.
On c9 workspace and I start ROR app and get this output
`Array values in the parameter to
`Gem.paths=` are deprecated.
Please use a String or nil.
An Array ({"GEM_PATH"=>["/usr/local/rvm/gems/ruby-2.3.4", "/usr/local/rvm/gems/ruby-2.3.4#global"]}) was passed in from bin/rails:3:in `load'
=> Booting WEBrick
=> Rails 4.2.3 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2018-07-02 22:39:12] INFO WEBrick 1.3.1
[2018-07-02 22:39:12] INFO ruby 2.3.4 (2017-03-30) [x86_64-linux]
[2018-07-02 22:39:12] INFO WEBrick::HTTPServer#start: pid=1685 port=3000 '
however when I try to access the app using http://localhost:3000
I get this message
This site can’t be reached
localhost refused to connect.
Did you mean http://localhost3000.org/?
It looks like app is running however I can't access it. Why ?
after running "rails server" on my mac to start my application, my terminal does not allow me to write commands in the terminal. All I get is the following, with the problem that I can not write any commands.
Last login: Mon Jan 2 13:19:07 on ttys001
Nicholass-MacBook-Pro:~ nicholaswenzel$ cd last_test
Nicholass-MacBook-Pro:last_test nicholaswenzel$ cd nofuckingidea
Nicholass-MacBook-Pro:nofuckingidea nicholaswenzel$ rails s
=> Booting WEBrick
=> Rails 4.2.6 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2017-01-02 13:23:18] INFO WEBrick 1.3.1
[2017-01-02 13:23:18] INFO ruby 2.2.3 (2015-08-18) [x86_64-darwin15]
[2017-01-02 13:23:18] INFO WEBrick::HTTPServer#start: pid=8743 port=3000
Can anyone help?
You can start your server in a background:
rails server &
But, usually, this problem can be resolving by starting an additional terminal process (open new terminal window or tab). In this case, you'll be able to see server logs in runtime.
Before you mark this as a duplicate, know that the difference between this question and the other questions is there are no errors in the console or logs for me!
=> Booting WEBrick
=> Rails 5.0.0.alpha application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2015-10-25 17:32:22] INFO WEBrick 1.3.1
[2015-10-25 17:32:22] INFO ruby 2.2.2 (2015-04-13) [x86_64-darwin14]
[2015-10-25 17:32:22] INFO WEBrick::HTTPServer#start: pid=33823 port=3000
Started GET "/" for 127.0.0.1 at 2015-10-25 17:32:35 -040
Produces a 500 internal server error: "We're sorry but something went wrong. If you are the application owner check the logs for more information."
I've tried:
changing the rack version to 1.6.2 (ruby requires >2.0)
using a different port
binding the rails server to localhost
hitting 127.0.0.1:3000, 0.0.0.1:3000, etc
Any ideas?
When generating toy_app using scaffolding I can go to the root site using the local server, but when I try to go to the page /users I get the following error message: "Errno::ENOENT in UsersController#index"
The page should allow me to enter a new user.
When I try to restart the server and run rails server -b $IP -p $PORTI get the following:
sunny_dee#rails-tutorial:~/workspace/toy_app (master) $ rails server -b $IP -p $PORT
=> Booting WEBrick
=> Rails 4.2.0 application starting in development on http://0.0.0.0:8080
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2015-04-27 18:06:55] INFO WEBrick 1.3.1
[2015-04-27 18:06:55] INFO ruby 2.1.5 (2014-11-13) [x86_64-linux]
Exiting
/usr/local/rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/socket.rb:206:in `bind': Address already in use - bind(2) for 0.0.0.0:8080 (Errno::EADDRINUSE)
I finally got it to work by restarting the workspace. I'm guessing that is what restarted the local server. I was trying Ctrl-C but it was not working.
The tutorial uses Cloud9 and since it's a cloud IDE closing/logging out did nothing but when I clicked on the button to the left of "Share" on the top right corner and the clicked on "Restart" the page ran correctly.
Hopefully my stupid question can help someone else as well. Thanks everyone that took the time to contribute :)
If you running this application in your local Linux system just use -
rails server
Then you can access your site using http://localhost:3000/
You can also specify which port to run on using this command -
rails s -p 3001 -P tmp/pids/server2.pid
Then you can access using 3001 port.
You are getting that error because your 8080 port is already in use by some other process.
Whenever I execute "rails server" and try to visit https://localhost:3000, I get the following error message. Any Idea what's going on?
Thanks!
=> Booting WEBrick
=> Rails 4.0.2 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2014-02-04 14:00:34] INFO WEBrick 1.3.1
[2014-02-04 14:00:34] INFO ruby 2.0.0 (2013-11-22) [x86_64-darwin12.5.0]
[2014-02-04 14:00:34] INFO WEBrick::HTTPServer#start: pid=25445 port=3000
[2014-02-04 14:00:37] ERROR bad Request-Line `\x16\x03\x01\x00?\x01\x00\x00?\x03\x03R?8?Rcd?0j?`\\?6?>??f?&-??pB???B\x00\x00J\x00??$?#?'.
[2014-02-04 14:00:37] ERROR bad URI `"^;?\x00?D\x1D??׆?wјH?\x15?.\x10M?\x00\x00J\x00??$?#?'.
[2014-02-04 14:00:37] ERROR bad Request-Line `\x16\x03\x00\x00E\x01\x00\x00A\x03\x00R?8հBo?㦈r?\x19'.
You're trying to connect via HTTPS, which is not supported. WEBrick is expecting plain HTTP so it does not know how to parse the encrypted request.
Unless you really need HTTPS in development, just use HTTP. If you need HTTPS, it is possible to do so but will require some configuration changes. For example, look at this question for how to do it with thin.