Building Ruby, Rails, LightTPD, and MySQL on Tiger



Similar documents
SIMIAN systems. Setting up a Sitellite development environment on Mac OS X. Sitellite Content Management System

Signiant Agent installation

Team Foundation Server 2012 Installation Guide

RecoveryVault Express Client User Manual

Backing Up TestTrack Native Project Databases

Getting Started with Dynamic Web Sites

Install and configure Apache, MySQL, PHP on OSX 10.8 Mountain Lion

Online Backup Linux Client User Manual

Online Backup Client User Manual

Using a login script for deployment of Kaspersky Network Agent to Mac OS X clients

EVault for Data Protection Manager. Course 361 Protecting Linux and UNIX with EVault

Student installation of TinyOS

AlienVault Unified Security Management (USM) 4.x-5.x. Deploying HIDS Agents to Linux Hosts

Installing Ruby on Rails in Linux

Apache Hadoop 2.0 Installation and Single Node Cluster Configuration on Ubuntu A guide to install and setup Single-Node Apache Hadoop 2.

Packaging for Distribution

Upgrade Guide BES12. Version 12.1

Installing Ruby on Windows XP

1. Product Information

Online Backup Client User Manual Linux

insync Installation Guide

Archive Attender Version 3.5

LedgerSMB on Mac OS X An Installation Guide

Installing Java 5.0 and Eclipse on Mac OS X

Server & Workstation Installation of Client Profiles for Windows

Adafruit's Raspberry Pi Lesson 7. Remote Control with VNC

Computer Science and Engineering MacOS Cisco VPN Client Installation and Setup Guide

Export & Backup Guide

Online Backup Client User Manual

Getting Started using the SQuirreL SQL Client

Team Foundation Server 2010, Visual Studio Ultimate 2010, Team Build 2010, & Lab Management Beta 2 Installation Guide

CEFNS Web Hosting a Guide for CS212

Backing up with Windows 7

Microsoft SQL Server Installation Guide

Freshservice Discovery Probe User Guide

Team Foundation Server 2013 Installation Guide

How to make a VPN connection to our servers from Windows XP

SSH and Basic Commands

Server Installation/Upgrade Guide

Computer Science and Engineering Linux Cisco VPN Client Installation and Setup Guide

Installing Bacula Client on Mac OS X Server

SIMIAN systems. Setting up a Sitellite development environment on Windows. Sitellite Content Management System

BarTender Version Upgrades. Best practices for updating your BarTender installation WHITE PAPER

Mac System Setup Guide (Pre-Class)

Installation Guidelines (MySQL database & Archivists Toolkit client)

AWS Schema Conversion Tool. User Guide Version 1.0

Pete Helgren Ruby On Rails on i

Microsoft Outlook 2007 to Mozilla Thunderbird and Novell Evolution Conversion Guide

Creating Home Directories for Windows and Macintosh Computers

MySQL Backups: From strategy to Implementation

Setting Up a CLucene and PostgreSQL Federation

Upgrading MySQL from 32-bit to 64-bit

Sophos Anti-Virus for Mac OS X: Home Edition Help

HowTo. Planning table online

Installing (1.8.7) 9/2/ Installing jgrasp

Cassandra Installation over Ubuntu 1. Installing VMware player:

How to Setup and Connect to an FTP Server Using FileZilla. Part I: Setting up the server

Log Analyzer Reference

Configure Outlook 2013 to connect to Hosted Exchange

How to Install SQL Server 2008

Installing Booked scheduler on CentOS 6.5

Online Backup Client User Manual

Using Karel with Eclipse

Keystone 600N5 SERVER and STAND-ALONE INSTALLATION INSTRUCTIONS

Installation and Deployment

EVault Software. Course 361 Protecting Linux and UNIX with EVault

Q1. What are the differences between Data Backup, System Restore, Disk Image, System Recovery Disc and System Repair Disk?

Ruby on Rails. Matt Dees

How to Create and Send a Froogle Data Feed

IBM WebSphere Application Server Version 7.0

Kollaborate Server Installation Guide!! 1. Kollaborate Server! Installation Guide!

Table of Contents. FleetSoft Installation Guide

Server & Workstation Installation of Client Profiles for Windows (WAN Edition)

Creating a DUO MFA Service in AWS

Installing TeamCall Server on Mac OS X

CPE111 COMPUTER EXPLORATION

QuickDNS 4.6 Installation Instructions

Installing OptiRain Open on Macintosh OS X 10.6 (Snow Leopard)

Upgrade ProTracker Advantage Access database to a SQL database

Code::Blocks Student Manual

Other documents in this series are available at: servernotes.wazmac.com

Interlink Networks Secure.XS and Cisco Wireless Deployment Guide

Version Control with Subversion and Xcode

