rails 3.2.1 very slow in development mode - ruby-on-rails

Since i upgrade my app on my development server, the request are terribly slow. Event if the log seems to render quite quickly, it take 10-15 second for the loading to be complete (event if the page is already fully loaded)
My configuration :
Rails 3.2.1
Ruby 1.9.3-p125 (rvm)
Standalone Passenger (3.0.11)
I do not have this kind of issue on my development machine, so i guess the problem is not coming from my application

I had a very similar problem. Found this question ( Slow assets ruby 1.9.3, macos, rails 3.2 ) which helped me discover it was chrome where the problem was occurring. Still don't know why, or how to fix it.

In my case it was Rails Panel extension that was slowing Chrome. I just disabled it and it the app became 3 times faster.

Related

Why do I suddenly get a blank screen with Rails on localhost?

I have combed through lots of references to this issue (most recently followed tips on this post, but nothing helped.
Here's the issue: I already have a Rails app that works-or used to work on localhost:3000. But then, suddenly I get blank screens with the same app. The app works with no problem in rails console. The default Rails screen shows up too. The more I read abut blank screens, the more I am lost.
So the sequence of events--all potentially could be complicating factors:
I run the Rails via CLI.
I also have MAMP installed to work with a WordPress site locally.
At one point, either before MAMP or after MAMP, I installed Brew. (All were done following online instructions.)
Not long ago, I tested out a simple Rails app on Heroku, which at first worked, but then the app no longer could be updated. After much tinkering, I removed rbenv and the problem went away (ie my Rails app could be updated on Heroku again).
All of these issues seem to be related. But are they? How do I find out?
Rails 5.2.1
Ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]
What do you mean by suddenly went blank? Look for before/after steps you took. Also, check the Rails logs to see what's wrong. This might also be useful: https://stackoverflow.com/a/39476142/888278

Rails server hanging even with even freshly created app

My rails server started hanging today, so I tried running different apps to see if the issue was caused by my app, even created an empty app and with that even the default page doesn't come up.
I've been using it as just an http server, testing front-end with adding files into the public folder, so, I don't even compile any actual ruby code, just plain HTML, CSS and JS.
When I try to browse localhost:3000, the page is unresponsive, I can't even view source and I'd like to add that this happens with Chrome, Safari, IE and Edge, so I don't think it's a caching issue on the browser front.
I tried running the server on a specific ip and port, also tried the 0.0.0.0 trick mentioned on some other questions, doesn't help me so far.
I'm using ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin15] and Rails 4.2.5.
Any ideas?
Well, I ended up resolving the issue by uninstalling and reinstalling the whole stack. Couldn't find the reason behind the issue but if you get stuck with the same problem, apparently a complete reinstall fixes it...

Alternative to using Passenger for rails on FreeBSD9.1?

I want to use Ruby on Rails via rbenv with Apache2.4 on FreeBSD9.1, running ruby-2.0.0p247 and rails 3.2.13.
My problem is that rails needs a hook into apache, which would normally be accomplished using passenger. However, due to a bug in the OS, passenger won't work. Linkage below detailing the specific OS bug. I'd like to get things moving well before FreeBSD9.2 arrives (9.2 resolves the issue).
Is there an alternative to passenger? How can I accomplish my goal in the least exotic way possible?
urlpassenger on github commit: check for broken freebsd version
urlCatching C++ std::bad_cast doesn't work in FreeBSD 9.1
urlWhy does catching std::bad_cast not work on FreeBSD 9?
Conveniently, and even after much initial research, after posting this question, another useful answer was discovered. While quite comprehensive, I'm not sure it entirely answers my original question. Any help on this matter is appreciated.
Note: I work at Phusion.
You can use any of the other app servers described at Ruby on Rails Server options. Unicorn, Puma, Thin... they will all get the job done, though not necessarily as easy as Phusion Passenger.
But if you prefer Phusion Passenger then there's still hope. A pull request came in a couple of days ago which works around the FreeBSD bug: https://github.com/phusion/passenger/pull/87
I haven't got time yet to review the pull request (I'm too busy doing my yearly taxes) but perhaps you can try it out yourself. Installation instructions for the git repo are documented in the readme.

Reverse engineering what version of ruby and rails a project was developed under

Some background:
I am new to Ruby and Rails and I've been assigned to get an already completed Ruby on Rails project to compile from source.
The project has, as far as I've been able to discover, little to no documentation on how to set it up. The developers are unavailable for me to contact.
After doing some tutorials and learning the basics I have been trying to get the code to compile and run. My platform/setup is currently:
Windows 7
Ruby 1.9.3
Rails 3.2.13
Although I am attempting to develop with a VirtualBox Ubuntu setup alongside of this because I suspect it will be easier in the long run.
Despite there being no Gemfile for this project I have managed to (I believe) pin down and install all of the necessary gem packages (hopefully compatible versions). I am now running into this issue:
in alias_method': undefined methodpath' for class `ActionController::UploadedStringIO' (NameError)
As far as my searches have led me to believe this is a bug that can occur when the versions of Ruby and Rails are not correct/incompatible?
Is there a way to "reverse engineer" what version of Ruby and Rails was used to develop this project in the first place from the code alone? Could this bug be caused by me using 3.2.13 Rails if the original developers were using 1.8.7 Ruby? It seems to me that if I can emulate their setup closely enough then the source should compile and I can get down to business.
Additionally I am using the default WEBrick server. Is there a way to determine what the original team used for the web service? Does it even matter if they used a Apache setup or are these server implementations mostly interchangeable aside from efficiency?
Thank you for your time. If you have any further advice on how to handle this sort of project I'd love to hear that too.
If there is no Gemfile, it points to the Rails app being 2.3 or earlier. As for the Web server, they are interchangeable, but there is really very little chance that they were using Webrick, due to its ability (or lack thereof) to handle many concurrent requests. Chances are, they were using mongrel, or passenger via Apache or Nginx.

Rails 5.1.7 Server Hangs On First Request

We are trying to update a Rails Server to release 5.1.
Server starts fine; but on the first request, goes completely dead; and has to be killed with signal 9.
Doesn't matter if its Puma or Webrick.
Doesn't matter if its 5.1.0 or 5.1.7
Doesn't matter if its development or production mode.
Eventually I saw the process size was 90GB and growing!
I've tried rbtrace, but struggled to get anything meaningful out of it.
I'm on osx, so strace isn't available, and I've struggled to get dtrace or dtruss to work, or produce anything meaningful.
So looking for a way to get this rails server to tell me what it's problem is....
Let me know what additional information is salient.
After quite a long process, I found a solution that didn't so much find the source of the issue, but provided a process to work around it.
First off, I used
rails app:update
And accepted all of the overwrites. Then using git, I walked through all of the removed code from my config file and returned just the required sections [like config/routes.rb, and ActionMailer config, for example].
Application then started right up, no issue.
This also led me to
http://railsdiff.org/5.0.7.2/5.1.0
Which is pretty critical for Rails upgrading. This is well worth consuming:
https://github.com/rails/rails/issues/31377#issuecomment-350422347

Resources