Upate Ruby Gems on Mac OS X 10.5 Article
This nice article describes how to update Ruby Gems on Mac OS X Leopard 10.5:
This nice article describes how to update Ruby Gems on Mac OS X Leopard 10.5:
Git Cloning and Git Forking differences are described in this article
Cloning is to make a copy of a remote repository into your local development environment.
Forking is to clone an entire remote repository into another remote repository.
I thought this article about setting up a new Rails app with Git provided a good way to think about Git repositories:
Git repository’s are a-dime-a-dozen. There’s no such thing as a working copy, everything’s just a git repository containing copies of other git repositories. When you develop locally you’re committing to a local git repository, stored in the .git directory of your project.
This article guides you through the process of creating a Ruby on Rails application using Passenger Phusion (mod_rails) on a Mac OS X Leopard. The article assumes that both Rails and MySQL have already been installed.
Here are the 11 steps to get a Passenger Phusion based Rails app going:
System Preferences >> Sharing
Uncheck Web Sharing
$ gem install passenger
$ passenger-install-apache2-module
edit /etc/apache2/httpd-conf and add the following three lines:
LoadModule passenger_module /Library/Ruby/Gems/1.8/gems/passenger-2.0.6/ext/apache2/mod_passenger.so
PassengerRoot /Library/Ruby/Gems/1.8/gems/passenger-2.0.6
PassengerRuby /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
This step allows us to access a local Wordpress blog from http://wp.local
Edit /etc/hosts and add the following line:
127.0.0.1 railstestapp.local
Edit /etc/apache2/extra/httpd-vhosts.conf
<VirtualHost *:80>
ServerAdmin webmaster@railstestapp.local
DocumentRoot "/Users/user/Sites/railstestapp/public"
RailsEnv development
ServerName railstestapp.local
ServerAlias *.railstestapp.local
ErrorLog "/private/var/log/apache2/railstestapp.local-error_log"
CustomLog "/private/var/log/apache2/railstestapp.local-access_log" common
</VirtualHost>
The RailsEnv development line is required to run the Rails app in development mode. Also, note that the document root is the public directory.
System Preferences >> Sharing
Uncheck Web Sharing
$cd /Users/user/Sites
$rails railstestapp
Edit your database.yml file in your Rails app so it looks like this:
development:
adapter: mysql
database: railstestapp_development
username: root
password: password
socket: /tmp/mysql.sock
test:
adapter: mysql
database: railstestapp_test
username: root
password: password
socket: /tmp/mysql.sock
production:
adapter: mysql
encoding: utf8
database: railstestapp_production
username: root
password: password
socket: /var/run/mysqld/mysqld.sock
rake db:create
ruby script/generate scaffold Post title:string body:string
http://railstestapp.local/posts
The following article gave me the clue on how to set the Rails app in development mode:
http://benr75.com/2008/04/12/setup-mod_rails-phusion-mac-os-x-leopard
Installing Passenger Phusion instructions at: http://www.modrails.com/install.html
This post shows you how to install Wordpress 2.7 on a Mac OS X Leopard. The post assumes that MySQL and PHP have already been installed. Here are the six steps to get Wordpress installed on your Mac, so you can tweak a theme or create some widgets and plugins:
$ mysql -u root -p
Enter Password: {ROOTPASS}
> create database wordpress;
> grant all privileges on wordpress.* to wpuser@localhost identified by 'password';
> quit
Change the password in the grant command to whatever you want the password to be.
- Download and Wordpress from here: http://wordpress.org/latest.zip
- Move the Wordpress zip file (wordpress-2.7.1.zip) to /Users/user/Sites
- Unzip the zip file in /User/user/Sites
You should see a Wordpress folder now in /Users/user/Sites
cd /Users/user/Sites/Wordpress
cp wp-config-sample.php wp-config.php
edit wp-config.php and set the following configuration variables:
define('DB_NAME', 'wordpress'); // The name of the database
define('DB_USER', 'wpuser'); // Your MySQL username
define('DB_PASSWORD', 'password'); // …and password
define('DB_HOST', '127.0.0.1');
Note: I needed to change “host” to 127.0.0.1 to get Wordpress to connect to my MySQL database.
This step allows us to access a local Wordpress blog from http://wp.local
Edit /etc/hosts and add the following line:
127.0.0.1 wp.local
Edit /etc/apache2/extra/httpd-vhosts.conf
<VirtualHost *:80>
ServerAdmin webmaster@wp.local
DocumentRoot "/Users/tdewell/Sites/wordpress"
ServerName wp.local
ServerAlias *.wp.local
ErrorLog "/private/var/log/apache2/wp.local-error_log"
CustomLog "/private/var/log/apache2/wp.local-access_log" common
</VirtualHost>
Click:
System Preferences >> Sharing
uncheck and then check again the Web Share checkbox:

