Debugging "INTERNAL ERROR!!! wrong argument type StringIO (expected File)"
If you're getting this strange error message when setting debugging breakpoints, probably HAML is the culprit.
Cause
As far as I could find out, the error is the result of setting a breakpoint (debugger
) in a helper method that's called from a haml partial.
Suggestions
Try putting the breakpoint into the HAML view.
Related cards:
Fix error UDPSocket.open: wrong number of arguments (0 for 1)
I got the following error after updating the selenium-webdriver
gem:
wrong number of arguments (0 for 1) (ArgumentError)
/home/pointoo-dev/.rvm/gems/ruby-1.8.7-p374/gems/selenium-webdriver-2.35.1/lib/selenium/webdriver/common/platform.r...
Rails 2.3.x sometimes renders localized views with the wrong content type
Under certain (unknown) circumstances, Rails will give localized files an invalid content-type in the Response header. For me, after requesting corporate_information
and rendering corporate_information.de.html.haml
, Rails sent a content-type o...
Deal with error: Expected foo_trait.rb to define FooTrait
Lately, I came across a nasty error. I had a class Article
that included FooTrait
and BarTrait
. In BarTrait, I then accidentally called a non-existent method:
has_defaults :dummy => Dummy.non_existent_method
From that moment, no pa...
Error: "sylogd: /var/log/authlog : no such file or directory" but the file exists
If you get a message like this:
Jan 21 13:42:38 foobar syslogd: /var/log/authlog : no such file or directory
But you are sure the file exists and it have the correct permissions:
# example for Solaris 9
-rw-r--r-- 1 root sys 8,0...
Bundler returns different error codes depending on what went wrong
When you are calling Bundler from your shell scripts, you might find it useful that a failed bundle
call returns a different error code depending on the type of problem.
A list of error codes can be found [here](https://github.com/bundler/bundl...
Dealing with I18n::InvalidPluralizationData errors
When localizing model attributes via I18n you may run into errors like this:
I18n::InvalidPluralizationData: translation data { ... } can not be used with :count => 1. key 'one' is missing.
They seem to appear out of the blue and the ...
vague puppet error messages with broken yaml files
If you get one of this errors:
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: (<unknown>): found character that cannot start any token while scanning for the next token at line 1297 column 3
Warning: Not using ...
List of handy Ruby scripts to transcode different file types (often by using GPT)
It's 2024 and we have tools like ffmpeg, imagemagick and GPT readily available. With them, it's easy to convert texts, images, audio and video clips into each other.
For the everyday use without any parameter tweaking I'm using a collection of ti...
How to fix: "500 Internal Server Error" after adding Rack::Bug
When Rack::Bug
has been added to your project and your Apache2/Passenger only replies with an Error 500 (Internal Server Error
) you won't get any love from both application and Apache logs.
You can start a script/server
and try connecting t...
Make "rake notes" learn about Haml, Sass, CoffeeScript, and other file types
Rails comes with a Rake task notes
that shows code comments that start with "TODO", "FIXME", or "OPTIMIZE".
While it's generally not good practice to leave them in your cod...