Upgraded to Typo 4.0.3

Posted by Scott Hughes Sat, 09 Sep 2006 23:56:00 GMT

Finally got around to upgrading this blog to the 4.0 series of Typo. I did have a couple of problems with it, but nothing major. I started by trying to use the new Typo gem, doing a local install into my own gem folder. This failed because one of the dependencies for Typo requires Ruby 1.8.4, but I only have 1.8.2 available to me on Dreamhost. I almost went down the path of building my own ruby binary (I’d done this before when Dreamhost was slow to catch up) but decided I’d try installing Typo the old fashioned way:

svn co http://typosphere.org/trunk typo

I copied my old database.yml file into the config folder. Then I edited config/environment.rb to force rails into production mode. When I ran ‘rake migrate’ I got an error:

== FixCanonicalServerUrl: migrating ==============
rake aborted!
You have a nil object when you didn't expect it!
The error occured while evaluating nil.gsub

A quick google search showed other people with the same problem, but no solution. I made a quick patch to db/migrate/051fixcanonicalserverurl.rb that let me get past the problem. After the variable ‘b’ is initialized, I added:

b.settings['canonical_server_url'] ||= 'http://blog.globalreset.org'

I really like the changes they made to the admin interface. It’s much easier to handle deleting spam comments now. I have yet to see how the Akismet interaction works though. I did have a problem with comment deletion that I haven’t solved. If I create a new comment which is unclassified (neither ‘ham’ nor ‘spam’, whatever that means), I can’t delete it. I see an error in the production log that you can’t delete a ‘frozen hash’. I also had to modify the way my theme invokes the sidebar. They simplified it down to just ‘render_sidebars’ instead of the complicated invocation of a particular action on the sidebar controller. I’d expect fancier themes than mine to have a few more problems. But, I think the management interface upgrades are enough reason to go through the effort.

Posted in  | Tags , ,  | 1 comment

Updated Typo to Latest Edge

Posted by Scott Hughes Tue, 08 Nov 2005 14:34:00 GMT

Last night, I updated this Typo install to the latest svn trunk (rev 725). I had been running at rev 586 for a while now, but I was hesitant to upgrade as I noticed there were a few database changes. Turns out that, thanks to Rails Migrations, the database changes were simple (for me anyways, maybe not for the author of the migrations). While I was at it, I went ahead and updated Typo to run the latest Edge Rails also. Here’s the procedure I used on Dreamhost to install these:

# Get Latest Typo
$ svn co svn://leetsoft.com/typo/trunk typo-edge
# Get Latest Rails
$ cd typo-edge/vendor
$ svn co http://dev.rubyonrails.org/svn/rails/trunk rails
$ cd ..
$ rake update_javascripts
$ rake add_new_scripts
# Copy My Typo Configuration
$ cp ../{old-typo}/config/database.yml config/database.yml
$ cp -r ../{old-typo}/themes/globalreset themes/globalreset
$ vi config/environment.rb #forced RAILS_ENV='production'
# Update link I use to point to a version of Typo
# My setup expects web root at this link/public
$ rm typo
$ ln -s typo-edge typo

Then I opened my browser and navigated to /admin and was immediately prompted with a list of necessary Database Migrations, which must be performed on my existing database to be compatible with this version of Typo. I clicked affirmatively, and after a few seconds I was running the latest and greatest Rails and Typo.

Make sure you backup your database before attempting this. The web-based phpMyAdmin that Dreamhost provides is suitable for this. I’ve seen a couple of users report on the Typo-ML that they had some migration issues. I don’t know if those issues ended up in a wedged database or not, but better safe than sorry.

Posted in  | Tags , , ,  | 4 comments

Typo @rev 586

Posted by Scott Hughes Tue, 30 Aug 2005 03:29:00 GMT

I updated Typo to the latest svn (rev 586) yesterday and got a sample of the new Filters API. Looks very slick. For example, here’s a filter which formats Ruby code with syntax highlighting:

class Foo
  def bar
    "abcde"
  end
end

The syntax for declaring that looks like this:

<typo:code lang="ruby">
class Foo
  def bar
    "abcde"
  end
end
<typo:code>

Whistler Ski Trip

Pics from our whistler ski trip, Dec 2002/Jan 2003.

And it’s very easy to drop in a reference to a flickr image:

<typo:flickr 
   style="border: 1px 
            solid #8ab3d1;
       padding: 5px;
       margin: 5px;
       float: right;"
   img="31367273" 
   size="small" />

Is translated into the picture at the right. I’m quite impressed with that one.

