<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">
  <title>BridgeUtopia</title>
  <id>http://blog.bridgeutopiaweb.com/</id>
  <updated>2012-02-02T18:54:08-08:00</updated>
  <author>
    <name />
  </author>
  <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/Bridgeutopia" /><feedburner:info uri="bridgeutopia" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry>
    <title>For Freelancers</title>
    <link href="http://feedproxy.google.com/~r/Bridgeutopia/~3/tJfRNsio9fg/" rel="alternate" />
    <id>http://blog.bridgeutopiaweb.com/post/for-freelancers/</id>
    <published>2012-02-02T18:54:08-08:00</published>
    <updated>2012-02-02T18:54:08-08:00</updated>
    <author>
      <name />
    </author>
    <summary type="html">&lt;p&gt;This is a response to an email I received yesterday. I am trying to reduce the number of times I say things by just blogging about them.&lt;/p&gt;

&lt;p&gt;This is my straightforward response to someone with a Master in Computer Science from India regarding his query about career prospects in Ruby on Rails and how to start as a freelancer.&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;This is a response to an email I received yesterday. I am trying to reduce the number of times I say things by just blogging about them.&lt;/p&gt;

&lt;p&gt;This is my straightforward response to someone with a Master in Computer Science from India regarding his query about career prospects in Ruby on Rails and how to start as a freelancer.&lt;/p&gt;

&lt;p&gt;In the past, I've seen good opportunities and let those slip away because of several reasons. I did nothing about them. I didn't have the time. I still don't have the time. And all opportunities are worth considering these days so I started working on &lt;a href="http://www.bench5.com" target="_blank"&gt;www.bench5.com&lt;/a&gt; December last year so I could share these opportunities.&lt;/p&gt;

&lt;p&gt;It's a work-in-progress and I have yet to continue working on it this weekend. You can join.&lt;/p&gt;

&lt;p&gt;Before you actually go out seeking freelance work, &lt;a href="http://www.katherinepe.com/2011/05/ladyprogrammer-interview.html" target="_blank"&gt;ask yourself first if you are fit to be a freelancer&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I know some people who are actually seeking Ruby on Rails contractors but both of them no longer seek contractors from India for some reason. I think it's unnecessary discrimination. Whatever traumatic experience they have gone through, I do not think that the contractors are the sole reason for failure.&lt;/p&gt;

&lt;p&gt;I have some few practical notes to share. Most of them are simple and obvious but repetition helps us remember:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Don't be confined to using Ruby on Rails&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I use the framework only because it is most sensible to me but I am also learning other frameworks and other languages. At the moment, it is very stable and you can use it for your projects. Many companies everywhere are hiring Ruby on Rails developers and finding work isn't a problem as long as you're not too picky. Developing your skills and being devoted to self-improvement is key.&lt;/p&gt;

&lt;p&gt;This is important: &lt;strong&gt; don't use Ruby on Rails if you can't do optimization work and can't afford a good web host&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Whatever you do affects your country&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;No matter what you do or what they say, be fair to yourself and to your client. Get things done but set limitations.&lt;/p&gt;

&lt;p&gt;Know the scope of work and make sure you don't work for clueless clients who are still figuring out what they want to do and how they will monetize. I can work with these kind of people but as a freelance developer without equity in the company, I am only limited to the "getting things done well" part. You have to know those "things" first beforehand.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Someone made a comment on this and I agree you have to help your clients figure out some features sometimes but I disagree with the idea that as a consultant who's focused on development work you have to figure out how a client will monetize and grow their business especially if they can't meet your expectations.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Admit and fix your mistakes. Don't run away like a fool. That way you won't bring your country down. You can run away if they are not paying you right however. And this might be funny but just be aware that there are a lot of people with personality disorders and psychological problems. If you don't like dealing with those, leave.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Don't work fixed price if the client doesn't say everything you should know and it's quite rare that they do&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;An estimate is based on fixed set of features that are well-defined. If a client hasn't given any well-defined set of tasks then there is no way you could have made an estimate or agreed to an estimate. Have a contract. Set expectations.&lt;/p&gt;

&lt;p&gt;Here's an example of a bad client:
"Can you clone stamped? We need it done in 3 months."&lt;/p&gt;

&lt;p&gt;Ripping off is bad. Read between the lines. Three months for an existing project which was probably done for years by a team of people.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Work with a team&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Don't work alone. If possible, choose to work with the best. Code review and pair programming is good and helps you improve.&lt;/p&gt;

&lt;p&gt;But if you should and you can work alone, increase your hourly rate.&lt;/p&gt;

&lt;p&gt;This website might be interesting to you:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://grouptalent.com/" target="_blank"&gt;Group Talent&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Don't multi-task&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Multitasking is a sin in the long run. Claiming to be all things is a big lie. Even if you have done it before and your confidence level is very high, your mind is only truly limited to doing one thing well at a time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Have a break&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;People could misconstrue this and dismiss this is an advice of a lazy person. But by having a break, I mean taking time to consider "programming for fun, charity and profit." Working for people often suck the life out of you no matter how small or large the company is. No drama. Just do what you should then do what you want.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/Bridgeutopia/~4/tJfRNsio9fg" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://blog.bridgeutopiaweb.com/post/for-freelancers/</feedburner:origLink></entry>
  <entry>
    <title>Testing a REST Web Service with Cucumber</title>
    <link href="http://feedproxy.google.com/~r/Bridgeutopia/~3/fXMcOjrLDBw/" rel="alternate" />
    <id>http://blog.bridgeutopiaweb.com/post/testing-a-rest-web-service-with-cucumber/</id>
    <published>2011-12-01T06:23:59-08:00</published>
    <updated>2011-12-01T06:23:59-08:00</updated>
    <author>
      <name />
    </author>
    <summary type="html">&lt;p&gt;The Cucumber book has been helpful in a way that I saw more options for testing a web service. It's my first time to use HTTParty. In the past, I always used RESTClient gem for this kind of task.&lt;/p&gt;

&lt;p&gt;Just think the example is overkill. Maybe we just want to know whether the JSON response includes the data we expect.&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;The Cucumber book has been helpful in a way that I saw more options for testing a web service. It's my first time to use HTTParty. In the past, I always used RESTClient gem for this kind of task.&lt;/p&gt;

&lt;p&gt;Just think the example is overkill. Maybe we just want to know whether the JSON response includes the data we expect.&lt;/p&gt;

&lt;p&gt;So this helps:&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;
features/step_definitions/rest_steps.rb

require 'httparty'

When /^the client requests GET (.*)$/ do |path|
  @last_response = HTTParty.get('http://somewebsiteidontknow.com' + path)
end


Then /^the JSON response should include "([^\"]*)"$/ do |response|
  JSON.parse(@last_response.body).to_s.should match response
end

Then /^the JSON response should not include "([^\"]*)"$/ do |response|
  JSON.parse(@last_response.body).to_s.should_not match response
end
&lt;/pre&gt;




&lt;pre class="brush: ruby"&gt;
@people-api

Scenario: GET People
  When the client requests GET /api/v1/people.json
  Then the JSON response should include "A Name"
  And the JSON response should not include "A Mouse"
&lt;/pre&gt;


&lt;p&gt;Probably a bad way of testing is just testing whether the response is not nil.&lt;/p&gt;

&lt;p&gt;A better example:&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;

When /^ I GET Github (.*)$/ do |path|
  @last_response = HTTParty.get('http://github.com/api/v2/json' + path)
end

&lt;/pre&gt;


&lt;p&gt;&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;
Scenario: SEARCH Github user
  When I GET Github /user/search/bridgeutopia
  Then the JSON response should include "bridgeutopia"
  And the JSON response should not include "something"

&lt;/pre&gt;