OpenGeo Suite for Linux Release 3.0

Wazza s QuickStart 13. Leopard Server - Windows Domain

Content Management System

Enterprise SSL Support

Installation of PHP, MariaDB, and Apache

Microsoft SQL Server Installation Guide

Setting up a local working copy with SVN, MAMP and rsync. Agentic

Sophos Anti-Virus for Mac OS X Help

Adept Backup Solution - Storegrid Apple Mac OS X Client Setup. Supported Apple Mac OS X Operating Systems

Sophos Anti-Virus for Mac OS X Help

How To Upgrade Your Microsoft SQL Server for Accounting CS Version

Q N X S O F T W A R E D E V E L O P M E N T P L A T F O R M v Steps to Developing a QNX Program Quickstart Guide

enter the administrator user name and password for that domain.

Using Windows Task Scheduler instead of the Backup Express Scheduler

Embedded Based Web Server for CMS and Automation System

Transcription:

Home Archives Tags Links About Projects Contact Feeds Building Ruby, Rails, LightTPD, and MySQL on Tiger Technology Web Design Development Mac OS X Ruby on Rails 12.01.05-09:22 PM Gold Ruby Earring Shop for great deals on and... www.monstermarketplace.com Hotels.com - Save on Hotel... Reserve your room in... hotels.com Ads by Yahoo! What follows are updated instructions for manually building and installing Ruby, Ruby on Rails, MySQL, and LightTPD on Mac OS X 10.4 (Tiger). Compiling and installing these tools this way is well worth the effort, as the end result delivers an easyto-upgrade, system-independent, stand-alone development platform that is impervious to potential problems that can be caused by system updates, operating system upgrades, etc. These issues and additional background information about why one might roll their own tools in this fashion is detailed in the article, Using /usr/local/, which could be considered a prerequisite for this task. The Concept Basically, what we re going to do here is download a bunch of open-source tools (some of which rely upon each other to work), configure them, compile them, and install them, one by one, until we have everything we need for a Mac OS X machine to run pretty much any Ruby on Rails application. What s Needed A few things are needed to get this going: 1. Mac OS X 10.4 (Tiger) 2. Xcode 2.0 or newer (ideally 2.1) 3. Willingness to type commands into the Terminal application exactly as they appear here 4. A tasty beverage to enjoy while things compile A Quick Warning While it s unlikely anything we do here might do any kind of damage to the system, it s good advice to Page 1 of 6

have a current backup of everything, just in case. The Narrator doesn t take any responsibility for anything that results from following these instructions. We re following these instructions at our own risk. Setting Up Open the Terminal application. It can be found in the /Applications/Utilities folder. Each of the lines below appearing in monospaced type should be entered into Terminal, and be followed by the Return key. But everybody knew that already. Create a folder to contain all of the downloaded files and their respective build folders. For these examples, we ll create a folder called src in the root of our home folder, and change directories into that folder. It will be our workspace: mkdir src cd src It doesn t really matter where this folder actually lives. We ve created it in the home folder, but it could be on the Desktop, or in /usr/local/src for example. All operations should take place there. You ll download and compile everything from right here. Paths We need to sure that our path is set to look for files in /usr/local (also the place where we ll be installing the tools) before looking anywhere else. To see if the path has been set properly, we can check the contents of the.bash_login file a special, hidden file in the root of our home folder for a PATH line using a text editor. TextMate, TextWrangler, BBEdit, and vi are all perfectly good options. To open the file with TextMate, for example, we can type: mate ~/.bash_login This will open the file if it already exists, or open a blank file if it doesn t. In either case, add the following line at the very end of the file: export PATH="/usr/local/bin:/usr/local/sbin:$PATH" Now save and close the file. To sure the changes are picked up correctly, we now need to execute the file with the following command:. ~/.bash_login It s likely there will be no response from the shell here, just the prompt, but that s OK, the changes have been picked up and we re ready to move on. Ruby We re ready to start the process. Just type (or cut and paste) each one of the following lines into Page 2 of 6

