Missing ‘a’ character on Windows with rspec and cucumber

Trying to get a windows rails environment going this morning I stumbled upon something interesting – all ‘a’ characters were missing from cucumber and rspec output.
This has something to do with UTF-8 encoding and there’s a ticket and wiki post on cucumber about it, but no solution that I found acceptable.
Everything comes down to having change encoding in the current cmd window. This is achieved via a simple call to chcp 1252, but nobody want’s to do this every time, right?
To get this executed automaticaly and without resorting to serious registry editing, simply add this line to your cucmber.bat and any other batch files that are exhibiting this problem. You can find cucumber.bat in your /ruby/bin folder.
Here’s what it looks like:
chcp 1252 @ECHO OFF IF NOT "%~f0" == "~f0" GOTO :WinNT @"ruby.exe" "c:/ruby/bin/cucumber" %1 %2 %3 %4 %5 %6 %7 %8 %9 GOTO :EOF :WinNT @"ruby.exe" "%~dpn0" %*
Quick 3rdRail overview in screenshots
Here’s a quick 3rdRail overview in screenshots (flickr required).
CodeGear releases 3rdRail, a Ruby and Rails IDE
CodeGear released 3rdRail this morning. A few highlights:
- Full Rails project support.
- Rails specific refactoring, ie renaming a method in a controller will update all references as well as link_to and rename the associated view file.
- Console with command completion.
- Integrated Gecko browser with request monitor, DOM source, CSS and JavaScript
You can watch a screen cast here and download a trial for Windows, Unix and OSX here.
Here’s a quick 3rdRail overview in screenshots (flickr required).
dev_mode_performance_fixes
dev_mode_performance_fixes plugin by Josh Goebel promises to speed up your Rails development server.
THE PROBLEM
So, what is the problem? It’s the fact that classes aren’t cached in development and that Rails insists on flushing them at the end of every request resulting in large chunks of your apps code having to be loaded, parsed, and reinterpreted for EVERY SINGLE request… which is SLOW.
THE IDEA
Why don’t we only reload the files when they have actually changed? Store the file names and their last modified time and then stat all the files before every request… if any are newer, kill the objects they originally defined and let the Dependency auto-loading code reload the objects from disk.
ruby script/plugin install http://svn.techno-weenie.net/projects/plugins/dev_mode_performance_fixes/
Hello Facebook in Rails
I’ve signed up for Facebook today to check out how the whole application development works. Setting up a development server at home which is accessible from Facebook is pretty straight forward.
Here’s what you need:
- Facebook account
- Local box with Apache
- Domain name pointing to your home IP. I use No-Ip.
Here are the steps I took.
- Setting up development application on Facebook. Follow the guide, it’s pretty straight forward.
- Set up No-Ip to point
*.dev.mydomain.comto my local box. This allows me to create as many Rails applications as I need to. - Configured Apache to forward all calls to
fbtest.dev.mydomain.comtolocalhost:3000using mod_proxy like so:<VirtualHost *:80> ServerName fbtest.dev.mydomain.com ProxyPass / http://127.0.0.1:3000/ </VirtualHost>
gem install rfacebookcd /anywhere/fbtestrails .ruby script/plugin install svn://rubyforge.org/var/svn/rfacebook/plugins/rfacebook_on_railsrake facebook:setup- Go to http://www.facebook.com/developers/apps.php
- Copy and paste API key and secret to
config/facebook.yml. Setcanvas_pathto the local path on Facebook, ie/myfacebookapp/andcallback_pathto local path on your server, ie/facebook/. ruby script/generate controller facebook index- Edit index method in Facebook controller, like so:
class FacebookController < ApplicationController def index @result = fbsession.friends_get.uid_list end end - Edit index.rhtml like so:
<% @result.each do |uid| %> <fb:name uid="<%= uid %>" /> <% end %>
- Start Apache
ruby script/server- Now you should be able to hit your Facebook application page at
http://apps.facebook.com/myfacebookapp
You should see a list of your friends. Took me about 30 minutes to figure all this out.
