Categories
computer

Ubuntu 12.10 to 13.04 Server Upgrade Error

Are you Googl’ing around trying to figure out why you’re getting this error when trying to `do-release-upgrade’ your Ubuntu 12.10 system, even though you’re pretty much up to date?

root@mia:~# do-release-upgrade
Checking for a new Ubuntu release
Traceback (most recent call last):
File “/usr/bin/do-release-upgrade”, line 145, in <module>
fetcher.run_options += [“–mode=%s” % options.mode,
AttributeError: type object ‘DistUpgradeFetcherCore’ has no attribute ‘run_options’
Error in sys.excepthook:
Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/apport_python_hook.py”, line 137, in apport_excepthook
os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o640), ‘wb’) as f:
OSError: [Errno 2] No such file or directory: ‘/var/crash/_usr_bin_do-release-upgrade.0.crash’

Original exception was:
Traceback (most recent call last):
File “/usr/bin/do-release-upgrade”, line 145, in <module>
fetcher.run_options += [“–mode=%s” % options.mode,
AttributeError: type object ‘DistUpgradeFetcherCore’ has no attribute ‘run_options’
root@mia:~#
deb http://gb.archive.ubuntu.com/ubuntu/ quantal-updates main restricted
deb-src http://gb.archive.ubuntu.com/ubuntu/ quantal-updates main restricted

I just burned a couple hours trying to figure out why I only got this error on one specific server. It turns out that it’s a bug in the version of  the ubuntu-release-upgrader-core package, and you must be pulling updates from a “quantal-updates” repository to get the fixed package when you `apt-get upgrade’. To fix this, edit your /etc/apt/sources.list and make sure you have the following two lines:

deb http://gb.archive.ubuntu.com/ubuntu/ quantal-updates main restricted
deb-src http://gb.archive.ubuntu.com/ubuntu/ quantal-updates main restricted

After making sure you have these lines, get yourself updated again and re-try the release upgrade script:

apt-get update
apt-get upgrade
do-release-upgrade

…and you should be rollin’ towards Raring!

Categories
computer

LaTeX Broken On MacPort “texlive” Update

I spent about 4 hours today troubleshooting a stupid, stupid issue with the “texlive +full” package as provided by MacPorts, which is required to run certain GUI LaTeX editors such as TeXShop. Several days ago I ran an innocuous-looking…

preston$ sudo port sync
preston$ sudo port upgrade outdated

…and amongst many things that updated, texlive was one of them. Unfortunately, running tools such as the command-line “latex” command or GUIs such as TeXShop started giving me the following error:

This is pdfTeX, Version 3.1415926-1.40.11 (TeX Live 2010/MacPorts 2010_0)
restricted \write18 enabled.
—! /opt/local/var/db/texmf/web2c/pdftex/pdflatex.fmt doesn’t match pdftex.pool
(Fatal format file error; I’m stymied)

After much fruitless searching and hair pulling, I stumbled upon this ticket that notes the solution as:

preston$ sudo fmtutil-sys –all

After running this, LaTeX seems to work properly again. Sheesh.

(Note to product developers: I would personally pay at least $50 for a simple, clean, stand-alone OS X app that does LaTeX really well. TeXShop and TextMate both do a good job, but I’d really like a 5-star “just works” editor that doesn’t install a bunch of system-level stuff like MacTeX. Just sayin’. 🙂 )

Categories
Uncategorized

Rails 2.0: selenium-on-rails routes.rb fix

When I updated a few projects to Rails 2.0 last year, selenium-on-rails stopped working … some issue with routing and the lame way selenium-on-rails adds its routes. I didn’t spend the time to figure out exactly what the routing problem was, but did manage to hack a quick fix into routes.rb. This feels like the Wrong Way for an ultimate fix but it at least solves the immediate problem. Shove these rules into your routes.rb and the /selenium path should start resolving again…

Categories
computer

Rails 2.0: Testing For Well-Formed XML With assert_well_formed

Here’s an easy way to validate that you’re always rendering well-formed HTML in an ordinary Rails application. I’ve written and verified this on Rails 2.0.1…

Categories
computer

Rails attachment_fu/Kropper Scaling Fix: attachment_fu_skip_resize

I recently integrated Kropper into a custom RoR application for OpenRain affiliate img surf. A fundamental flaw in the upload-save-crop-save process used by Kropper is that attachment_fu automatically scales down the image on first save to :resize_to dimensions. After the subsequent crop–which may result in a significant drop in resolution–the image is scaled back up to :resize_to dimensions: an ugly lossy operation.

The attachment_fu_skip_resize plugin gives attachment_fu the ability to temporarily bypass resizing of the full-size original image, thus allowing your final cropped photos to be of the highest quality as possible.

  1. Install the plugin.
  2. In your attachment_fu image class, add..
    attr_accessor :skip_resize
  3. Any time you want to save an image without invoking resizing on the original image..
    image.skip_resize = true
    image.save

    Thumbnails will be generated at their defined resolutions regardless of the skip_resize flag.

Categories
computer

Fixing "wrong number of arguments" Error w/Rails 1.2.3 Upgrade

If you’ve just upgraded your Rails gem from 1.2.2 to 1.2.3 and are getting the following error on database hits..
wrong number of arguments (1 for 0)
/opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/active_record/vendor/mysql.rb:566:in `initialize’

..note that updating RAILS_GEM_VERSION in environment.rb appears to be required. Running a 1.2.2 application on 1.2.3 (even when 1.2.2 and all dependencies installed) will yield this error. Whatever.