1
votes

I can run my rails app fine in developemnt using:

rails s then going to localhost:3000

However, I need to test production and tried

rails s -e production, however, when I go to localhost:3000, I see nothing happen in my rails server.

=> Booting Puma
=> Rails 5.2.3 application starting in production 
=> Run `rails server -h` for more startup options
Set localhost 3000 as the default_url_option ----
Puma starting in single mode...
* Version 3.12.1 (ruby 2.6.3-p62), codename: Llamas in Pajamas
* Min threads: 5, max threads: 5
* Environment: production
* Listening on tcp://0.0.0.0:3000
Use Ctrl-C to stop

Why can't I access my production rails app? Is there any specific tutorial on how to run a production env on a local machine? I am using Mac OSX High Sierra.

1
On the browser, do you get an error? How do know 'see' that nothing happens on your rails server?luis.parravicini
Noting is outputted to the terminal I started the server onuser2012677
Haven’t used rails in a while, maybe in production mode only the errors are logged? What is the result in the browser wen you try to access the server url?luis.parravicini
what about rails s -e production -b 0.0.0.0?Josh Brody

1 Answers

1
votes

I don't believe rails logs requests to the console in production like it does in development, so you shouldn't see anything happen.

Try running rake assets:precompile before starting the server. Also, make sure you have created a database for your production environment, and that you have migrated. You can create the database like so: rake db:create RAILS_ENV=production, then just migrate like this rake db:migrate RAILS_ENV=production

If you are still having issues getting your application to run in production, check the production log.