&lt;img src="http://feeds.feedburner.com/~r/Bridgeutopia/~4/fXMcOjrLDBw" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://blog.bridgeutopiaweb.com/post/testing-a-rest-web-service-with-cucumber/</feedburner:origLink></entry>
  <entry>
    <title>Learn HTML5 before you learn Rails </title>
    <link href="http://feedproxy.google.com/~r/Bridgeutopia/~3/OW1ru6N2Pqo/" rel="alternate" />
    <id>http://blog.bridgeutopiaweb.com/post/learn-html5-before-you-learn-rails/</id>
    <published>2011-11-21T05:48:11-08:00</published>
    <updated>2011-11-21T05:48:11-08:00</updated>
    <author>
      <name />
    </author>
    <summary type="html">&lt;p&gt;"You cannot be a Ruby on Rails developer if you don't know HTML and CSS." I realized that 30 minutes before I was supposed to teach someone Ruby on Rails yesterday. Even if she is a computer science graduate, if her knowledge of HTML and CSS is not good enough then it becomes an exercise in futility to teach Ruby on Rails or even Unix. So on my way, I tried to recall links to resources for HTML5 and CSS3. &lt;a href="http://www.jsfiddle.net" target="_blank"&gt;Jsfiddle&lt;/a&gt; helped me out to teach basics of HTML5, CSS and jQuery! Yes, I taught DOM manipulation and how to "google fu."  Those were not necessary but I wanted her to understand classes, ID's and how jQuery works. Within one hour and 30 minutes, I also explained the importance of using CSS frameworks and grid design. Most designers are fixated with the idea of designing without a framework/ grid in mind and it is bad for us all.&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;"You cannot be a Ruby on Rails developer if you don't know HTML and CSS." I realized that 30 minutes before I was supposed to teach someone Ruby on Rails yesterday. Even if she is a computer science graduate, if her knowledge of HTML and CSS is not good enough then it becomes an exercise in futility to teach Ruby on Rails or even Unix. So on my way, I tried to recall links to resources for HTML5 and CSS3. &lt;a href="http://www.jsfiddle.net" target="_blank"&gt;Jsfiddle&lt;/a&gt; helped me out to teach basics of HTML5, CSS and jQuery! Yes, I taught DOM manipulation and how to "google fu."  Those were not necessary but I wanted her to understand classes, ID's and how jQuery works. Within one hour and 30 minutes, I also explained the importance of using CSS frameworks and grid design. Most designers are fixated with the idea of designing without a framework/ grid in mind and it is bad for us all.&lt;/p&gt;

&lt;p&gt;I am not a teacher or even a speaker. I hardly have any free time and best I can do is blog about these things for someone. There are several opportunities I know of which may be interesting for someone. If there are any freelance front-end developers who are reading this, let me know if you need work. Thanks.&lt;/p&gt;

&lt;p&gt;For beginners:&lt;/p&gt;

&lt;p&gt;Learn HTML, CSS and Javascript by trying it yourself using &lt;a href="http://www.jsfiddle.net" target="_blank"&gt;Jsfiddle&lt;/a&gt; or &lt;a href="http://www.w3schools.com/ target="_blank"&gt;w3schools&lt;/a&gt;. Essential for beginners is knowing what tools and browsers you'd use. For web browsers, you obviously need all major browsers installed including Firefox and that &lt;a href="http://getfirebug.com/" target="_blank"&gt;Firebug&lt;/a&gt; plugin.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://diveintohtml5.info/table-of-contents.html" target="_blank"&gt; Dive into HTML5&lt;/a&gt; and &lt;a href="http://html5rocks.com"&gt;HTML5 rocks&lt;/a&gt; are good free resources for learning HTML5.&lt;/p&gt;

&lt;p&gt;Question: Why HTML5? Progressive thinking.&lt;/p&gt;

&lt;p&gt;Forget about IE6. Or even clients who like IE too much.&lt;/p&gt;

&lt;p&gt;CSS frameworks are essential in my opinion. There's nothing more annoying than fixing issues as trivial as an "inconsistent gap between logo and navigation on different browsers."  We've got better things to do.&lt;/p&gt;

&lt;p&gt;In addition to  the &lt;a href="http://speckyboy.com/2011/11/17/15-responsive-css-frameworks-worth-considering/" target="_blank"&gt;15 responsive CSS frameworks worth considering&lt;/a&gt;, you might want to try &lt;a href="http://twitter.github.com/bootstrap/" target="_blank"&gt;Twitter Bootstrap&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For designers who are familiar with PHP, I am preparing a presentation for discussion tomorrow with a frontend developer. It may be useful for understanding Rails frontend development.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/Bridgeutopia/~4/OW1ru6N2Pqo" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://blog.bridgeutopiaweb.com/post/learn-html5-before-you-learn-rails/</feedburner:origLink></entry>
  <entry>
    <title>How to test devise features with Cucumber </title>
    <link href="http://feedproxy.google.com/~r/Bridgeutopia/~3/7DfDysnQySU/" rel="alternate" />
    <id>http://blog.bridgeutopiaweb.com/post/how-to-test-devise-features-with-cucumber/</id>
    <published>2011-11-10T08:11:40-08:00</published>
    <updated>2011-11-10T08:11:40-08:00</updated>
    <author>
      <name />
    </author>
    <summary type="html">&lt;p&gt;Updated the Devise wiki page on &lt;a href="https://github.com/plataformatec/devise/wiki/How-To:-Test-with-Cucumber" target="_blank"&gt;"How To: Test with Cucumber"&lt;/a&gt; on github. Following the guide should work.&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;Updated the Devise wiki page on &lt;a href="https://github.com/plataformatec/devise/wiki/How-To:-Test-with-Cucumber" target="_blank"&gt;"How To: Test with Cucumber"&lt;/a&gt; on github. Following the guide should work.&lt;/p&gt;

&lt;p&gt;I recently got this warning:&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;
WARNING: i18n methods within step definitions are deprecated. Use #step instead
&lt;/pre&gt;


&lt;p&gt;Was wondering what was wrong only to find out I had to rewrite code for testing some devise features.&lt;/p&gt;

&lt;p&gt;Here's what I had before:&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;

Given /^I have one user "([^"]*)" "([^"]*)" with password "([^"]*)" and my first name is "([^"]*)" and last name is "([^"]*)"$/ do |username, email, password,  first_name, last_name|
  member_role = Factory(:member_role)  
  @user = Factory(:user, :username=&gt;username, :first_name=&gt;first_name, :last_name=&gt; last_name, :email =&gt; email, :password =&gt; password, :password_confirmation =&gt; password)
  @user.roles &lt;&lt;  member_role
  @user.confirm! 
end

Given /^I am an admin and have one user "([^"]*)" "([^"]*)" with password "([^"]*)" and my first name is "([^"]*)" and last name is "([^"]*)"$/ do |username, email, password,  first_name, last_name|
  admin_role = Factory(:admin_role)
  @admin = Factory(:user, :username=&gt;username, :first_name=&gt;first_name, :last_name=&gt; last_name, :email =&gt; email, :password =&gt; password, :password_confirmation =&gt; password)
  @admin = User.where(:email=&gt;email).first
  @admin.roles &lt;&lt;  admin_role
  @admin.confirm!
end


When /^the following (.+) records exist?$/ do |factory, table|
  table.hashes.each do |hash|
    Factory(factory, hash)
  end
end


Given /^I am a registered user$/ do
  email = "testing@testemail.net"
  password = "secretpass"
  first_name = "Katherine"
  last_name = "Pe"
  username = 'bridgeutopia'

  Given %{I have one user "#{username}" "#{email}" with password "#{password}" and my first name is "#{first_name}" and last name is "#{last_name}"}
  And %{I go to the login page}
  And %{I fill in "user_email" with "#{email}"}
  And %{I fill in "user_password" with "#{password}"}
  And %{I press "Submit"}


end

Given /^I am an admin user$/ do
  email = "admin@testemail.net"
  password = "secretpass"
  first_name = "Katherine"
  last_name = "Pe"
  username = "katherine_pe"

  Given %{I am an admin and have one user "#{username}" "#{email}" with password "#{password}" and my first name is "#{first_name}" and last name is "#{last_name}"}
  And %{I go to the login page}
  And %{I fill in "user_email" with "#{email}"}
  And %{I fill in "user_password" with "#{password}"}
  And %{I press "Submit"}
end
&lt;/pre&gt;


&lt;p&gt;So apparently that has to change to something like this:&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;
Given /^I am a registered user$/ do
  email = "testing@testemail.net"
  password = "secretpass"
  first_name = "Katherine"
  last_name = "Pe"
  username = 'bridgeutopia'

  member_role = Factory(:member_role)  
  @user = Factory(:user, :username=&gt;username, :first_name=&gt;first_name, :last_name=&gt; last_name, :email =&gt; email, :password =&gt; password, :password_confirmation =&gt; password)
  @user.roles &lt;&lt;  member_role
  @user.confirm!

  visit '/login'
  fill_in "user_email", :with=&gt;email
  fill_in "user_password", :with=&gt;password
  click_button "Submit"
  
