Archive

Posts Tagged ‘rails’

Mention In Advanced Rails Recipes

February 11th, 2009

advanced_rails_recipes_p443_snippetProps to OpenRain’r Marc Chung for having the action_mailer_tls Rails plugin featured in Advanced Rails Recipes: Snack Recipe 47, Send E-mail via Gmail.

Note that the official plugin is now on github. We would have continued to maintain the URL that went to print, but no one told us we’d be in the book!

  • Share/Bookmark

preston.lee General Announcements, Technologies , , , ,

Test-Driven Rails Development Lunch Session Tomorrow

October 7th, 2008

Elite OpenRain ninja Remi Taylor will be presenting his approach to test-driven Rails development tomorrow afternoon at 1:30pm at OpenRain HQ. That’s Wednesday, October 8th for approximately 1 hour. All are welcome. No reservations required. Forecast: 99 degrees with a 90% chance of awesome.

You can grab the latest presentation file here. Remi’s synopsis…

Read more…

  • Share/Bookmark

preston.lee Events, Technologies , , , , , , ,

ABLEconf 2008 Slides

September 22nd, 2008

Thanks for being a great audience! Here are the slides from both hours…

Getting Started With Ruby on Rails: [Keynote] [PDF]

Ruby on Rails Deployment & Hosting: [Keynote] [PDF]

  • Share/Bookmark

preston.lee Community, Technologies , , , , , , , ,

Ruby/Rails Training Now 40% Cheaper!

September 19th, 2008

New on-site Ruby/Rails training rates are now available, here, and they’re better than ever! These rate reductions mean OpenRain training is..

  1. Cheaper than sending a team to RailsConf.
  2. In the comfort of your own office.
  3. Supplemented by addressing the specific needs of your company.
  4. Able to flow into a development agreement if you would benefit from additional assistance.

We realize many companies are transitioning to Ruby with experienced Java and .Net staff, and are thrilled to offer this service at lower rates. With the shocking Spring framework maintenance policy change, there’s never been a better time to go Ruby!

  • Share/Bookmark

preston.lee General Announcements , , , , ,

Getting Started With Rails: 2008.09.27

September 15th, 2008

Getting Started With Rails evening tutorial workshop with Preston Lee.
Joe Developer at OpenRain HQ
Wednesday, September 27th, 2008. 6pm.
Light dinner provided.

This event is for developers new to or otherwise interested in web development using Ruby on Rails. Laptops encouraged. WiFi provided. See you there!

  • Share/Bookmark

preston.lee Uncategorized , , , , , , ,

Sister Partnership With Railsware

August 28th, 2008

OpenRain is a U.S. company with U.S. staff. The value of direct, barrier-free, native-language communication outweighs any perceived cost savings of outsourcing our niche, not to mention it’s a lot more fun to work in the same office and time zone. For a typical 3-month project with 2 developers, it’s not uncommon in an outsourced environment to need a full-time project manager on both client and developer sides just to manage tasks, meetings, legal, logistical issues etc.; an unnecessary cost which alone has increased the bill 50%. By keeping operations local, we’re able to remain far more agile in a far lighter development environment.

Nevertheless, we periodically talk to a potential client who is dead set on outsourcing work to “save money”. While we’ll respectfully disagree with you, we’ll kindly connect your business to a new sister shop located in the Ukraine who exclusively focuses on outsourcing, something which OpenRain doesn’t do. Both OpenRain and Railsware focus on Ruby development for U.S. companies, and are pleased to announce this partnership so we may jointly work towards building a bigger, better Ruby development industry as a whole. We’d love to have you in it!

  • Share/Bookmark

preston.lee Uncategorized , , , , ,

Setup Ruby and Rails on OSX

August 20th, 2008

Welcome to the first of many posts in the OpenRain Tips and Notes series. We’re going to use this space to share some of the tips, tricks, howto guides, and notes, that we use internally to keep us productive and make us happier programmers.

Today, we’re going to learn how to get your brand new shiny Mac OS X machine setup for Ruby and Ruby on Rails development.  When we’re done, the full software stack will include Ruby 1.8.7, Rails 2.1.0, MySQL 5.0.51, and Mongrel 1.1.5.

And, who might you be? A programmer, comfortable at the command line, running on Mac (Leopard, 10.5.4), and interested in Ruby and Rails.

Preamble

Setting up a complete Ruby on Rails environment for local development can be overwhelming, especially if you’re new to it, but even if you’re done it before. Depending on your level of comfortability, there several ways you can setup Ruby and Rails on OS X from scratch, so please keep in mind that this guide is one of several “right” ways to do this.

The most “right” way to setup Ruby, Rails, MySQL, and Mongrel on your Mac

Xcode and MacPorts

Download and install a copy of the Xcode Developer Tools DVD image from Apple’s Apple Developer Connection.  Membership to ADC is free and highly encouraged if you’re doing any sort of software development for the Mac.  It’s a good source for all your Apple programming activities. [Download > Developer tools > Xcode 3.1 Developer DVD (Disk Image)].

