About Archive Tags RSS Feed

 

Entries tagged rails

I dont mind not knowing what lies down the track

23 January 2007 21:50

I've got my first real rails application working correctly - a simple online bookmark system, which is scuttle-lookalike. (This is part of my master-plan to remove PHP utterly from the few remaining places where it exists upon my server(s), so it isn't as pointless a project as it appears to be!)

It is pretty neat, and it handles most of the things you'd expect.

Fetch it from CVS and install it with the following recipe:

cvs -d :pserver:anonymous@cvsrepository.org:/home/cvs login
cvs -d :pserver:anonymous@cvsrepository.org:/home/cvs co bookmarks
cd bookmarks/
mysql --user=root -p -e "CREATE DATABASE Books_development" 
rake db:migrate
ruby script/server

Once that is done point a browser at http://localhost:3000/ - and you should see something like this.

(If there is no admin user setup it will display a "signup" link, once there is an admin defined this will go away. When you're an admin you can view/edit/modify all the bookmarks which are set to "private".)

I'm new to rails, and ruby for that matter, so if this is packaged badly, or is missing something to make it work please do let me know.

Updated: Changed from download to the CVS repository. I also have a collection of tools for exporting from Insipid & Scuttle if they are useful let me know.

| No comments

 

When the light begins to change

30 January 2007 21:50

All being well I now have a blog working using Typo, instead of Wordpress 2 - and no broken links!

We'll see.

Now to make sure that my server load doesn't rise through the roof this time.

For future reference importing entries from Wordpress2 -> Typo will almost certainly give you this error:

1
2
3
4
5
const_missing': uninitialized constant TestRequest (NameError)
        from ./db/converters/../../config/../app/models/blog.rb
...
..
.

This can be fixed by changing:

1
2
3
4
5
def really_send_pings(serverurl = blog.server_url, articleurl = nil)
   return unless blog.send_outbound_pings
   ...
   ...
end

To this:

1
2
3
def really_send_pings(serverurl = blog.server_url, articleurl = nil) 
   return
end

| No comments

 

I have finally found my place in everything

20 May 2007 21:50

Sorry to everybody on Planet Debian who have been forced to see a lot of older posts of mine.

I switched from Typo to Mephisto - another Ruby on Rails blog.

The reason? Typo seems to suck memory like a .. big sucky thing.

Posting a new comment would take the system-load on my VM up to 2, which is not acceptible. I'm prepared to suffer a little with my decision to never install, host, or admin a PHP-based application, but not that much.

Mephisto seems nice, although the importing of old posts was a little fraught with peril. Thankfully the system, when used with Mongrel and an Apache proxy seems fast, stable and not too memory intensive.

The only thing that didn't happen properly was the closing of comments on all the older entries. Comments on new entries appeared to be correct in the sense that they should be automatically disabled after 7 days.

Here's how I fixed that:

skx@skx:~$ script/console production
1
2
3
Article.find(:all).each do |a|
 a.update_attribute :comment_age, -1
end

| No comments