I'm updating my rails app to 5.0.0.rc1 in a separate branch. App was already configured to run on puma 2.14, but I upgraded to puma 3.4.0 during the update process.
I ran rails update but kept my old puma config around because nothing changed except the plugins directive which I don't care about now.
Anyway, I cannot get my app to respond in development mode, but I deployed it a staging server to see if I could get better error logs and it actually works on staging.
Before, I could access my app locally using pow by visiting:
http://app.dev
Now, that doesn't work. Neither does:
bundle exec puma -C config/puma.rb config.ru
Nor does this:
bin/rails server puma
My logs just show something like this everytime:
Started GET "/" for 127.0.0.1 at 2016-05-27 09:11:39 -0400
Started GET "/" for 127.0.0.1 at 2016-05-27 09:11:44 -0400
Started GET "/" for 127.0.0.1 at 2016-05-27 09:11:47 -0400
Started GET "/" for 127.0.0.1 at 2016-05-27 09:11:50 -0400
They never make it to Rails for processing no matter how I attempt to start the server locally. And that's all the error info I get, too. Pow's logs are similarly useless.
Any ideas whats going on?
The emotional successor of pow(latest commit on the repo is from 6 November 2014) is puma-dev. According to their docs pow is a no-go for Rails 5. Maybe you should give it a go.
Related
I have been working on a rails application for the past four months. Suddenly one-day puma server stops responding to the requests.
Here is what I see in the terminal:
$ rails s
=> Booting Puma
=> Rails 5.1.7 application starting in development
=> Run `rails server -h` for more startup options
Puma starting in single mode...
Puma version: 5.5.2 (ruby 2.6.3-p62) ("Zawgyi")
Min threads: 5
Max threads: 5
Environment: development
PID: 12446
Listening on http://127.0.0.1:3000
Listening on http://[::1]:3000
Use Ctrl-C to stop
Started GET "/" for ::1 at 2021-11-10 12:28:58 +0530
Started GET "/recommendations" for ::1 at 2021-11-10 12:29:20 +0530
Started GET "/" for ::1 at 2021-11-10 12:29:39 +0530
Started GET "/" for ::1 at 2021-11-10 12:29:40 +0530
I tried many things like changing the port, making sure that the rails version in my local and gemfile are the same, trying with other ruby versions, uninstalling and reinstalling ruby and rails in local.
Tried keeping binding.pry in the application controller's index action but that not getting hit. I am not able to exit from that point, the server gets stuck there. There are no recent changes in my application.
Can anyone suggest to me what might be the problem?
I am working on M.Hartl's rails tutorial and I opted out for using the cloud9 IDE instead of the local server in order to focus on learning rails and not worry about working on the server.
This is the crash error that I am getting:
thermobee:~/workspace/sample_app (filling-in-layout) $ rails s -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-12-15 05:19:02] INFO WEBrick 1.3.1
[2015-12-15 05:19:02] INFO ruby 2.2.1 (2015-02-26) [x86_64-linux]
[2015-12-15 05:19:02] INFO WEBrick::HTTPServer#start: pid=14300 port=8080
Started GET "/" for 174.113.76.61 at 2015-12-15 05:19:25 +0000
Processing by StaticPagesController#home as HTML
Rendered static_pages/home.html.erb within layouts/application (192.2ms)
Killed
It kept happening throughout the day. I would add code and it would sometimes get stuck saving the file and sometimes it the server would get killed as I try to view the work I've done so far. Every time I would get stuck at a different point as I kept deleting the git branch I was working on.
I apologize for the long winded question, but I did not know how to formulate this properly as there has been a lot going on. I can provide any files that would help solve this and I can also give you read access to the IDE files as well.
I have an application on Heroku, and after I update to Rails 4.1.0 I'm seeing these RoutingErrors exception:
Started GET "/assets/Elusive-Icons-5997c1a6679785a96defc4f57a3f2ff5.svg" for 177.16.216.169 at 2014-04-12 21:56:41 +0000
2014-04-12T21:56:41.397071+00:00 app[web.1]:
2014-04-12T21:56:41.397071+00:00 app[web.1]: ActionController::RoutingError (No route matches [GET] "/assets/Elusive-Icons-5997c1a6679785a96defc4f57a3f2ff5.svg"):
I installed rails_12factor and tried to put config.serve_static_assets = true on applicationl.rb but no effect. What am I missing?
As mentioned in the comments, you should input this into your cmd: rake assets:precompile RAILS_ENV=production -- this, coupled with deploying to Heroku, should solve the issue
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Why does Ruby on Rails use 0.0.0.0:3000 instead of localhost:3000?
I am starting my server locally and for some reason I am noticing this line there:
=> Rails 3.1.3 application starting in development on http://0.0.0.0:3000
Is that normal? My /etc/hosts file:
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
127.0.0.1 app.cmply.local
127.0.0.1 api.cmply.local
127.0.0.1 m.cmply.local
But I had just experimented with taking out the first line there. Could that have caused the problem? I put the first line back, but the server still says http://0.0.0.0
Any idea why that might be happening?
0.0.0.0 means that it's listening on all interfaces; in other words, anybody who knows your IP address can access your Rails application. This is normal.
Yes, that is the standard address for your application when running the rails server command,
when you run that in the terminal you'll see:
$ cd commandsapp
$ rails server
=> Booting WEBrick
=> Rails 3.1.0 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
the line:
=> Rails 3.1.0 application starting in development on http://0.0.0.0:3000
is letting you know that your app will be viewable at said address in your browser.
check out the railsguides link I posted for more info.
http://guides.rubyonrails.org/command_line.html
I'm struggling with setting up a rails-based web site in production mode. An intermediate goal would be to set up a very simple web site. I'm using Rails 3.1.0, rake 0.9.2.2, and
Ruby 1.9.2.
Here is what I tried, with unsuccessful results so far:
initially, make sure RAILS_ENV is not set
rails new test_project
cd test_project
rails generate scaffold User name:string email:string
rake db:migrate
rails s
browse to localhost:3000 or localhost:3000/users
things look OK.
now, attempt to set this up for production:
export RAILS_ENV=production
rake db:migrate
rake assets:precompile
rails s
browse to localhost:3000
PROBLEM: Routing Error; No route matches [GET] "/"
kill rails
in config/routes, add root :to => 'users#index'
rails s
can now browse to localhost:3000 and localhost:3000/users
BUT, rails generates the following errors:
Started GET "/assets/application-00960e5186894b532975562d59176a6a.css" for 127.0.0.1 at 2011-11-26 23:09:44 -0800
ActionController::RoutingError (No route matches [GET] "/assets/application-00960e5186894b532975562d59176a6a.css"):
Started GET "/assets/application-ae30e133eabbb10d9464189d3fb71e25.js" for 127.0.0.1 at 2011-11-26 23:09:44 -0800
ActionController::RoutingError (No route matches [GET] "/assets/application-ae30e133eabbb10d9464189d3fb71e25.js"):
Can anyone shed light on how to fix the above simple attempt to get a Rails 3.1 project working in "production" mode?
The fundamental problem is that the default configuration for running an application in "production" mode makes some assumptions about deployment -- primarily that you're using another webserver (eg. nginx, apache) for serving static assets. You're getting the file not found errors because by default Rails will not serve static assets in production mode
If you're trying to use WEBrick to duplicate a "production" environment, it needs to be configured to serve static assets. You can simply flip the boolean in your production.rb
environments/production.rb
# Disable Rails's static asset server (Apache or nginx will already do this)
config.serve_static_assets = false
Once you make that change and restart the server, you'll be serving the assets you precompiled using WEBrick which while inefficient, will certainly give you an idea about what it's like in production.
Routing error, go to your routes.rb file and add
resources :users
Now when you run 'rake routes' from terminal you will see the relevant routes you require to navigate this model.