Terminal, one by one. When one line finishes (some will take a while and dump a lot of information to the screen), enter the next one. The first time we run the sudo command, and possible again later, we may be prompted for a password. We ll just enter our own password here, and the process will continue. We ll start by installing Readline, a prerequisite for Ruby on OS X systems: curl -O ftp://ftp.gnu.org/gnu/readline/readline-5.0.tar.gz tar xzvf readline-5.0.tar.gz cd readline-5.0./configure --prefix=/usr/local sed -e 's/-dynamic/-dynamiclib/' shlib/makefile > shlib/makefile.new mv shlib/makefile.new shlib/makefile Next up, we ll download and install Ruby itself: curl -O ftp://ftp.ruby-lang.org/pub/ruby/ruby-1.8.2.tar.gz tar xzvf ruby-1.8.2.tar.gz cd ruby-1.8.2./configure --prefix=/usr/local --with-readline-dir=/usr/local RubyGems RubyGems is a handy command-line tool for managing the installation of Ruby packages, like Rails. curl -O http://rubyforge.org/frs/download.php/3700/rubygems-0.8.10.tgz tar xzvf rubygems-0.8.10.tgz cd rubygems-0.8.10 sudo /usr/local/bin/ruby setup.rb Ruby on Rails With RubyGems installed, Rails is a simple, one-line install: sudo gem install rails --include-dependencies It s possible that we may see an RDoc failure error here. The error is actually nothing to worry about. Just re-run the command above, or don t. Things should be fine either way. Really. FastCGI FastCGI is an extension to CGI (Ruby on Rails is essentially a collection of CGI scripts) that provides high performance without the limitations of server specific APIs. Don t worry if that doesn t perfect sense. Just so long as it s installed on the system: curl -O http://www.fastcgi.com/dist/fcgi-2.4.0.tar.gz tar xzvf fcgi-2.4.0.tar.gz Page 3 of 6

cd fcgi-2.4.0./configure --prefix=/usr/local We ll also need to add the Ruby-FastCGI bindings curl -O http://sugi.nemui.org/pub/ruby/fcgi/ruby-fcgi-0.8.6.tar.gz tar xzvf ruby-fcgi-0.8.6.tar.gz cd ruby-fcgi-0.8.6 /usr/local/bin/ruby install.rb config --prefix=/usr/local /usr/local/bin/ruby install.rb setup sudo /usr/local/bin/ruby install.rb install We re almost done with FastCGI. We just need the Ruby-FCGI Gem another nice one-line installation: sudo gem install fcgi LightTPD LightTPD is an open-source webserver designed with security, speed, compliance, and flexibility in mind. It s great for serving up Rails applications, and Rails 0.14 and newer is already setup to use it if it s on the system. But before we can compile it, we need to build its prerequisite, the PCRE library, a set of functions that implement regular expression pattern matching using the same syntax and semantics as Perl 5: curl -O ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-6.4.tar.gz tar xzvf pcre-6.4.tar.gz cd pcre-6.4./configure --prefix=/usr/local With PCRE installed, we re ready to move on to LightTPD: curl -O http://lighttpd.net/download/lighttpd-1.4.8.tar.gz tar xzvf lighttpd-1.4.8.tar.gz cd lighttpd-1.4.8./configure --prefix=/usr/local --with-pcre=/usr/local MySQL While it s possible to compile and install MySQL ourselves, using the OS X MySQL package is actually advantageous. Not only is the install much faster and easier, but the package includes a handy startup item and a preference panel, and the binary is tuned by the MySQL team for OS X. Even better, the package installs MySQL right into the /usr/local/ folder, just like it should. Page 4 of 6

The install still requires a few steps: 1. Download the MySQL 4.1 package for OS X 2. Double-click the drive image to mount it 3. Locate the MySQL installer (a file named mysql-standard-4.1.15-apple-darwin8.2.0- powerpc.pkg) and run it, authenticating as needed 4. Double-click MySQLStartupItem.pkg, authenticate, and let it install 5. Double-click MySQL.prefPane and install it, deciding whether to it available to just the current user, or for all system users Once the install is complete, start the MySQL server using the newly-installed control panel. Note: MySQL installs with a default user of root which has no password. Please read this page about MySQL usernames and passwords and set a good one. MySQL Native Bindings (Optional) This step is an optional one, but the performance gains seem to it worth the extra step. Thanks to RubyGems, it s another one-line install: sudo gem install mysql -- --with-mysql-dir=/usr/local/mysql We re Done Phew! It s over. We now have a properly located installation of Ruby, Ruby on Rails, MySQL, and LightTPD. So what s the hold-up? Start writing those Web 2.0 applications already! More recent articles» Photostream via flickr.com Links & News Dr. Moreau's Pet Mouse 12.13.05-01:14 PM Permalink Only the most foolish of mice wouldn't want human embryonic stem cells injected into their brains. Polo 10-Pack Page 5 of 6

12.12.05-05:31 PM Permalink Polo is definitive (and required) Hivelogic attire. And now, at long last, 10-packs of the classic-fit shirts are available. A Ruby/Rails/Lighttpd/MySQL Tiger Script 12.11.05-06:55 PM Permalink My friend Geoffrey has converted the Building Ruby, Rails, LightTPD, and MySQL on Tiger article into a handy shell script. More links» Copyright 2005 Dan Benjamin. Contact The Narrator. Hosted by TextDrive. Don't steal this content.» Blogs that link here Page 6 of 6