Lastly, there is a filter for Sparklines, which allows you generate a chart (pie, area, discreet, etc) from dynamic data. e.g.:

<typo:sparkline
   type="pie"
   data="33.3 66.6" />

That bit of code renders the following graphic:

Posted in  | Tags , ,  | no comments

More on Typo

Posted by Scott Hughes Sun, 28 Aug 2005 23:06:43 GMT

I’m having some problems with Typo. For a while, I was getting a completely unresponsive blog, requiring a “killall -9 dispatch.fcgi && rake sweep_cache” to bring it back to life. I had assumed that when Dreamhost said that it was taking the Rails environment to Production, that meant that our virtual host entries would declare: RAILS_ENV = production. I found at least one person who also thought as much. Apparently, they are still defaulting to development mode, so I edited config/environment.rb and changed the RAILS_ENV line to read thusly:

RAILS_ENV  = 'production'

Once I did, I noticed that the blog hasn’t become completely non-responsive since and it seems to be responding a lot faster. I still have some bugs to work out though, as I’m seeing way too many “dispatch.fcgi” processes start up. I wrote an email to the mailing list and hopefully I’ll get some more help on that.

There are a couple of .htaccess tidbits that you may be interested in as well. If you, like me, migrated from Wordpress, here are the entries I used to forward my old Wordpress articles to the new Typo pages:

Redirect /blog/archives http://blog.globalreset.org/articles
Redirect /blog http://blog.globalreset.org

And here is my .htaccess entry I inserted into the public/.htaccess file in my Typo install dir so that I could still access my /stats subfolder (otherwise, Typo tries to interpret the url instead of letting it open my web stats page generated by Dreamhost):

#allow /stats
RewriteCond %{REQUEST_URI} ^/stats/(.*)$ [OR]
RewriteCond %{REQUEST_URI} ^/failed_auth.html$
RewriteRule ^.*$ - [L]

Also, if you’re reading this with an RSS reader, you’re missing out on the new layout of my site. Come to the home page and let me know what you think of my banner.

Technorati Tags: ,

Posted in  | Tags , ,  | 2 comments

Typo

Posted by Scott Hughes Sat, 20 Aug 2005 23:44:00 GMT

Always one to chase after the shiny new technology, I’ve moved my blog over to Typo from Wordpress. Typo is a recent blogging engine developed using the latest buzzworthy web framework Ruby on Rails. I’ve been meaning to experiment with Ruby on Rails for a while now, and I guess Typo is a good start. One of the first differences you’ll notice is that Typo is AJAX-ified with a handy “Live Search” dialog over there on the right-hand side. This provides a pretty nifty instant search interface, with a transparent round-trip to the server. So you get something that looks somewhat like a local application, much like most of GMail’s functionality. Getting Typo running on Dreamhost wasn’t nearly as straightforward as Wordpress. Here’s the steps I followed:

  1. Used Subversion to do a checkout on my local Mac of the latest Typo source (svn co svn://leetsoft.com/typo/trunk trunk).
  2. Used the Dreamhost Web Panel to add the IP address of my local Mac to the allowed IP addresses that can access my mysql database.
  3. Used CocoaMySQL to make a dump of my existing database (in case I screwed anything up) using the Export->”CocoaMySQL Dump” menu option.
  4. Used CocoaMySQL to import the schema required for Typo (I imported it into the same database as my Wordpress install) using the Import->”CocoaMySQL Dump” menu option and selecting the db/schemas.mysql.sql file.
  5. I used Cyberduck to ftp the Typo files into mywebsite/typo folder.
  6. Made some necessary files executable (chmod +x script/* public/*).
  7. Browsed to http://mywebsite/typo/public to configure the installation.
  8. Ran db/converters/wordpress.rb to import my Wordpress database into Typo.
  9. Made a backup of the Wordress blog php files (moved /blog to /blog2).
  10. Used the Dreamhost Web Panel to make a new subdomain (blog.globalreset.org).
  11. Moved the Typo installation into the subfolder for blog.globalreset.org.
  12. Remapped the domain to point to blog.globalreset.org/typo/public as the root folder for the website.

I fought for a while with getting Typo to work under my /blog subfolder of my domain, but it didn’t like it. I followed on the directions on the Rails wiki and in the Dreamhost forum, but couldn’t get it to grok the urls. I gave up and just went with a new subdomain, which Rails apps seem to like.

Also, I couldn’t find any themes I liked for Typo yet, so I started mucking with the default one. I’m not terribly happy with what I’ve ended up with here, but it’ll do for now.

Technorati Tags: ,

Posted in ,  | Tags , , ,  | no comments