end

Given /^I am an admin user$/ do
  email = "admin@testemail.net"
  password = "secretpass"
  first_name = "Katherine"
  last_name = "Pe"
  username = "katherine_pe"

  admin_role = Factory(:admin_role)
  @admin = Factory(:user, :username=&gt;username, :first_name=&gt;first_name, :last_name=&gt; last_name, :email =&gt; email, :password =&gt; password, :password_confirmation =&gt; password)
  @admin = User.where(:email=&gt;email).first
  @admin.roles &lt;&lt;  admin_role
  @admin.confirm!
  
    
  visit '/login'
  fill_in "user_email", :with=&gt;email
  fill_in "user_password", :with=&gt;password
  click_button "Submit"
    
end

&lt;/pre&gt;


&lt;p&gt;And that's a lot cleaner.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/Bridgeutopia/~4/7DfDysnQySU" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://blog.bridgeutopiaweb.com/post/how-to-test-devise-features-with-cucumber/</feedburner:origLink></entry>
  <entry>
    <title>Install Rails 3.1 on Windows, Mac and Linux</title>
    <link href="http://feedproxy.google.com/~r/Bridgeutopia/~3/4d3LK3yCw_s/" rel="alternate" />
    <id>http://blog.bridgeutopiaweb.com/post/install-rails-3-dot-1-on-windows-mac-and-linux/</id>
    <published>2011-10-03T01:03:45-07:00</published>
    <updated>2011-10-03T01:03:45-07:00</updated>
    <author>
      <name />
    </author>
    <summary type="html">&lt;p&gt;This is yet another guide.So much have been written. Probably replicates other guides which I have not checked. But this is updated for Rails 3.1.1.&lt;/p&gt;

&lt;p&gt;This guide will constantly be updated as needed.&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;This is yet another guide.So much have been written. Probably replicates other guides which I have not checked. But this is updated for Rails 3.1.1.&lt;/p&gt;

&lt;p&gt;This guide will constantly be updated as needed.&lt;/p&gt;

&lt;h2&gt;Install Rails 3.1 on Windows&lt;/h2&gt;


&lt;p&gt;Download and install &lt;a href="http://rubyinstaller.org/downloads/" target="_blank"&gt;Rubyinstaller&lt;/a&gt;. Suggested version is Ruby 1.9.2. Ruby 1.8.7 will no longer supported soon.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.bryanbibat.net/"&gt;Bryan Bibat&lt;/a&gt;  came up with Rails FTW which is lighter than RubyInstaller. In fact, he also wrote a book for beginners which you can download via &lt;a href="https://github.com/bryanbibat/rails-3_0-tutorial" target="_blank"&gt;github&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The current version is now Rails 3.1 so doing "gem install rails" will install version 3.1. Based on experience, however, I would suggest install Rails 3.1.1.&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;
gem install rails --pre
&lt;/pre&gt;




&lt;h2&gt;Install Rails 3.1 on Ubuntu/Debian&lt;/h2&gt;


&lt;p&gt;The first requirement to install is RVM. You can always refer to RVM documentation. RVM has its dependencies too.&lt;/p&gt;

&lt;p&gt;It's easier to install now that &lt;a href="http://ricostacruz.com/" target="_blank"&gt;Rico Sta. Cruz &lt;/a&gt;made ServerWizard  which allows you to install several dependencies for development and production environment:&lt;/p&gt;

&lt;p&gt;&lt;a href ="http://serverwizard.heroku.com/" target="_blank"&gt;Serverwizard&lt;/a&gt; gives me this when I click on "Ruby version manager."&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;
sudo bash &lt; &lt;(wget "http://serverwizard.heroku.com/script/rvm" -q -O -)
&lt;/pre&gt;


&lt;p&gt;Make sure that the "rvm" command works. And you have updated your dotfile .bash_profile or .bashrc to contain:&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;
nano ~/.bash_profile 
Add: 
[[ -s "$HOME/.rvm/scripts/rvm" ]] &amp;&amp; source "$HOME/.rvm/scripts/rvm"
source ~/.bash_profile
&lt;/pre&gt;


&lt;p&gt;And this should work:&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;
rvm install 1.9.2
rvm 1.9.2 --default
&lt;/pre&gt;




&lt;h2&gt;Install Rails 3.1 on a Mac&lt;/h2&gt;


&lt;p&gt;I currently use OS X Lion for my Macbook Pro.So I'm a lot more certain about these steps I'm writing than the steps for Windows and Linux.&lt;/p&gt;

&lt;p&gt; The first step is to install &lt;a href="http://itunes.apple.com/us/app/xcode/id448457090?mt=12" target="_blank"&gt;Xcode&lt;/a&gt; for OS X Lion.&lt;/p&gt;

&lt;p&gt;Before you install Rails, make sure you have either MySQL or PostgreSQL installed. SQLite is OK but in production, we normally use MySQL or PostgreSQL.&lt;/p&gt;

&lt;p&gt;If you will use MySQL, it can be &lt;a href="http://dev.mysql.com/downloads/mysql/" target="_blank"&gt;downloaded&lt;/a&gt; and I installed version 5.1.58 because I did encounter issues for the latest version.&lt;/p&gt;

&lt;p&gt;After installing these, you can install &lt;a href="https://github.com/mxcl/homebrew/wiki/Installation" target="_blank"&gt;homebrew&lt;/a&gt;. On the terminal, these commands should work:&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;
/usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"
sudo chown -R $USER /usr/local
&lt;/pre&gt;


&lt;p&gt;Homebrew can install git, imagemagick and other dependencies for a common  Rails application.&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;
  brew install git
&lt;/pre&gt;


&lt;p&gt;PostgreSQL can be installed  via homebrew and I recommend doing so.&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;
  brew install postgresql 
&lt;/pre&gt;


&lt;p&gt;Read and follow the instructions. If you missed it (closed the terminal or something), try:&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;
  brew info postgresql 
&lt;/pre&gt;


