Rails returning empty assets in development - ruby-on-rails

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!

Related

Ruby On Rails | Blocked Host: localhost

I've been stuck on this issue for literally hours just trying to find the answer to this.
I start with the Mac Terminal $ rails s and it loads puma & works fine until I run into the problem attached in the picture below.
Are you running on a Ruby on Rails version that was released on the afternoon of 2021-12-14 – like 6.0.4.2, 6.1.4.2, and 7.0.0.rc2?
Then you should just update to the versions released later in the night because those versions had a bug in their default configuration
There was a bug in the default configuration of the previous release such that requests in development with a port number wouldn’t be considered “authorized” requests. Requests to “localhost:3000” should work in this new version.
Updating Ruby on Rails to any of these versions 6.0.4.3, 6.1.4.3, and 7.0.0.rc3 should fix the bug.
Update: There was another bug in versions 6.0.4.3 and 6.1.4.3 regarding requests to 127.0.0.1:3000 and custom hosts. Therefore you need to update to Rails 6.0.4.4 or 6.1.4.4 which were released on 2021-12-15 to finally fix this issue.

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 on Rails app not loading stylesheet despite it being accessible on the server

I'm currently migrating my Ruby on Rails 2.3.8 apps to a new server running Apache 2.2.17 on FreeBSD 8.1 with Passenger 3, Ruby Enterprise Edition 1.8.7. For some reason, despite the stylesheets being accessible, the apps are not loading them. The code is correct and runs fine on the old setup. Has anyone ran into this?
Update: Wowwww it was an issue with the version of chromium. All is good after updating. Thanks for the help everyone.
I'd check on the permissions -- what user is the ruby process running under (for passenger), and does that user have access to the stylesheet in question.
you can use ls -l to see permission sets for the stylesheets.
This was an issue with the edge-version of Chrome I was using... Should have checked another browser before posting.

Mongrel not detecting changes in Rails classes?

I have a Rails app installed on a Slicehost server running Apache 2 and Ubuntu LTC 10.04. Things have worked beautifully up until now: I edit a file, do a quick mongrel_rails cluster::restart, and the changes are reflected in production. However, suddenly this process has broken down.
For example, I have a class called Master located in /lib/master.rb. I added a new method to this class that simply runs puts "it works!", then restarted the mongrel cluster. Looking at the production logs, the server throws an error and thinks this method doesn't exist. When I go to the console using ruby script/console production, however, I can use this new method perfectly. I even tried deleting the file containing entire Master class. Once again, the production thought it was still there, but the production console correctly recognized it was missing.
Any ideas? How can the production environment detect a class that doesn't even exist anymore?
Funny, I spend 2 hours debugging this, then post to StackOverflow and figure it out in 20 minutes.
The problem is that I needed to also restart my background jobs as well. They were running the old version of the classes stored in /lib. It's interesting that this problem has never snagged me before.

Mysterious Mongrel Rails crash

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!

Resources