Rails 5 + Foreman + Pow gives me "Couldn't proxy request to localhost:5000" - ruby-on-rails

I'm trying to use Foreman and Pow to work with a Rails app locally. Foreman is working and I can access the app on localhost:5000. The problem is when I go to access myapp.dev, I get the pow error page with this message:
Proxy Error
Couldn't proxy request to localhost:5000.
Error: connect ECONNREFUSED
I know that Pow, Foreman, and Rails work on my system because I have them configured in other apps and they work fine. The only thing I can come up with for what's different between this app and ones that are working is this app uses Rails version 5.0.0rc1.
I can't just give up on Pow because one of the requirements for this app is using subdomains which I can't work with without a proper domain name.
I'm wondering if anybody else has had a similar issue with a Rails 5 app or has any clue what is going on here.

I had a similar error on OS X. Using symlinking instead of the port mapping seemed to fix this, even for an app running on a seemingly random port.
cd ~/.pow
ln -s /path/to/myapp
And then go to myapp.dev

Related

When running "rails server" why does my localhost refuse to connect on both Chrome and Firefox?

I'm trying to see my Ruby on Rails app on my localhost, when I run rails server it looks like it is running good with no errors but when I open up my localhost at http://localhost:3000/ it redirects me to https://localhost:8080/ and says refuses to connect. I am able to open my localhost files with no problems but when I run rails server and open localhost with the port it redirects me to https instead of http no matter what I do. I even tried running with different ports. I am on Ubuntu and my app is using Puma.
I have done the following so far:
Cleared all my cache & history
Opened incognito window
Ran rails server with different ports
Changed some about:config settings to false in firefox
Have searched localhost in 'chrome://net-internals/#hstsand' but says not found
I've tried the other solutions on this link: Google Chrome redirecting localhost to https
None have worked at all. What could the problem be?
I get this error on Chrome
And this error on Firefox
Any advice on this helps! Thanks.
EDIT: Let me know if this needs to be changed, this is how I have my
etc/host/ set up
After scrolling through posts and much research my issue was that I did not run yarn before running rails server. I found this post and referred to this answer https://stackoverflow.com/a/58369306/14365156
But I did not follow those steps exactly, I only ran yarn then ran rails server and now am finally able to view http://localhost:3000/. Hopefully this helps others!

Deploying rails app on Digital Ocean with passenger and NGINX

This is the very first app I am deploying so I'm not 100% familiar with the whole process.
Right now, all my code for the app is on my server, and if i run rails s and bind it to my droplet ip, it shows up perfectly(i.e. if i go to myipaddress:3000).
But, if I just go to myipaddress on my browser, i just get a 500 error page.
I am confused about the whole process, do i have to have my rails s running the whole time when deployed and running on the server?
If not what am I doing wrong and how can i fix it so that it just shows up when I go to my droplet ipaddress?
My nginx.conf file has its server name pointed to my droplet ip and its root pointed at my apps root folder.
Also, im not getting any errors logged into my nginx/log/error.log file
First of all you don't need to start server with rails s.
You just need to install passenger and nginx for start application with installation of ruby on rails.
And if you just want to check your app is running or not then start server with rails s into digitalocean and try to open it with browser with `ip:3000' then it will work.
From this Ref. link you can start with passenger and nginx.
Let me know if you need more help.

Deployed Rails3 but not showing up outside of server

I just deployed my Rails3 app to a linux server with Capistrano and Unicorn using mysql2. I keep getting the error "Oops! Google Chrome could not connect to 172.16.128.125" when trying to access the app in a browser.
What is weird is that I see no errors in the ./log/production.log file and if I use lynx on the server, I can render all pages of the app.
What am I missing? It works locally on the server but not outside the server.
Sounds like you might not have Apache running, or port 80 may not be reachable on that machine due to firewalling or routing issues.

Rails only responds when accessed from local machine

I'm running a Rails application on a Mac Mini server machine (with Webrick, running ruby 1.9.2 using rvm). It works fine when I run it locally on my MacBook, and it was working before I reinstalled rvm, but now whenever I try to access it from a browser on my local machine, it simply hangs and doesn't respond.
If I do a curl http://0.0.0.0:3000 on my server, though, I get the webpage back fine.
I created a fresh Rails app just to double-check it wasn't a problem with my app, and I get the same problem. I also get the problem with Mongrel, and if I try running a bare Sinatra app with Thin.
It sounds like the same problem documented here: Webrick is very slow to respond. How to speed it up?, but I tried modifying my config.rb file to use :DoNotReverseLookup => true, and it didn't help.
Any ideas?
I don't think the issue is related to Rails or your dispatcher. It looks like the OS firewall is blocking ingoing requests to port 3000. Did you try to allow all ingoing connections from your System Preferences ?

Rails Dev Server not visible on network

Trying to do something very basic and test my Rails app on my phone.
Starting the server with:
rails s
But when accessing mymachinename.local:3000, Mobile Safari says that the server stopped responding after about 30 seconds.
I do this all the time on other machines, but I have no idea what could be causing it here. Any suggestions?
I've had a similar issue before trying to access the server from a virtual machine, I had to use the following format for the rails server command:
rails s -b your.dev.ip.address
Whoops. Firewall. Don't know why I even had it turned on.

Resources