TextMate Blogging Bundle workaround

I like to use the blogging bundle from the great text editor TextMate to do my posting here. The other day I encountered an error that gave me some problems, and I just want to point out a workaround. After posting to this blog, I received and error that went something like this…

Received exception:Wrong size. Was 1275, should be <unknown>

The fix is to comment out a few lines in /usr/lib/ruby/1.8/xmlrpc/client.rb. The following lines are those you want to disable, they appear at line 547:


    expected = resp["Content-Length"] || "<unknown>"
    if data.nil? or data.size == 0
      raise "Wrong size. Was #{data.size}, should be #{expected}"
    elsif expected.to_i != data.size and resp["Transfer-Encoding"].nil?
      raise "Wrong size. Was #{data.size}, should be #{expected}"
    end

For those who are unfamiliar with how to do this, you can open Terminal.app and type…


    sudo vi /usr/lib/ruby/1.8/xmlrpc/client.rb

You will then be prompted for your password. You need to elevate your privileges because this file requires you to have administrator access to edit it.

Once in vi, you can use the command 547G to skip to line 547. You then need to put a “#” in front of the lines indicated above so it looks like this:


    #expected = resp["Content-Length"] || "<unknown>"
    #if data.nil? or data.size == 0
    #  raise "Wrong size. Was #{data.size}, should be #{expected}"
    #elsif expected.to_i != data.size and resp["Transfer-Encoding"].nil?
    #  raise "Wrong size. Was #{data.size}, should be #{expected}"
    #end

This will turn the code into a comment so that the error is no longer generated. When you are finished type :wq and hit enter to save the file and quit vi.

You can find more detail on this from the MacroMates site at http://macromates.com/wiki/Blogging/WordPress

Advertisements

2 Responses to TextMate Blogging Bundle workaround

  1. mwest67 says:

    I got this issue, but now I get a date format error when trying to fetch & publish posts. The posts publish fine but I still receive the error. Any Suggestions?

  2. scrutin says:

    I am having a similar issue. I am also having problems with setting allow comments and allow pings from the textmate blogging bundle.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: