Passenger Standalone after Version 5.1.12 Issues / Nginx / Rails - ruby-on-rails

Using Passenger Standalone on version 5.1.12 works just fine. All the routes to rails and it's specified ports in nginx configs pull up great.
But after that version, the app's routing returns a 404. Also subsequent reload causes images to go missing. Then back again tot he routing 404 on the next reload.
Has anyone faced the same issue and any solutions out there?

Related

wrong number of arguments (given 0, expected 1) after deployment JROR

Ror Experts,
I am having some kind of routing issue (I think so..). The Ahoy tracks visits and events in the development environment - running under webbrick server. When the application is deployed using warbler and published to apache tomcat server, it throws 500 error, Wrong number of Arguments (given 0, expected 1) while trying to log events. Tracking visits works as expected.
I have already tried suggestions mentioned in ahoy github account (https://github.com/ankane/ahoy/issues/356) without success.
I tried to debug if the data from react code is sending data as expected. It is indeed sending the data. I tried to post the data using postman directly to the controller using the same load to both development and deployed environment. It works on development but not on deployed.
I also tried to check error logs on the server. There is no information except 500 error.
Can someone help me out...
PS:
Prod server: Apache Tomcat
Environment: Jruby on rails
Front End: React
Found a solution. Fixed using gem as integral part of application instead of gem...... Still doesn't know what caused the issue. My gut feeling is some kind of routing issue with jruby and bundler warbler.

Deploying Rails/Passenger via nginx

I'm having a hard time figuring out where I'm going wrong in trying to deploy a Rails app via nginx. Rails is accessible via site.com:3000 (after starting it with rails server), and site.com:80 displays the standard nginx "working, but further configuration required" page. I've spent a few hours trawling the documentation trying to figure our how to get my Rails app accessible at :80 rather than :3000, but to no avail.
I think it's most likely that I'm misunderstanding how nginx, Passenger, and Rails work together, and have therefore configured my nginx.conf incorrectly (one page I found implied that I shouldn't both be using nginx and running rails server). Any and all help is hugely appreciated.
Possibly relevant version numbers:
Rails 4.1.4
Ruby 2.1.2p95
CentOS 6.5
nginx 1.6.0
nginx.conf partial: http://pastebin.com/A3JD09pr
I'm new at this, so it turned out that a couple things were up:
I needed to put export rvmsudo_secure_path=1 in my .bashrc instead of just running it once, following up with source ~/.bashrc in the terminal. This allowed me to run "rvmsudo" commands to start on port 80 rather than the default 3000.
I had both nginx and Rails competing for port 80, so I had to stop nginx's static page server to allow that. Simple as nginx stop.

Phusion Passenger / Apache Not Running Correctly on Mac OSX Maverick

After updating to OS X Maverick on my MacBook, my local dev environment was broken - Apache httpd.h file missing on MacOSX after Mavericks Upgrade (** Updated for Yosemite **)
Now after resolving the issues I can't seem to run my local web server on port 80 (localhost).
If I go to 'localhost' I see It works! which is the default apache page.
If I run passenger start I can view my app at localhost:3000 but that's a passenger standalone web server running, not apache.
If I run sudo passenger start -p 80 --user=martin I get the message:
The address 0.0.0.0:80 is already in use by another process,
perhaps another Phusion Passenger Standalone instance.
If you want to run this Phusion Passenger Standalone instance on another port,
use the -p option, like this:
passenger start -p 81
I can't remember what I did when I first set up Rails on my laptop, I'm sure I ran passenger start at the very beginning and didn't need to do it after that and from reading more about it online, apache should run passenger automatically by itself but apache doesn't seem to be doing anything but show the default start page and I don't know why.
I think Maverick created a new httpd.conf but I don't see much difference, I have made sure that the three extra lines running passenger-install-apache2-module returns is at the end of the config file.
The passenger gem is the latest version, Rails version is 2.3.14 and ruby is 1.8.7 so quite old but shouldn't matter I don't think as it worked perfectly on localhost before without having to add port 3000 to the url so just hoping someone with a bit more experience of using Passenger can help.
I've tried reading loads of other questions and forums and also the Phusion Apache documentation.
`
I had the same problem. I restored the previous httpd.conf file in /etc/apache2. The file had been renamed httpd.conf.pre-update. I restarted the server with apachectl restart and all was fine again.
I checked the differences between the old and new httpd.conf files, and they were very small (but crucial):
1) The line to include virtual hosts was commented out.
2) The line to include the PHP module was commented out.
I uncommented both lines and problem solved.

Rails application running through nginx forcing https despite contrary setting?

I have been working towards deploying my rails application, and while there have been some kinks I've been able to work through most of them. The latest is quite perplexing, however.
My setup is as follows:
Ruby 1.9/Rails 3.2 App w/Phusion Passenger --> nginx on CentOS 6.2 --> Varnish cache server
Despite config.force_ssl being set to false AND being commented out in the production.rb file, the server is still forcibly redirecting to https (which is not yet functional in my case). The server has been restarted repeatedly via 'killall nginx' and '/opt/nginx/sbin/nginx', so the setting should be taking effect.
My first thought was that perhaps the cache server was lagging behind, but this isn't the case.
What makes this particularly odd, though, is that the application works fine if not put into production mode. If I edit nginx.conf to instead use development mode, the site works flawlessly.
What could be the culprit? I am very much new to this facet of server maintenance and IT so I have no idea.
Turned out that it really was varnish being over-aggressive.

Rails + nginx - work together

I installed passenger, nginx (1.2.1) and Rails 3.2.3. However I keep using WebBrick as a server for Rails because I can't figure out how to make them work together. In other words, how to run a website, I'm working on, on nginx.
Any suggestions?
There are several solutions on the web includin nginx and thin which is a good combination. Here is one that worked for me:
http://blog.expertura.de/posts/17
Also one very good but in german (of cause code is still correct):
http://www.netzlogger.de/2010/02/rails-applikationen-mit-nginx-und-thin.html

Resources