http://wp.local/wp-admin/install.php
Make sure you save the admin password somewhere.
http://wp.local/wp-admin
This post is mostly based on this article:
Leopard How To Install Wordpress
I’ve modified the instructions to allow multiple projects and websites in the /Users/user/Sites folder.
I hope this article was of some benefit to you!
I already had MySQL installed and up and running on my Mac for developing Rails apps. I installed MySQL using MacPorts using the
following instructions.
I got phpMyAdmin working with these instructions. Make sure you do the following steps from the article just listed to be able to login to your MySQL database with phpMyAdmin
Open the file config.sample.inc.php and enter a random string to the following line, afterwards you should rename the file to config.inc.php.
$cfg['blowfish_secret'] = ”; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
Look for:
$cfg['Servers'][$i]['host'] = ‘localhost’;
change it to:
$cfg['Servers'][$i]['host'] = ‘127.0.0.1′;
I had a little bit of trouble getting the layout of sbhsdonsbaseball.com working with Internet Explorer.
In the image below you will see the photos lined up vertically instead of horizontally as they should be.

Here is the original HTML markup for the photo block:
<div class="photoBlock"> <ul> <li class="even"><a href="" /><img src="images/photoBlock-1.jpg" alt="Photo"/></a></li> <li class="odd"><a href="" /><img src="images/photoBlock-2.jpg" alt="photo"/></a></li> <li class="even"><a href="" /><img src="images/photoBlock-3.jpg" alt="photo"/></a></li> <li class="odd"><a href="" /><img src="images/photoBlock-4.jpg" alt="photo"/></a></li> <li class="even"><a href="" /><img src="images/photoBlock-5.jpg" alt="photo"/></a></li> <li class="odd"><img src="images/photoBlock-6.jpg" alt="photo"></img></li> </ul> </div>
Here is the original CSS for the photo block:
.photoBlock { overflow: hidden; border-bottom: 3px solid #B69E65;}
.photoBlock ul { overflow: hidden; }
.photoBlock ul li { display:table-cell; height:230px; text-align:center; vertical-align:middle; width:160px;}
.photoBlock ul li.even { background: #000; }
.photoBlock ul li.odd { background: #FFF;}
/* HACK below got rid of background in li */
.photoBlock ul li img {margin: 0 0 -3px 0; }
To get the images to line up horizontally, the HTML markup was simplified:
<div class="photoBlock"> <img src="images/photoBlock-1.jpg" alt="Photo"/> <img src="images/photoBlock-2.jpg" alt="photo"/> <img src="images/photoBlock-3.jpg" alt="photo"/> <img src="images/photoBlock-4.jpg" alt="photo"/> <img src="images/photoBlock-5.jpg" alt="photo"/> <img src="images/photoBlock-6.jpg" alt="photo"/> </div>
We also changed the CSS to support the new markup:
.photoBlock { overflow: hidden; border-bottom: 3px solid #B69E65;}
.photoBlock img{margin:-3px -3px -3px 0;}
For some as of yet unknown reason, images had margin between them, so negative margin was added to the top, right and bottom sides of the images. The result is shown below:
Like I said in the last post, there will be lost of experimentation, so now I am trying the Fresh Theme from Ilemoned.
It’s bright and cheerful and fresh.
Themes from Woo Themes seem to be the best I’ve found so far. I’m sure that over the next few days you might see might see me experiment with a bunch of different themes.