&lt;p&gt;Now you can install RVM.&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;
bash &lt; &lt;(curl -s https://rvm.beginrescueend.com/install/rvm)

rvm install 1.9.2
rvm 1.9.2 --default
gem install rails --pre 
&lt;/pre&gt;

&lt;img src="http://feeds.feedburner.com/~r/Bridgeutopia/~4/4d3LK3yCw_s" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://blog.bridgeutopiaweb.com/post/install-rails-3-dot-1-on-windows-mac-and-linux/</feedburner:origLink></entry>
  <entry>
    <title>How to Fix Facebook and Omniauth Issue: SSLError</title>
    <link href="http://feedproxy.google.com/~r/Bridgeutopia/~3/fR25dT7Bw6g/" rel="alternate" />
    <id>http://blog.bridgeutopiaweb.com/post/how-to-fix-facebook-and-omniauth-issue-sslerror/</id>
    <published>2011-08-23T02:36:57-07:00</published>
    <updated>2011-08-23T02:36:57-07:00</updated>
    <author>
      <name />
    </author>
    <summary type="html">&lt;p&gt;If you use Facebook and Omniauth, you'll find that recent updates which I think more to do with Ruby has caused some issue.&lt;/p&gt;

&lt;p&gt;Read about &lt;a href="http://martinottenwaelter.fr/2010/12/ruby19-and-the-ssl-error/" target="_blank"&gt;Ruby 1.9 and the SSL error.&lt;/a&gt;&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;If you use Facebook and Omniauth, you'll find that recent updates which I think more to do with Ruby has caused some issue.&lt;/p&gt;

&lt;p&gt;Read about &lt;a href="http://martinottenwaelter.fr/2010/12/ruby19-and-the-ssl-error/" target="_blank"&gt;Ruby 1.9 and the SSL error.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The exact error I got is:&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;
A OpenSSL::SSL::SSLError occurred in #:

  SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
  /home/user/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/http.rb:678:in `connect'
&lt;/pre&gt;


&lt;p&gt;Encountered after upgrading to new version of omniauth.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://stackoverflow.com/questions/3977303/omniauth-facebook-certificate-verify-failed" target="_blank"&gt;Stackoverflow&lt;/a&gt; has been helpful for me to find the fix but had to read more about that certificate required.&lt;/p&gt;

&lt;p&gt;Make sure to update config.&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;
Rails.application.config.middleware.use OmniAuth::Builder do
    provider :facebook, FACEBOOK_KEY, FACEBOOK_SECRET, {:client_options =&gt; {:ssl =&gt; {:ca_path =&gt; "/etc/ssl/certs"}}}
end
&lt;/pre&gt;


&lt;p&gt;It wasn't stated clearly on the posts but this all you need to get it working:&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;
cd /etc/ssl/certs
sudo wget http://curl.haxx.se/ca/cacert.pem
&lt;/pre&gt;

&lt;img src="http://feeds.feedburner.com/~r/Bridgeutopia/~4/fR25dT7Bw6g" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://blog.bridgeutopiaweb.com/post/how-to-fix-facebook-and-omniauth-issue-sslerror/</feedburner:origLink></entry>
  <entry>
    <title>Testing Some Devise Features With RSpec, Steak and Email Spec</title>
    <link href="http://feedproxy.google.com/~r/Bridgeutopia/~3/GE3Bdv8rzcU/" rel="alternate" />
    <id>http://blog.bridgeutopiaweb.com/post/testing-some-devise-features-with-rspec-steak-and-email-spec/</id>
    <published>2011-08-02T08:40:03-07:00</published>
    <updated>2011-08-02T08:40:03-07:00</updated>
    <author>
      <name />
    </author>
    <summary type="html">&lt;p&gt;Having spent hours writing cucumber tests and finding out that it all doesn't work with Rails 3.1 RC5 is frustrating. It disrupts the flow of things. In my mind all I wanted was to move on to focus on new features. Not being able to write tests for the new features because of incompatibility issues is just hell. That's the only reason why I started using Steak yesterday for acceptance tests.&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;Having spent hours writing cucumber tests and finding out that it all doesn't work with Rails 3.1 RC5 is frustrating. It disrupts the flow of things. In my mind all I wanted was to move on to focus on new features. Not being able to write tests for the new features because of incompatibility issues is just hell. That's the only reason why I started using Steak yesterday for acceptance tests.&lt;/p&gt;

&lt;p&gt;But now I found at least 2 more reasons why I shouldn't be using cucumber:&lt;/p&gt;

&lt;p&gt;1) We communicate ideas and stories in the language and order we want to. By that I mean we speak usual conversational English.  There is no reason to read specific user stories that use a lot of "and" and "then." This is something my clients simply DON'T appreciate.&lt;/p&gt;

&lt;p&gt;2) Steak is a lot more simple. Less verbose and therefore some time should be saved.&lt;/p&gt;

&lt;p&gt;3) If I work for myself and I am a programmer, why should I ever want to read cucumber stories? I see no need for it.&lt;/p&gt;

&lt;p&gt;Getting a Rails 3 .1 app working with Steak is fairly simple if you follow the docs on github. Just update rspec.rake to make sure "rake spec:acceptance" works.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://gist.github.com/1118143" target="_blank"&gt;Click here&lt;/a&gt; to check the update.&lt;/p&gt;

&lt;p&gt;Updated spec/acceptance/acceptance_helper.rb&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;
require 'spec_helper'
require 'email_spec'

# Put your acceptance spec helpers inside spec/acceptance/support
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
&lt;/pre&gt;


&lt;p&gt;Updated &lt;a href="https://gist.github.com/1120456" target="_blank"&gt; spec/acceptance/support/helpers.rb&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;My RSpec config file looks a bit like this:&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;

RSpec.configure do |config|
  config.include Devise::TestHelpers, :type =&gt; :controller
  config.include Warden::Test::Helpers, :type =&gt; :acceptance
  config.after(:each, :type =&gt; :acceptance) { Warden.test_reset! }
  config.include EmailSpec::Helpers
  config.include EmailSpec::Matchers
end
&lt;/pre&gt;


&lt;p&gt;Here's how to reset password feature (Devise defaults have not changed). I've removed other tests relevant to password reset and just kept one which shows how to test emails.&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;
require 'acceptance/acceptance_helper'

feature 'Password Reset' do

  background do
    @user = Factory(:user, :email=&gt;"ako@sikatz.com") 
  end
    
  scenario 'user should receive an email and successfully reset password' do
    
    reset_mailer

    visit '/new_password'
    fill_in "user[email]", :with=&gt;@user.email
    click_button "Submit"
    
    unread_emails_for(@user.email).size.should &gt;= parse_email_count(1)
    open_email(@user.email)
    email_should_have_body("Someone has requested a link to change your password, and you can do this through the link below.")
    click_first_link_in_email

    within('body') do
      page.should have_content('Change Your Password')
    end

    fill_in "user[password]", :with=&gt;"password"
    fill_in "user[password_confirmation]", :with=&gt;"password"
    click_button "Change Password"

    within('body') do
      page.should have_content('Your password was changed successfully.')
    end
       
  end
  
end
&lt;/pre&gt;

&lt;img src="http://feeds.feedburner.com/~r/Bridgeutopia/~4/GE3Bdv8rzcU" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://blog.bridgeutopiaweb.com/post/testing-some-devise-features-with-rspec-steak-and-email-spec/</feedburner:origLink></entry>
  <entry>
    <title>Rails 3.1 Stable Notes</title>
    <link href="http://feedproxy.google.com/~r/Bridgeutopia/~3/ejsXuWcXpIg/" rel="alternate" />
    <id>http://blog.bridgeutopiaweb.com/post/rails-3-dot-1-stable-notes/</id>
    <published>2011-07-18T07:37:30-07:00</published>
    <updated>2011-07-18T07:37:30-07:00</updated>
    <author>
      <name />
    </author>
    <summary type="html">&lt;p&gt;Been working on Rails 3.1 apps. There is a good reason to use it even if there are existing issues.&lt;/p&gt;

&lt;p&gt;All of my current projects (for clients and personal projects) have already been upgraded to Rails 3.1 RC4. This includes &lt;a href="http://www.33voices.com" target="_blank"&gt;www.33voices.com&lt;/a&gt;.&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;Been working on Rails 3.1 apps. There is a good reason to use it even if there are existing issues.&lt;/p&gt;

&lt;p&gt;All of my current projects (for clients and personal projects) have already been upgraded to Rails 3.1 RC4. This includes &lt;a href="http://www.33voices.com" target="_blank"&gt;www.33voices.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Obviously, it works. I use both Rspec and Cucumber. If sufficient tests are written for your application, knowing what doesn't work anymore isn't a problem if you want to upgrade from 3.0.x or 2.x versions of Rails.&lt;/p&gt;

&lt;p&gt;The good reasons are:&lt;/p&gt;

&lt;p&gt;1) It's an opportunity to clean up your code&lt;/p&gt;

&lt;p&gt;In what ways? Check on your existing dependencies. Do you really need everything? Like asset packager? I know that the latest version of The Agile Web Development With Rails recommends that and it still works for 2.x and 3.0.x versions for Rails.
But with Rails 3.1, you don't need that because minifying stylesheets and javascripts is something supported by Rails 3.1.&lt;/p&gt;

&lt;p&gt;2) It is more simple for newbies who want to learn HAML and SCSS or SASS&lt;/p&gt;

&lt;p&gt;There is no need for commands like "sass --watch" and "compass watch." Honestly I still don't see the need for compass until now.  If you're fine without it and it doesn't significantly improve your productivity, the conclusion is it is not necessary.&lt;/p&gt;

&lt;p&gt;It is interesting that there's a hackfest on July 23 or so. I'd be offline most of the day (traveling) but I hope to see what the Rails community is working on.&lt;/p&gt;

&lt;h2&gt;Create a gemset for edge Rails&lt;/h2&gt;


&lt;p&gt;This makes sense to me to avoid any conflict with apps using a lower version.&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;
rvm gemset create edge
rvm use ruby-1.9.2-p180@edge
gem install bundler
cd appname
bundle install
&lt;/pre&gt;




&lt;h2&gt; How to test Rails 3.1 Stable &lt;/h2&gt;




&lt;pre class="brush: ruby"&gt;
gem install rails --pre
rails new appname -d postgresql
cd appname

&lt;/pre&gt;


&lt;p&gt;You must have postgreSQL installed via homebrew or so.&lt;/p&gt;

&lt;p&gt;Edit Gemfile to use rails edge.&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;
gem 'rails',     :git =&gt; 'git://github.com/rails/rails.git', :branch=&gt;'3-1-stable'
gem 'sass-rails', :git=&gt;"git://github.com/rails/sass-rails.git", :branch=&gt;'3-1-stable'
&lt;/pre&gt;




&lt;h2&gt; Use Git Flow&lt;/h2&gt;


&lt;p&gt;It's sensible to use it for all projects in my opinion. Read more about it &lt;a href="https://github.com/nvie/gitflow" target="_blank"&gt; here&lt;/a&gt;.&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;
git flow init
&lt;/pre&gt;




&lt;h2&gt; More Configuration work&lt;/h2&gt;


&lt;p&gt;Edit .gitignore file and config/database.yml.&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;
rake db:create:all 
&lt;/pre&gt;


&lt;p&gt;That creates all databases though probably development &amp;amp; test environment would do. Encountered no issues so far.&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;
rails server 

&lt;/pre&gt;




&lt;h2&gt; Gems you might need &lt;/h2&gt;


&lt;p&gt;We used to have them as helpers in Rails and now they removed it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/sishen/rails_autolink" target="_blank"&gt;Rails auto_link (not official)&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/rails/prototype-rails" target="_blank"&gt;Prototype, Scriptaculous, and RJS for Rails 3.1&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt; What is broken with Rails 3.1 Stable?&lt;/h2&gt;


&lt;p&gt;Cucumber-rails version 1.0.0 does not work with Rails 3.1 "stable" but works with Rails 3.1 RC4.&lt;/p&gt;

&lt;p&gt;Precompiling assets doesn't always work with naming conventions followed.&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;
admin.css.scss.erb 
&lt;/pre&gt;


&lt;p&gt;Why is it necessary to make it an erb file? You have to use asset_path to make sure the link to the static assets are correct.&lt;/p&gt;

&lt;p&gt;Specify stylesheets to precompile. If you have admin.css.erb for example, that may be missed and won't be precompiled.&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;
config.assets.precompile += %w(admin.css.erb)
&lt;/pre&gt;


&lt;p&gt;I have a few more notes about asset pipeline &lt;a href="https://gist.github.com/1069971" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/Bridgeutopia/~4/ejsXuWcXpIg" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://blog.bridgeutopiaweb.com/post/rails-3-dot-1-stable-notes/</feedburner:origLink></entry>
  <entry>
    <title>Using Fog For Amazon Cloudfront</title>
    <link href="http://feedproxy.google.com/~r/Bridgeutopia/~3/Fmtgd2eSDb8/" rel="alternate" />
    <id>http://blog.bridgeutopiaweb.com/post/using-fog-for-amazon-cloudfront/</id>
    <published>2011-07-12T03:31:49-07:00</published>
    <updated>2011-07-12T03:31:49-07:00</updated>
    <author>
      <name />
    </author>
    <summary type="html">&lt;p&gt;There are a lot of ways to set up a CDN and you don't even need to be a programmer to do so. &lt;a href="http://trac.cyberduck.ch/wiki/help/en/howto/cloudfront" target="_blank"&gt;Cyberduck&lt;/a&gt; seems to have worked for some people.&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;There are a lot of ways to set up a CDN and you don't even need to be a programmer to do so. &lt;a href="http://trac.cyberduck.ch/wiki/help/en/howto/cloudfront" target="_blank"&gt;Cyberduck&lt;/a&gt; seems to have worked for some people.&lt;/p&gt;

&lt;p&gt;Found fog gem recently and it's working except that their &lt;a href="http://fog.io/0.9.0/cdn/" target="_blank"&gt;documentation&lt;/a&gt; hasn't been updated. "Enabled" option is now required.&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;
require 'rubygems'
require 'fog'

cdn = Fog::CDN.new({
  :provider               =&gt; 'AWS',
  :aws_access_key_id =&gt; "xx", 
  :aws_secret_access_key =&gt; "xx"
})

data = cdn.post_distribution({
  'CustomOrigin' =&gt; {
    'DNSName' =&gt; 'xx.yourdomain.com',
    'HTTPPort' =&gt; 80, 
    'OriginProtocolPolicy'  =&gt; 'match-viewer'
  }, 
  'CNAME' =&gt; 'cdn.yourdomain.com',
  'Enabled' =&gt;true
})

# parse the response for stuff you'll need later
distribution_id   = data.body['Id']
caller_reference  = data.body['CallerReference']
etag              = data.headers['ETag']
cdn_domain_name   = data.body['DomainName']

&lt;/pre&gt;


&lt;p&gt;Hope that helps someone.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/Bridgeutopia/~4/Fmtgd2eSDb8" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://blog.bridgeutopiaweb.com/post/using-fog-for-amazon-cloudfront/</feedburner:origLink></entry>
  <entry>
    <title>Timeline Fu</title>
    <link href="http://feedproxy.google.com/~r/Bridgeutopia/~3/IExxn3X1taI/" rel="alternate" />
    <id>http://blog.bridgeutopiaweb.com/post/timeline-fu/</id>
    <published>2011-06-23T03:56:40-07:00</published>
    <updated>2011-06-23T03:56:40-07:00</updated>
    <author>
      <name />
    </author>
    <summary type="html">&lt;p&gt;Realized nearly all of my projects involved logging user actions and having news feeds similar to Facebook. Two years ago, it didn't seem sensible to use a gem for just that because all you need is to create a module and helpers to log actions (on your model of course). A common mistake is adding code for logging actions, sending emails  on controllers. Sometimes when you are young, you do stupid things.&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;Realized nearly all of my projects involved logging user actions and having news feeds similar to Facebook. Two years ago, it didn't seem sensible to use a gem for just that because all you need is to create a module and helpers to log actions (on your model of course). A common mistake is adding code for logging actions, sending emails  on controllers. Sometimes when you are young, you do stupid things.&lt;/p&gt;

&lt;p&gt;Timeline Fu is a gem that allows you to easily build timelines, much like GitHub’s news feed or event Facebook news feed.&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;
  class Post &lt; ActiveRecord::Base
    #...
    belongs_to :author, :class_name =&gt; 'Person'
    fires :new_post, :on    =&gt; :create, :actor =&gt; :author
  end

&lt;/pre&gt;


&lt;p&gt;&lt;/p&gt;

&lt;p&gt;When a new post is created, the action is saved with the author as the actor and the post as the subject. There are also secondary subjects which makes sense if your model is a Comment model and you have a post. The secondary subject can be the post.&lt;/p&gt;

&lt;h2&gt;Destroying associated records&lt;/h2&gt;


&lt;p&gt;Of course, it is easy in Rails! Unless you forgot to add it up.&lt;/p&gt;

&lt;p&gt;&lt;/pre&gt;&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;
  class Post &lt; ActiveRecord::Base
    #...
    belongs_to :author, :class_name =&gt; 'Person'
     has_many :timeline_events, :as =&gt; :subject, :dependent =&gt; :destroy
    fires :new_post, :on    =&gt; :create, :actor =&gt; :author
  end

 on  post_spec.rb
   #see shoulda and Rspec
   describe "assert associations" do
     it { should have_many(:timeline_events) }
   end

&lt;/pre&gt;

&lt;img src="http://feeds.feedburner.com/~r/Bridgeutopia/~4/IExxn3X1taI" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://blog.bridgeutopiaweb.com/post/timeline-fu/</feedburner:origLink></entry>
  <entry>
    <title>Why aren't you using git-flow?</title>
    <link href="http://feedproxy.google.com/~r/Bridgeutopia/~3/omKcQ4QtN2s/" rel="alternate" />
    <id>http://blog.bridgeutopiaweb.com/post/why-arent-you-using-git-flow/</id>
    <published>2011-06-14T01:14:04-07:00</published>
    <updated>2011-06-14T01:14:04-07:00</updated>
    <author>
      <name />
    </author>
    <summary type="html">&lt;p&gt;I see no reason not to use it.&lt;/p&gt;

&lt;p&gt;It simplifies the process of creating a new branch for a feature or a hotfix and merging changes to master branch.&lt;/p&gt;

&lt;p&gt;Read: &lt;a href="http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/" target="_blank"&gt;Why aren't you using git-flow&lt;/a&gt;&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;I see no reason not to use it.&lt;/p&gt;

&lt;p&gt;It simplifies the process of creating a new branch for a feature or a hotfix and merging changes to master branch.&lt;/p&gt;

&lt;p&gt;Read: &lt;a href="http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/" target="_blank"&gt;Why aren't you using git-flow&lt;/a&gt;&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/Bridgeutopia/~4/omKcQ4QtN2s" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://blog.bridgeutopiaweb.com/post/why-arent-you-using-git-flow/</feedburner:origLink></entry>
  <entry>
    <title>Fix OpenSSL Not Found Error For Passenger Installation (RVM)</title>
    <link href="http://feedproxy.google.com/~r/Bridgeutopia/~3/v6bDdMy9fZY/" rel="alternate" />
    <id>http://blog.bridgeutopiaweb.com/post/fix-openssl-not-found-error-for-passenger-installation-rvm/</id>
    <published>2011-06-01T04:03:39-07:00</published>
    <updated>2011-06-01T04:03:39-07:00</updated>
    <author>
      <name />
    </author>
    <summary type="html">&lt;p&gt;This is a strange issue. I usually document how I install RVM, passenger and Nginx and it always worked for me (we use Ubuntu on Amazon EC2 and several other VPS servers) but recently encountered an issue with OpenSSL.&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;This is a strange issue. I usually document how I install RVM, passenger and Nginx and it always worked for me (we use Ubuntu on Amazon EC2 and several other VPS servers) but recently encountered an issue with OpenSSL.&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;

Welcome to the Phusion Passenger Nginx module installer, v3.0.7.

This installer will guide you through the entire installation process. It
shouldn't take more than 5 minutes in total.

Here's what you can expect from the installation process:

 1. This installer will compile and install Nginx with Passenger support.
 2. You'll learn how to configure Passenger in Nginx.
 3. You'll learn how to deploy a Ruby on Rails application.

Don't worry if anything goes wrong. This installer will advise you on how to
solve any problems.

Press Enter to continue, or Ctrl-C to abort.
1

--------------------------------------------

Checking for required software...

 * GNU C++ compiler... found at /usr/bin/g++
 * The 'make' tool... found at /usr/bin/make
 * A download tool like 'wget' or 'curl'... found at /usr/bin/wget
 * Ruby development headers... found
 * OpenSSL support for Ruby... not found
 * RubyGems... found
 * Rake... found at /home/username/.rvm/wrappers/ruby-1.9.2-p180/rake
 * rack... found
 * Curl development headers with SSL support... found
 * OpenSSL development headers... found
 * Zlib development headers... found

Some required software is not installed.
But don't worry, this installer will tell you how to install them.

Press Enter to continue, or Ctrl-C to abort.

--------------------------------------------

Installation instructions for required software

 * To install OpenSSL support for Ruby:
   Please run apt-get install libopenssl-ruby as root.

&lt;/pre&gt;


&lt;p&gt;So I did install libopenssl-ruby but still got the same error.&lt;/p&gt;

&lt;p&gt;This could save someone's time:&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;
rvm remove 1.9.2 
rvm pkg install openssl
rvm install 1.9.2 --with-openssl-dir=$HOME/.rvm/usr
&lt;/pre&gt;


&lt;p&gt;Then install passenger.&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;
  gem install passenger
  rvmsudo passenger-install-nginx-module
&lt;/pre&gt;

&lt;img src="http://feeds.feedburner.com/~r/Bridgeutopia/~4/v6bDdMy9fZY" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://blog.bridgeutopiaweb.com/post/fix-openssl-not-found-error-for-passenger-installation-rvm/</feedburner:origLink></entry>
  <entry>
    <title>Don't Forget Ruby's Send Method</title>
    <link href="http://feedproxy.google.com/~r/Bridgeutopia/~3/NU9qP2q1vpk/" rel="alternate" />
    <id>http://blog.bridgeutopiaweb.com/post/dont-forget-rubys-send-method/</id>
    <published>2011-05-25T14:15:26-07:00</published>
    <updated>2011-05-25T14:15:26-07:00</updated>
    <author>
      <name />
    </author>
    <summary type="html">&lt;p&gt;First of all thank you for reading. Thanks to those who thanked me for blogging. Been very busy and hardly found time to blog.&lt;/p&gt;

&lt;p&gt;In the past few years, Ruby's send method saved me from having to write several lines of code. Don't you ever forget about it.&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;First of all thank you for reading. Thanks to those who thanked me for blogging. Been very busy and hardly found time to blog.&lt;/p&gt;

&lt;p&gt;In the past few years, Ruby's send method saved me from having to write several lines of code. Don't you ever forget about it.&lt;/p&gt;

&lt;p&gt;Let me show you a simple example which is actually very fun because it has to do with social networks or third party services.&lt;/p&gt;

&lt;p&gt;Goal: we want to display the logo of Twitter, Facebook and Google along with the links if the user is not authenticated (has not successfully authorized the application to access and write data to the third party service) or if the user is not a current user.&lt;/p&gt;

&lt;p&gt;This is how we write that if we use devise and omniauth:&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;
  - resource_class.omniauth_providers.each do |provider| 
    =link_to "Connect via #{provider.to_s.titleize}" ,  omniauth_authorize_path(resource_name, provider), :class=&gt;"#{provider.to_s}_login_icon clearFix" unless (current_user and current_user.send(provider.to_s))
&lt;/pre&gt;


&lt;p&gt;So by now you've figured out that I have some instance methods on a module that would either return true, false or nil.&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;
on user.rb

include User::Authentications 

on user/authentications.rb

module User::Authentications 
    
  def self.included(base)
    base.send(:include, InstanceMethods)
  end
  

  module InstanceMethods

    def facebook

      begin
        @fb_user ||= FbGraph::User.me(self.authentications.find_by_provider('facebook').token)
      rescue
        return nil
      end
    end

   def twitter
     #some code here
   end

   def google_apps
     #some code here 
   end 
  end


end

&lt;/pre&gt;


&lt;p&gt;Took out the code for twitter and google apps. But you should realize the benefit of the send method if you were developing something more complex and had more instance methods. Prior to this, I remember using send method for a psychology quiz application.&lt;/p&gt;

&lt;p&gt;More on Ruby's send method:&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;

on_class = "Post"
on_class.constantize.send("method_name")
on_class.constantize.send("method_name", arg1)

&lt;/pre&gt;


&lt;p&gt;We can use constantize to convert string to a constant as the name suggests.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/Bridgeutopia/~4/NU9qP2q1vpk" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://blog.bridgeutopiaweb.com/post/dont-forget-rubys-send-method/</feedburner:origLink></entry>
  <entry>
    <title>Looking for Web Designers Willing To Learn Rails</title>
    <link href="http://feedproxy.google.com/~r/Bridgeutopia/~3/Nyg7HXQ-Rk4/" rel="alternate" />
    <id>http://blog.bridgeutopiaweb.com/post/looking-for-web-designers-willing-to-learn-rails/</id>
    <published>2011-05-12T00:37:22-07:00</published>
    <updated>2011-05-12T00:37:22-07:00</updated>
    <author>
      <name />
    </author>
    <summary type="html">&lt;p&gt;Greetings. We're working on a small project for the Philippine Ruby Users Group. We particularly need a web designer to help us and volunteer on the project.&lt;/p&gt;

&lt;p&gt;Currently, I have about 10 to 15 hours availability per week to work on the project and we still need more people who are naturally enthusiastic and willing to help or provide their services for free.&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;Greetings. We're working on a small project for the Philippine Ruby Users Group. We particularly need a web designer to help us and volunteer on the project.&lt;/p&gt;

&lt;p&gt;Currently, I have about 10 to 15 hours availability per week to work on the project and we still need more people who are naturally enthusiastic and willing to help or provide their services for free.&lt;/p&gt;

&lt;p&gt;If you're  a Philippine-based web designer and willing to help, please contact me.&lt;/p&gt;

&lt;p&gt;Thank you.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/Bridgeutopia/~4/Nyg7HXQ-Rk4" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://blog.bridgeutopiaweb.com/post/looking-for-web-designers-willing-to-learn-rails/</feedburner:origLink></entry>
  <entry>
    <title>What You Should Know Before You Upgrade Your Rails 3 App To Rails 3.1 Beta</title>
    <link href="http://feedproxy.google.com/~r/Bridgeutopia/~3/a0wODDsg7dw/" rel="alternate" />
    <id>http://blog.bridgeutopiaweb.com/post/what-you-should-know-before-you-upgrade-your-rails-3-app-to-rails-3-dot-1-beta/</id>
    <published>2011-05-10T08:38:25-07:00</published>
    <updated>2011-05-10T08:38:25-07:00</updated>
    <author>
      <name />
    </author>
    <summary type="html">&lt;p&gt;This is based on both research and experience.&lt;/p&gt;

&lt;p&gt;I upgraded a Rails 3 app to Rails 3.1.&lt;/p&gt;

&lt;p&gt;There were many issues. But they aren't much compared to the benefits you'd get from using the latest version. Rails 3.1 takes away a lot of pain. Instead of using asset packager, having sprockets makes it so much easier to deploy an optimized application. Not all frameworks have this. In fact it hasn't been a practice of certain developers to make sure that a single file is loaded for javascript in production and a single is loaded for stylesheet in production. Reversible migrations is another cool thing. Also read that there is no need to add ":multipart=&gt;true" on a form if you use the file field.&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;This is based on both research and experience.&lt;/p&gt;

&lt;p&gt;I upgraded a Rails 3 app to Rails 3.1.&lt;/p&gt;

&lt;p&gt;There were many issues. But they aren't much compared to the benefits you'd get from using the latest version. Rails 3.1 takes away a lot of pain. Instead of using asset packager, having sprockets makes it so much easier to deploy an optimized application. Not all frameworks have this. In fact it hasn't been a practice of certain developers to make sure that a single file is loaded for javascript in production and a single is loaded for stylesheet in production. Reversible migrations is another cool thing. Also read that there is no need to add ":multipart=&gt;true" on a form if you use the file field.&lt;/p&gt;

&lt;p&gt;You might want to read the &lt;a href="https://gist.github.com/958283" target="_blank"&gt;changelog&lt;/a&gt; (which is not complete) to find out what else has changed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt; RJS issues &lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You might encounter a missing template error. Those remote links may not work anymore. What worked for me: I moved javascript code to update.js.haml.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt; SCSS issues &lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I encountered issues with mixins and SCSS. This is probably a known issue which they are fixing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Will paginate&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Encountered errors due to a class renamed. I recommend using this for now:&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;
gem 'will_paginate', :git =&gt; 'git@github.com:bridgeutopia/will_paginate.git', :branch =&gt; 'rails3'
&lt;/pre&gt;


&lt;p&gt;&lt;strong&gt; Cucumber&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you use cucumber, it currently doesn't work for me. But Rspec works perfectly. This is a big issue for some. I do not want to bother fixing it right now. Testing manually doesn't hurt.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Deprecation warnings&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Please look at this interesting post on &lt;a href="http://stackoverflow.com/questions/2689377/silencing-deprecation-warnings-in-rails-3" target="_blank"&gt;stackoverflow&lt;/a&gt;. If you're like me (easily annoyed), check that out.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/Bridgeutopia/~4/a0wODDsg7dw" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://blog.bridgeutopiaweb.com/post/what-you-should-know-before-you-upgrade-your-rails-3-app-to-rails-3-dot-1-beta/</feedburner:origLink></entry>
  <entry>
    <title>How To Install CoffeeScript On Mac OS X</title>
    <link href="http://feedproxy.google.com/~r/Bridgeutopia/~3/ZkpwySTZqTc/" rel="alternate" />
    <id>http://blog.bridgeutopiaweb.com/post/how-to-install-coffeescript-on-mac-os-x/</id>
    <published>2011-05-05T05:36:10-07:00</published>
    <updated>2011-05-05T05:36:10-07:00</updated>
    <author>
      <name />
    </author>
    <summary type="html">&lt;p&gt;If you are a Rails developer, you should know that Rails 3.1 beta has been released today. I am trying out the beta version so I don't have to stress about migrating or upgrading later.&lt;/p&gt;

&lt;h3&gt; Install CofeeScript Using Homebrew&lt;/h3&gt;

</summary>
    <content type="html">&lt;p&gt;If you are a Rails developer, you should know that Rails 3.1 beta has been released today. I am trying out the beta version so I don't have to stress about migrating or upgrading later.&lt;/p&gt;

&lt;h3&gt; Install CofeeScript Using Homebrew&lt;/h3&gt;


&lt;p&gt;Install &lt;a href="https://github.com/mxcl/homebrew" target="_blank"&gt;homebrew&lt;/a&gt; if you haven't yet. It's a lot better than fink. Macports didn't work well for me too. I use homebrew.&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;

  brew install node
  
  Caveats:
  
  Please add /usr/local/lib/node to your NODE_PATH environment variable to have node libraries picked up.

  curl http://npmjs.org/install.sh | sh

  npm install -g coffee-script
  

&lt;/pre&gt;


&lt;p&gt;This is the output after install node.&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;
==&gt; Downloading http://nodejs.org/dist/node-v0.4.7.tar.gz
######################################################################## 100.0%
==&gt; ./configure --prefix=/usr/local/Cellar/node/0.4.7
==&gt; make install
==&gt; Caveats
Please add /usr/local/lib/node to your NODE_PATH environment variable to have node libraries picked up.
==&gt; Summary
/usr/local/Cellar/node/0.4.7: 72 files, 7.5M, built in 3.1 minutes
&lt;/pre&gt;


&lt;p&gt;Check if everything is working:&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;
  node -v
  npm -v
  coffee -v
&lt;/pre&gt;




&lt;h3&gt;Test CoffeeScript&lt;/h3&gt;


&lt;p&gt;Create a file called test.coffee&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;
# Assignment:
number   = 42
opposite = true

# Conditions:
number = -42 if opposite

# Functions:
square = (x) -&gt; x * x

# Arrays:
list = [1, 2, 3, 4, 5]

# Objects:
math =
  root:   Math.sqrt
  square: square
  cube:   (x) -&gt; x * square x

# Splats:
race = (winner, runners...) -&gt;
  print winner, runners

# Existence:
alert "I knew it!" if elvis?

# Array comprehensions:
cubes = (math.cube num for num in list)

&lt;/pre&gt;


&lt;p&gt;Then run "coffee -c test.coffee". If you see a test.js file on the same directory then it's all good.&lt;/p&gt;

&lt;h3&gt;CoffeeScript for Textmate&lt;/h3&gt;




&lt;pre class="brush: ruby"&gt;

  cd ~/Library/Application\ Support/TextMate/Bundles
  git clone git://github.com/jashkenas/coffee-script-tmbundle CoffeeScript.tmbundle

&lt;/pre&gt;




&lt;h3&gt; Debian or Ubuntu&lt;/h3&gt;


&lt;p&gt;If you use Debian or Ubuntu for production, you will find &lt;a href="http://opinionatedprogrammer.com/2010/12/installing-coffeescript-on-debian-or-ubuntu/" target="_blank"&gt;this link&lt;/a&gt; useful.&lt;/p&gt;

&lt;h3&gt;Off-topic  Update&lt;/h3&gt;


&lt;p&gt;I am working on a small project just so I'd get to learn Rails 3.1 this week. This is called "sleep." It's so precious because I hardly have any &lt;a href="https://github.com/bridgeutopia/sleep" target="_blank"&gt;sleep&lt;/a&gt; lately because of so much work. But that's something I should thank for still.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/Bridgeutopia/~4/ZkpwySTZqTc" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://blog.bridgeutopiaweb.com/post/how-to-install-coffeescript-on-mac-os-x/</feedburner:origLink></entry>
  <entry>
    <title>How to Import Contacts From Yahoo or Google Using Ruby</title>
    <link href="http://feedproxy.google.com/~r/Bridgeutopia/~3/IW11a6aVMqU/" rel="alternate" />
    <id>http://blog.bridgeutopiaweb.com/post/how-to-import-contacts-from-yahoo-or-google-using-ruby/</id>
    <published>2011-04-28T10:26:28-07:00</published>
    <updated>2011-04-28T10:26:28-07:00</updated>
    <author>
      <name />
    </author>
    <summary type="html">&lt;p&gt;I came across &lt;a href="http://raveendran.wordpress.com/2009/03/07/contacts-ruby-gem-import-contacts-from-gmail-yahoo-hotmail/" rel="nofollow" target="_blank"&gt;this tutorial&lt;/a&gt;  on how to import contacts from Gmail, Yahoo or Hotmail.&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;I came across &lt;a href="http://raveendran.wordpress.com/2009/03/07/contacts-ruby-gem-import-contacts-from-gmail-yahoo-hotmail/" rel="nofollow" target="_blank"&gt;this tutorial&lt;/a&gt;  on how to import contacts from Gmail, Yahoo or Hotmail.&lt;/p&gt;

&lt;p&gt;The primary issue I encountered is that the gem doesn't work for Ruby 1.9. I use Ruby 1.9.2 for all of my Rails projects.&lt;/p&gt;

&lt;p&gt;This might be useful for someone who's trying to get it to work. Just use my fork of the project on your Gemfile.&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;
gem 'contacts', :git=&gt;"git@github.com:bridgeutopia/contacts.git"
&lt;/pre&gt;


&lt;p&gt;The gem uses gdata-19 which is pretty much a fork of the gdata project. I am aware there's already a gdata19 project but it doesn't quite work the way it expect it to. I still encountered some issues.&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;
gem install gdata-19
&lt;/pre&gt;


&lt;p&gt;This is now working for me:&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;
Contacts::Gmail.new(gmail_email, gmail_password).contacts
&lt;/pre&gt;


&lt;p&gt;And it's so fast!&lt;/p&gt;

&lt;p&gt;Known Issues:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt; Security&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;HTTP authentication is less secure than OAuth.&lt;/p&gt;

&lt;p&gt;Make sure you add something like this on your application.rb&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;
    config.filter_parameters += [:gmail_email]
    config.filter_parameters += [:gmail_password]
&lt;/pre&gt;


&lt;p&gt;We don't store data but there may be security issues. In fact, I don't use apps that use HTTP authentication. That isn't possible for e-commerce apps though. Developers still often store card number (and hopefully not the CVV though I have heard of some who do that!)&lt;/p&gt;

&lt;p&gt;If anyone knows a gem or can create a gem for importing contacts from yahoo/gmail/hotmail and the gem supports OAuth, please let me know.&lt;/p&gt;

&lt;p&gt;Thank you.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/Bridgeutopia/~4/IW11a6aVMqU" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://blog.bridgeutopiaweb.com/post/how-to-import-contacts-from-yahoo-or-google-using-ruby/</feedburner:origLink></entry>
  <entry>
    <title>How to fix MySQL load issues on OS X</title>
    <link href="http://feedproxy.google.com/~r/Bridgeutopia/~3/GY6XloIG1L4/" rel="alternate" />
    <id>http://blog.bridgeutopiaweb.com/post/how-to-fix-mysql-load-issues-on-mac-os-x/</id>
    <published>2011-03-16T04:32:15-07:00</published>
    <updated>2011-03-16T04:32:15-07:00</updated>
    <author>
      <name />
    </author>
    <summary type="html">&lt;p&gt;This is only for those who encounter the same issues. Sometimes we're not so lucky with mysql and I worked with an Australian developer who said he never got mysql installation right the first time regardless of whether he was using a Mac or Windows. I never had the same problems before until now. I am using OS X 10.6.6 and MySQL 5.5. I now feel his pain. Why is it so effin' difficult to get it "working"?&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;This is only for those who encounter the same issues. Sometimes we're not so lucky with mysql and I worked with an Australian developer who said he never got mysql installation right the first time regardless of whether he was using a Mac or Windows. I never had the same problems before until now. I am using OS X 10.6.6 and MySQL 5.5. I now feel his pain. Why is it so effin' difficult to get it "working"?&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;

Katherine-Pes-MacBook-Pro:~ katz$ search
dyld: Library not loaded: libmysqlclient.18.dylib
  Referenced from: /usr/local/bin/search
  Reason: image not found

&lt;/pre&gt;


&lt;p&gt;I use sphinx only for mysql projects. But there are better options out there for sure.&lt;/p&gt;

&lt;p&gt;This is how we fix that issue:&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;
sudo install_name_tool -change libmysqlclient.18.dylib /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/local/bin/indexer


sudo install_name_tool -change libmysqlclient.18.dylib /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/local/bin/search

&lt;/pre&gt;


&lt;p&gt;And probably every time you get a similar issue, consider using similar command. Just change the paths.&lt;/p&gt;

&lt;p&gt;This will probably work (but not tested. I agree it is insane to use install_name_tool every time the same issue occurs.&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;

export DYLD_LIBRARY_PATH=/usr/local/mysql/lib/

&lt;/pre&gt;



&lt;img src="http://feeds.feedburner.com/~r/Bridgeutopia/~4/GY6XloIG1L4" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://blog.bridgeutopiaweb.com/post/how-to-fix-mysql-load-issues-on-mac-os-x/</feedburner:origLink></entry>
  <entry>
    <title>How To Retrieve Facebook Comments Using Ruby and Koala</title>
    <link href="http://feedproxy.google.com/~r/Bridgeutopia/~3/StKfcYKYabY/" rel="alternate" />
    <id>http://blog.bridgeutopiaweb.com/post/how-to-retrieve-facebook-comments-using-ruby-and-koala/</id>
    <published>2011-03-02T22:16:36-08:00</published>
    <updated>2011-03-02T22:16:36-08:00</updated>
    <author>
      <name />
    </author>
    <summary type="html">&lt;p&gt;I have used fb_graph gem but found it insufficient. There are several Ruby gems for facebook by the way. I suggest using koala. Koala supports OAuth, REST API and the recommended Graph API.&lt;/p&gt;

&lt;p&gt;Add the gem on your Gemfile if you are using Rails 3 or Sinatra with bundler.&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;I have used fb_graph gem but found it insufficient. There are several Ruby gems for facebook by the way. I suggest using koala. Koala supports OAuth, REST API and the recommended Graph API.&lt;/p&gt;

&lt;p&gt;Add the gem on your Gemfile if you are using Rails 3 or Sinatra with bundler.&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;
gem 'koala'
&lt;/pre&gt;


&lt;p&gt;To retrieve Facebook comments for a site, it is quite simple. Just query or get all xid's on comments_info table and when you get all xid's, you can select the comments. The query looks like SQL. FQL is actually less than SQL (LIKE is not supported).&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;
@rest = Koala::Facebook::RestAPI.new(token)
@all_comments = @rest.fql_query("SELECT id, fromid, xid, text, time from comment WHERE xid IN (#{@comments_ids.join(",")})")
&lt;/pre&gt;

&lt;img src="http://feeds.feedburner.com/~r/Bridgeutopia/~4/StKfcYKYabY" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://blog.bridgeutopiaweb.com/post/how-to-retrieve-facebook-comments-using-ruby-and-koala/</feedburner:origLink></entry>
  <entry>
    <title>SCSS Mixins</title>
    <link href="http://feedproxy.google.com/~r/Bridgeutopia/~3/BCPzCFQKPf8/" rel="alternate" />
    <id>http://blog.bridgeutopiaweb.com/post/scss-mixins/</id>
    <published>2011-02-04T03:31:30-08:00</published>
    <updated>2011-02-04T03:31:30-08:00</updated>
    <author>
      <name />
    </author>
    <summary type="html">&lt;p&gt;For Ruby projects (Rails or Sinatra), I've used HAML without SASS until they introduced SCSS. I did use SASS for a re-write project in 2009. But I felt that the syntax is strange and somehow I don't mind the braces. It's also easier to just copy CSS code onto a SCSS file. Of course some would say that I could just find and replace those braces, but ultimately it's a matter of choice. I love those braces so I use SCSS. :)&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;For Ruby projects (Rails or Sinatra), I've used HAML without SASS until they introduced SCSS. I did use SASS for a re-write project in 2009. But I felt that the syntax is strange and somehow I don't mind the braces. It's also easier to just copy CSS code onto a SCSS file. Of course some would say that I could just find and replace those braces, but ultimately it's a matter of choice. I love those braces so I use SCSS. :)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SCSS Mixins&lt;/strong&gt;&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;
@mixin corner($size) {
  -moz-border-radius: $size;
  -webkit-border-radius: $size;
  -khtml-border-radius: $size;
   border-radius: $size;
}
@mixin imr {
  cursor: pointer;
  text-indent: -9999px;
  display:block;
  border: 0 none;
}

@mixin left($dist) {
  float: left;
  margin-left: $dist;
}
&lt;/pre&gt;


&lt;p&gt;To use a mixin on an existing CSS class or ID, just use include.&lt;/p&gt;

&lt;pre class="brush: ruby"&gt;
#errorExplanation {border:1px solid red; padding:10px; @include corner(6px);}
&lt;/pre&gt;

&lt;img src="http://feeds.feedburner.com/~r/Bridgeutopia/~4/BCPzCFQKPf8" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://blog.bridgeutopiaweb.com/post/scss-mixins/</feedburner:origLink></entry>
</feed>

