Mysterious Mongrel Rails crash - ruby-on-rails

Running Mongrel 1.1.5 on Rails 2.1.2 using PostgreSQL 8.3 via ruby-pg 0.7.9 on OS X 10.4 server...
Added restful_authentication and exception_notification, the latter of which appears to be doing me no good when Mongrel simply dies with "Illegal instruction" every time I select /RESOURCE_NAME/new.
Doesn't matter what resource.
In development.log I see it's declaring its intent to render /layouts/RESOURCE_NAME.html.erb and then ... nothing. No stack trace, no anything. server.log is empty.
This is something of a showstopper and I'm not sure what to do. I tried running webbrick, a la:
script/server webbrick --force
But it ignores my wishes and loads mongrel anyway.
Any pointers would be appreciated.

My guess would be that it's dying when it drops from Ruby down into the Postgress C-library to talk to the database. Possible causes of this might be
You've got the ruby-pg gem for a different OS or version somehow.
Your ruby-pg doesn't match the Postgres libs on your system.
Something else...

Illegal instruction usally happens when you try run a binary from an other OS/ABI/Architecture.
Maybe 32bit vs 64bit? Check your libs!

Related

Debugging rails on passenger

I am running a Rails 5 API on passenger locally.
I start the server with passenger start command.
I installed both byebug and pry-rails but none of them are working for me.
I put a debug point, either with byebug or binding.pry, and when the code hits that point it does print the debug point in the server logs, with the code that it is executing but it doesn't actually stop, and I can type but I don't see the results of what I type.
I am starting to believe, based on posts like this one:
https://coderwall.com/p/rtskuw/create-break-points-in-rails-with-passenger-phusion-pry-pry-remote
that I can't actually debug like I debugged on rails s with passenger, but I don't actually want to believe that. There must be an easy way for me to debug the rails code on my passenger terminal without having to open a different terminal to act as a remote client or something like that.
Thank you very much

Rails returning empty assets in development

From "out of nowhere" (as it seems), all of a sudden my Rails 3.2.21 development environment started returning empty assets after a few successful requests from my browser. The network tab looks like this:
I'm running this on OS X 10.10.2. The upgrade from 10.10.1 is the most noteworthy thing that has recently happened on this machine. I cannot relate it to new gems either, since it seems to happen with the gemset that still worked fine last week. Also, it happens in all browsers I've tried (Chrome, Safari and Firefox). Clearing browser cache doesn't help. Clearing the asset cache doesn't help (e.g. with rake assets:clean). The only thing that helps is killing the rails server and then starting it again. I'm now almost always down to 1 successul request and then it breaks again.
Other details: I'm running ruby 2.0.0p598 via rbenv. The webserver is thin_glazed.
I'm completely stuck... is there anyone who has a clue as to what might be going on? Thanks!

Wrong number of arguments(1 for 0) on every page, even info

I have created a rails 4.0.0.rc1 project on my desktop pc using Ruby 1.9.3. When I try to run it on my laptop I always get the above exception, no matter which page I request. It even happens on /rails/info/properties. Both computers use the same Ruby and Rails version.
The project still works fine on my desktop PC. I am using a Rubymine development server, I have tried running Rails S in command prompt, but I still get the same error.
I realise this means that I am somehow passing a parameter when I should not be, but I have no idea how I'm doing that. What is going on here?
I have tracked down the gem that seems to be causing this. In this case it seems to be 'Therubyracer' causing this issue for me. For some reason I do not have to include it in my gemfile on my desktop, but my laptop does require it to be included.

ruby just dies on "ActiveRecord::Base.establish_connection"

this is a follow up to my other question regarding unicorn. following problem:
i'm using ruby 1.8.7, rails 3.0, pg gem (0.13.0).
when i start the rails console in production mode, i can query records etc, so the
database connection and the pgsql adapter works. i can disconnect the AR connection via ActiveRecord::Base.connection.disconnect!, but as soon as i try to reconnect using ActiveRecord::Base.establish_connection, ruby just dies. no error, no log output, no seg fault, it just quits (with status 1). i tried setting the host in my database.yml to the postgres unix socket, as well as to 127.0.0.1, doesn't change a thing. what could be the problem, or what can i do to get to the root of this? i'm not sure how to debug this, with absolutely no output or error message.
i solved the problem (more or less) by downgrading pg to version 0.11.0. this works for me for now. cost me 1 and a 1/2 days ...
Why are you closing explicitely the connection to the database ? Rails/AR handles the connection pool for you. The rack middleware is supposed to release connections at the end of the request processing.

Rails server always crashing no error

My rails server is always crashing (Ruby console)
I am using windows 7 and I dont get any error in the console. Just an windows error telling my the ruby console how stop working.
Will be great if you add more information about version of Ruby you're using (ruby -v), Version of Rails (saying version 3 is not enough) and any more specific on your settings, like if you're using a MySQL database and how you're connecting to it.
So far, I can point you the the following resources:
Incorrect usage of MySQL library (libmysql.dll) can result in random crashes of Ruby/Rails. See manual installation and compilation steps here
There is a known issue with Ruby 1.9.2 that make it crash on concurrent/multiple threads, reported in Ruby bug tracker #3840. It was not solved in 1.9.2-p290 but is part of Ruby 1.9.3 (due to release in August)
Again, those are the two thing that I can think of based on the scarce information you provided. Please update your question with more details (the development.log file inside log directory should contain something) or even the output that is displayed prior the crash in the console.
I would strongly suggest checking Windows event log and/or ROR logs. Also, what version of ROR are you running?

Resources