I recently installed Thin for serving our Rails 2.3.5 app on Heroku. But I'm getting errors like these:
Errno::ENOENT: No such file or directory - /app/tmp/members_packaged_uncompressed.js
NoMethodError: undefined method `will_paginate' for #
These errors also occur locally when I run our app with Thin in production mode. Seems like there needs to be something configured for Thin to work properly with our code? Webrick does not give these errors for our app.
Any advice?
Related
So I am using rails with puma and nginx as my reverse proxy and server for a rails API server.
Every time I make an update on my files , such as updating the model , or controller. I've discovered that my files weren't updating on to production. Discovering this, I found out that I had to restart my puma and nginx each time i made a change.
After i restart both puma and nginx , i see that my APi server looks updated. So i decided to check the console through "rails c production" and I discovered that it couldn't load any of the models and would just keep returning me
NameError: uninitialized constant Post
from (irb):1
Fiddling restarting my servers back and forth , or maybe a period of time , it would magically work on it's own and my files would be updated. Could someone explain to me how do I update my rails production server ? and why is this happening.
I installed rails recently and I have been having quite a bit of trouble just trying to install everything, but it is finally done and now when I try to launch a rails server I always get an error and the server ends up stoping at that exact moment.
Here is what it says:
NoMethodError `new_with_config' for
ActionDispatch::Routing::RouteSet:Class.
I am using Rails version 5.0.0.1
I added Paperclip to my app then tried to deploy to my VPS using capistrano. The deploy happens successfully, but when I try to access my app on the VPS, I get the Rails Error Page.
There is no information in production.log, but unicorn.log has the following error:
E, [2013-06-25T19:44:07.372060 #21995] ERROR -- : uninitialized constant Paperclip (NameError)
/home/deployer/apps/arcsite/releases/20130625182331/config/initializers/paperclip.rb:1:in `<top (required)>'
The initializer file is paperclip.rb and has these contents:
Paperclip.interpolates :zone do |attachment, style|
attachment.instance.zone_id
end
It's an interpolater to allow me to use the folder structure I want.
If I remove the paperclip.rb initializer file, I get an error that has_attachment is undefined in my class, making it seem like the paperclip gem isn't being properly loaded.
I tried to uninstall/reinstall the gem, but when I ran gem uninstall paperclip, it told me that the paperclip gem was not installed. When I ran bundle show paperclip it did show a directory (I'm using RVM), so I manually installed the paperclip gem with gem install paperclip. I'm still getting the same error.
This app works fine in development on the thin server.
My VPS setup:
nginx
unicorn
rvm
capistrano
rails version: 3.2.13
paperclip version: 3.4.2
I followed Ryan's screencast to set up nginx/unicorn
Turns out it was some weird installation behavior. Had to work with the RVM people and have updated the rvm capistrano documentation to reflect the new procedures.
So the problem was that unicorn wasn't recognizing my newly installed gems, all I had to do was simply manually stop and then manually start unicorn and everything got taken care of. I had this exact same issue after deploying my app with paperclip installed.
In the application's root directory through SSH--
service unicorn_"app name" stop
followed by
service unicorn_"app name" start
I got an error while running ruby script/server,
DRb::DRbConnError in HomeController#index
druby://localhost:3333 - #
Iam not able to understand where is the exact error, is there any gem missing or server issue.
I don't know what the ruby app you are trying to start is supposed to do but it seems to use a DRB server, which you would have to start before.
I've tried those 3 hosting approaches for my Rails app, and no matter what I do, I can't get consistant logging when I run in the production environment.
For my tests, I created a blank app and tried to access the root directory. I would then add a users scaffold and rake the database.
If I turn RAILS_ENV to development, the log/devlopment.log works just fine, logging everything that I would expect.
When I turn RAILS_ENV to production, the log/production.log logs in a strange manner. In Passenger, I get the first routing error. Then nothing. When I restarted apache or nginx, I would get all the routing errors that I had caused since the first (logged) one, then the log would fail to write anything new until I restarted the underlying server. apache2/error.log would get logged to if I had a configuration issue. Then it only logged cache misses
With Thin and Unicorn, I only get errors about the static assets (I did not precompile the assets). Once I precompiled the assets, no more log messages appeared.
On all 3 setups, I would get precompilation messages (when I ran assets:precompile) in production.log (indicating that Rails could at least write to the log).
Does anyone have a Rails 3.2.1 app that is running on one of the deployment gems (Passenger, Thin, or Unicorn), that is logging correctly in production mode? I've spent 5 days working on this. I'm out of ideas.
Turns out its a reported issue in Rails 3.2.x. A fix has been submitted and will hopefully be released with Rails 3.2.2.
https://github.com/rails/rails/issues/4277