Download and install a copy of MacPorts.   Since Mac OS X is a descendent of Unix, you can download, compile, and install all sorts of existing Unix software on your Mac.  However, doing this manually becomes tiring almost immediately since you have to manage versions, dependencies, and conflicts all by yourself. The MacPort system is a convenient tool for managing the life-cycle of source-based installations.  Any software that MacPorts installs, is kept separate from the software that comes with your Mac.

Update your environment variables

Once MacPort has been properly installed, modify your $PATH and $MANPATH environment variables with the location that MacPorts installs all it’s software in.

For example, in ~/.bash_profile:

export PATH=~/bin:/opt/local/bin:/opt/local/sbin:$PATH
export MANPATH=/opt/local/share/man:$MANPATH

Ruby, ruby, ruby

The good news is that, on Leopard (OS.X 10.5.4), Ruby is an officially supported language.  Out of the box, this includes:

  • the warm fuzzy feeling of Ruby running on OS X
  • the ability to debug Ruby processes with dtrace
  • integration with Cocoa via the RubyCocoa bindings, and
  • using Ruby to control and message OS X applications via the AppleEvent infrastructure

The bad news is that updates don’t flow as fast from Apple so, for instance, running the latest version of Ruby, (1.8.7 as of this writing) isn’t possible unless you roll your own Ruby and RubyGems environment.

To install Ruby and RubyGems from the command line:

$ sudo port install ruby
$ sudo port install rb-rubygems

RubyGems for Rails and everything else

Once you’ve got RubyGems installed, setting up the rest of your system is easy to do from the command line:

$ sudo gem install rails rake capistrano capistrano-ext libxml-ruby mongrel hpricot

This installs Rails, as well as a bunch of other useful gems into:

/opt/local/lib/ruby/gems/1.8/gems

Install MySQL (Option 1: via MacPort)

There are two options for installing MySQL. Option 1 continues to use MacPort while option 2, a little further down the page, uses the binary installer. Either option works well.

$ sudo port install mysql5 +server
$ sudo -u mysql mysql_install_db5
$ ln -s /opt/local/share/mysql5/mysql/mysql.server ~/bin/mysql.server

The first and second command installs and setups MySQL5 via MacPort. The third command sets up a convenient helper script which you can use to start and stop MySQL server from the command line:

$ sudo mysql.server {start|stop|restart|reload|force-reload|status}

Optionally, you can configure MySQL to start up automatically when OS X boots.

sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist

Install the native MySQL driver

Out of the box, Rails comes with a pure-Ruby MySQL adapter, though all production Rails environments running on MySQL will use the native binary drivers since they are considerable faster. To get the native MySQL drivers from the command line:

sudo gem install mysql -- --with-mysql-config=/opt/local/bin/mysql_config5

Install MySQL (Option 2: via the binary distribution from mysql.com)

One alternative to installing MySQL from MacPort is to install the binary distribution from mysql.com.

Download and install the DMG.

Optionally, you can install the System Preferences panel and a startup script which starts MySQL up along with OS X.

Install the native MySQL driver

Similarly, you’ll also need to configure the MySQL RubyGem driver

$ sudo gem install mysql -- --with-mysql-dir=/usr/local/mysql --with-mysql-include=/usr/local/mysql/include/ --with-mysql-lib=/usr/local/mysql/lib/ --with-mysql-config=/usr/local/mysql/bin/mysql_config

Fin

That wasn’t too bad. If you followed the directions correctly, your shiny new Mac should be properly setup with Ruby 1.8.7 and Rails 2.1.0 running on MySQL 5.0. For performance purposes we also installed Mongrel and the MySQL native drivers which are automatically used by Rails during development.

A super secret cheat sheet:

Install Xcode 3.1
Install MacPort 1.600
sudo port install ruby
sudo port install rb-rubygems
sudo gem install rake rails capistrano capistrano-ext libxml-ruby mongrel hpricot
sudo port install mysql5 +server
sudo -u mysql mysql_install_db5
sudo gem install mysql -- --with-mysql-config=/opt/local/bin/mysql_config5

  • Share/Bookmark

marc.chung Uncategorized , , , , , ,

OpenRain F/OSS Rails Plugin Repository

July 16th, 2008

We do Rails, and we’ve been keeping a secret from you.

You can grab some of the tools we maintain for our own production Rails apps for free. Now, we’re not going to give you all our marbles, but there’s nothing quite sweeter than commercially-funded Open Source software, especially when it’s written in Ruby, and by people that do it for a living. Add the following URL to your plugin repository list like so..

script/plugin source http://code.openrain.com/rails/

I’d recommend checking out OpenRain Power Tools first for a slew of tiny wins. We’ll be providing examples of how to use this stuff, so stay tuned!

  • Share/Bookmark

preston.lee Uncategorized , , , , , , , , , ,