iHack, therefore iBlog

February 15, 2008

Rails 2.0 on Leopard

Filed under: Software — Dr. Ernie @ 5:09 pm
Tags: , ,

I wanted to try out some of the new Ruby on Rails 2.0 features in Leopard, so I may as well blog my notes here for future reference.

1. Update Gems

Use this if you haven’t ugpraded your system to Rails 2.0 yet.


sudo gem update --system # Update "gems" itself
sudo gem install rails # not just update, since there's new components
sudo gem uninstall actionwebservice # Get rid of SOAP; REST rules!
sudo gem update # update everything else, to help Rails 2.0 compatibility
yes | sudo gem cleanup # Remove old versions
yes | sudo gem cleanup # Twice, because of dependencies
gem list

	actionmailer (2.0.2)
	actionpack (2.0.2)
	activerecord (2.0.2)
	activeresource (2.0.2)
	activesupport (2.0.2)...
	mongrel (1.1.3)...
	rails (2.0.2)
	rake (0.8.1)...
	sqlite3-ruby (1.2.1)
	...

2. Create Project

Create the Rails project, and make sure it and Mongrel work properly.


cd ~/Developer # where I keep all my Rails projects
rails miniblog # Create new Rails hierarchy
cd !$
open http://0.0.0.0:3000 && script/server # start server and launch Safari

	=> Booting Mongrel (use 'script/server webrick' to force WEBrick)
	=> Rails application starting on http://0.0.0.0:3000

	

3. Create Scaffold

Use [Command-T] to create a new Tab in Terminal, so the server can keep displaying output in original Tab.


cd ~/Developer/miniblog
script/generate scaffold article title:string content:text
open http://0.0.0.0:3000/articles # Will return error, since no tables

4. Add to Xcode Organizer

  • Launch Xcode
  • Click on Window -> Organizer (Ctrl-Command-O)
  • Drag ~/Developer/miniblog into Organizer window
  • Select “miniblog”
  • Under ‘Action’, choose “rake db:migrate”
  • open http://0.0.0.0:3000/articles
  • Advertisement

3 Comments »

  1. [...] February 20, 2008 [This is a follow-up to my Rails 2.0 demo] [...]

    Pingback by Basic Instruments.app Demo « iHack, therefore iBlog — February 20, 2008 @ 2:22 pm |

  2. [...] Rögtön itt a Rails: Rails 2.0 on Leopard « iHack, therefore iBlog: [...]

    Pingback by gaba feljegyzései: Rails, MySQL, egyebek Leopardra — April 14, 2008 @ 2:37 am |

  3. [...] pár dolgot rendbe kell tennem a naprakész fejlesztőkörnyezet érdekében.Rögtön itt a Rails: Rails 2.0 on Leopard « iHack, therefore iBlog:sudo gem update –system # Update 'gems' itself sudo gem install rails # not just update, since [...]

    Pingback by Rails, MySQL, git, egyebek Leopardra - Lenardgabor — August 17, 2009 @ 5:41 am |


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Please log in using one of these methods to post your comment:

Gravatar
WordPress.com Logo

Please log in to WordPress.com to post a comment to your blog.

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Theme: Rubric. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.