♠ ♣ ♥ ♦

USPS Priority Mail® or USPS First-Class Mail® (under 1lb) for ALL US orders. Get you order in 2-3 days. All US shipping the same flat rate of $4.85 regardless of the size of the order. International orders responsible for any customs or added fees at destination. (more info...)

SUPPORT THIS SITE by visiting an advertiser or purchasing picks, books or my Midnight at the Jazz Cafe CD.

Ruby Tutorials Notes, Links and other Goodies

Ruby and Ruby on Rails tutorials and related goodies

Ruby Tutorials Notes, Links and other Goodies (tutorials.shtml) | Updated: 01-Jul-2008 - 23:54

Rails Minimum click to show or hide or section

The minimum that is required to get a Ruby on Rails site running on your local computer.

Ruby, Rails, and Leopard click here to hide or show section

The following should already be installed is running OS X 10.5 Leopard:

  • Ruby
  • Ruby gems
  • Ruby on Rails
  • SQLite3

In Leopard and Leopard Server, Ruby and Rails are pre-installed along with a bounty of other useful RubyGems. This means we can hit the ground running when it comes to developing a Rails application and keep up the pace when deploying new releases of our application to Leopard Server.

Out of the box, you get Ruby version 1.8.6 and Rails version 1.2.6, the latest stable releases at the time Leopard shipped. Ruby releases are few and far between (it's still at 1.8.6), but Rails has frequent new releases. In fact, the application we'll build requires Rails 2.0.2. The good news is it's easy to upgrade Rails and RubyGems. Make sure your system is up to date now by running these commands:

  • $ sudo gem update --system
  • $ sudo gem install rails
  • $ sudo gem update rake
  • $ sudo gem update sqlite3-ruby

The first command updates the RubyGems system itself, which is required by the latest version of Rails. The second command updates Rails-specific gems and installs any new components (specifically Active Resource). The third command updates Rake, the make-like build tool used by Rails. Finally, the last command updates the Ruby bindings for the SQLite3 database. Running all these commands may take a while. When it's finished, you can list all the installed gems by typing

$ gem list

Creating a New Rails Application click here to hide or show section

$rails todo
$cd todo
$rake db:create:all
$script/generate scaffold Todo title:string body:text done:boolean due:datetime
$rake db:migrate

Then start the web server

$script/server

Open your browser to http://localhost:3000/todos

Rails 2.0 and Scaffolding Step by Step by Sean Lynch click to show or hide or section

My travels in learning Ruby, Ruby on Rails on Mac OS X - Leopard 10.5

While working through a book on Ruby on Rails 1.2 you will have trouble getting something up and running as there have been changes in Rails 2.0. I did. So with the wonders of the web and fellow Ruby explorers that come before us one can track down what is need to get things going.

This is a multi-part tutorial covering enough to get a scaffolded Rails application up and running under Rails 2.0.

Based on Sean Lynch's tutorial at: fairleads: Rails 2.0 and Scaffolding Step by Step tutorial

Ruby, Rails, and Leopard click here to hide or show section

The following should already be installed is running OS X 10.5 Leopard:

  • Ruby
  • Ruby gems
  • Ruby on Rails
  • SQLite3

In Leopard and Leopard Server, Ruby and Rails are pre-installed along with a bounty of other useful RubyGems. This means we can hit the ground running when it comes to developing a Rails application and keep up the pace when deploying new releases of our application to Leopard Server.

Out of the box, you get Ruby version 1.8.6 and Rails version 1.2.6, the latest stable releases at the time Leopard shipped. Ruby releases are few and far between (it's still at 1.8.6), but Rails has frequent new releases. In fact, the application we'll build requires Rails 2.0.2. The good news is it's easy to upgrade Rails and RubyGems. Make sure your system is up to date now by running these commands:

  • $ sudo gem update --system
  • $ sudo gem install rails
  • $ sudo gem update rake
  • $ sudo gem update sqlite3-ruby

The first command updates the RubyGems system itself, which is required by the latest version of Rails. The second command updates Rails-specific gems and installs any new components (specifically Active Resource). The third command updates Rake, the make-like build tool used by Rails. Finally, the last command updates the Ruby bindings for the SQLite3 database. Running all these commands may take a while. When it's finished, you can list all the installed gems by typing

$ gem list

Creating a New Rails Application click here to hide or show section

$ rails exchange

Next, open the new project directory with TextMate by typing mate exchange or dragging the new project folder to the TextMate icon in the Finder or the Dock.

$ mate exchange
Highslide JS
TextMate project with controller application.rb in edit window
$ cd exchange
$ script/server exchange

Now point your web browser at http://localhost:3000

Highslide JS
Ruby on Rails - About your application’s environment

Creating a Database click here to hide or show section

The following database servers are currently supported by Rails: MySQL, PostgreSQL, SQLite (SQLite3 is the default), SQL Server, DB2, Firebird, and Oracle.

Highslide JS
TextMate project with db config/database.yml in edit window
$ rake db:create:all

db:create:all Create all the local databases defined in config/database.yml (above )

rake Command
  • db:charset Retrieves the charset for the current environment’s database
  • db:collation Retrieves the collation for the current environment’s database
  • db:create Create the database defined in config/database.yml for the current RAILS_ENV
  • db:create:all Create all the local databases defined in config/database.yml
  • db:drop Drops the database for the current RAILS_ENV
  • db:drop:all Drops all the local databases defined in config/database.yml
  • db:reset Drops and recreates the database from db/schema.rb for the current environment.
  • db:rollback Rolls the schema back to the previous version. Specify the number of steps with STEP=n
  • db:version Retrieves the current schema version number

script/generate scaffold post click here to hide or show section

$ script/generate scaffold Movie title:string description:text one_sheet_url:string

Rails 2.0 is REST (Representational State Transfer) by default. The usual suspects are created: Controller, Helper, Model, Migration, Unit Test, Functional Test

The scaffold command contains the database "Movie" and the columns that added. The columns can also be added by hand.

Highslide JS
TextMate project with db db/migrate/001_create_movies.rb in edit window

Database Migration click here to hide or show section

$ rake db:migrate
Curt:exchange curt$ rake db:migrate (in /Users/curt/dev/exchange) == 1 CreateMovies: migrating ================================================== -- create_table(:movies) -> 0.0021s == 1 CreateMovies: migrated (0.0022s) =========================================
<$ script/server exchange

Now point your web browser at http://localhost:3000/movies

Highslide JS
The results of: http://localhost:3000/movies in Safari
Highslide JS
Terminal window capture with successful web browser rendering

At this point you can follow part 1 of Sean Lynch's the tutorial at

Summary click here to hide or show section

  • $ rails exchange
  • $ rake db:create:all
  • $ ruby script/generate scaffold Movie title:string description:text one_sheet_url:string
  • $ rake db:migrate
  • $ ruby script/server
  • http://localhost:3000/movies

This was the first time I could get Rails 2.0 running on om my Mac. The only problem I had with the tutorial was in part 2 and the validates_format_of code. I was getting an error I can't figure out in the :with

Developing Rails Applications on Mac OS X Leopard click to show or hide or section

developer.apple.com tutorial wuing XCode 3.0

Ruby, Rails, and Leopard click here to hide or show section

The following should already be installed is running OS X 10.5 Leopard:

  • Ruby
  • Ruby gems
  • Ruby on Rails
  • SQLite3

In Leopard and Leopard Server, Ruby and Rails are pre-installed along with a bounty of other useful RubyGems. This means we can hit the ground running when it comes to developing a Rails application and keep up the pace when deploying new releases of our application to Leopard Server.

Out of the box, you get Ruby version 1.8.6 and Rails version 1.2.6, the latest stable releases at the time Leopard shipped. Ruby releases are few and far between (it's still at 1.8.6), but Rails has frequent new releases. In fact, the application we'll build requires Rails 2.0.2. The good news is it's easy to upgrade Rails and RubyGems. Make sure your system is up to date now by running these commands:

  • $ sudo gem update --system
  • $ sudo gem install rails
  • $ sudo gem update rake
  • $ sudo gem update sqlite3-ruby

The first command updates the RubyGems system itself, which is required by the latest version of Rails. The second command updates Rails-specific gems and installs any new components (specifically Active Resource). The third command updates Rake, the make-like build tool used by Rails. Finally, the last command updates the Ruby bindings for the SQLite3 database. Running all these commands may take a while. When it's finished, you can list all the installed gems by typing

$ gem list

Creating a New Rails Application click here to hide or show section

Based on the Apple Developer's tutorial Developing Rails Applications on Mac OS X Leopard

$ rails expenses

Highslide JS
XCode Organizer with controller application.rb in edit window

Add a s shell script for script/server as a Top Level Organizer Item to the expenses folder. Or, using the Terminal application start the server $ script/server

Now point Safari at http://localhost:3000. You should see a web page welcoming you aboard Rails.

Creating a Database click here to hide or show section

The following database servers are currently supported by Rails: MySQL, PostgreSQL, SQLite (SQLite3 is the default), SQL Server, DB2, Firebird, and Oracle.

Highslide JS
TextMate project with db config/database.yml in edit window
$ rake db:create:all

db:create:all Create all the local databases defined in config/database.yml (above )

rake Command
  • db:charset Retrieves the charset for the current environment’s database
  • db:collation Retrieves the collation for the current environment’s database
  • db:create Create the database defined in config/database.yml for the current RAILS_ENV
  • db:create:all Create all the local databases defined in config/database.yml
  • db:drop Drops the database for the current RAILS_ENV
  • db:drop:all Drops all the local databases defined in config/database.yml
  • db:reset Drops and recreates the database from db/schema.rb for the current environment.
  • db:rollback Rolls the schema back to the previous version. Specify the number of steps with STEP=n
  • db:version Retrieves the current schema version number

Event Scaffold click here to hide or show section

$ cd expenses $ script/generate scaffold event name:string budget:decimal

Rails 2.0 is REST (Representational State Transfer) by default. The usual suspects are created: Controller, Helper, Model, Migration, Unit Test, Functional Test

The scaffold command contains the database "event" and the columns that added. The columns can also be added by hand.

Database Migration click here to hide or show section

$ rake db:migrate

Rails applications use Rake (Ruby's equivalent of Make) to automate recurring tasks such as applying migrations. We could run rake db:migrate from a Terminal command line, but again the Organizer makes this easier. All the Rake tasks are already available as pre-configured actions.

Highslide JS
Results of the action in terminal window
<$ script/server

Now point your web browser at http://localhost:3000/events

Vendor Scaffold click here to hide or show section

$ script/generate scaffold vendor name:string email:string
$ db:migrate

Expenses Resource click here to hide or show section

$ script/generate resource expense event_id:integer vendor_id:integer amount:decimal
$ db:migrate

Declare the associations in the models as follows:

class Expense < ActiveRecord::Base
  belongs_to :event
  belongs_to :vendor
end
class Event < ActiveRecord::Base
  validates_presence_of :name
  validates_numericality_of :budget, :greater_than => 0.0

  has_many :expenses
  has_many :vendors, :through => :expenses
end
class Vendor < ActiveRecord::Base
  has_many :expenses
  has_many :events, :through => :expenses
end

Online Orders & shipping Information

Secure Online Ordering and Fast Shipping

We have been getting our products to our customers using online ordering since 2000. In all of that time (and across the hundreds of orders processed) our customers have not had one instance of credit card difficulties due to online ordering.

Our online orders are fully encrypted and our e-commerce site is directly provided by ccNow, a secure online retailer. The security technology is state of the art and your credit card information is transmitted only once.

All products are in stock and will normally be shipped out to you on the next business day.

PriorityMail_env.jpg All orders purchased here at CurtSheller.com, JazzGuitarResources.com, UkuleleResources.com UkuleleChords.net and UkuleleForGuitarPlayers.com are processed using a secure shopping cart system and shipped within 48 hours USPS. Allow 7 to 10 business days for delivery. It is not our intention to profit from shipping and handling charges. The rates are an average cost, and intended to cover expenses only. Please do not ask how long it will takes to get your order. All US orders are shipped USPS Priority Mail® or USPS First-Class Mail® (under 1lb) and delivery dates are not predictable. I do not check on an order not received until three weeks have elapsed since it was shipped. Three weeks is not how long it takes to get your order. Rather, it is how long it takes to convince us that something is wrong. Some orders are returned by the USPS and we have to wait to see if that has happened before any action is taken. Thanks, Curt Sheller Publications.

Goods and services provided by Curt Sheller Publications (PA, United States) and sold by ccNow.com.

Other items purchased through Amazon.com and SheetMusicPlus.com are shipped by Amazon.com and SheetMusicPlus.com.

BOOKS AUTHORED BY CURT SHELLER ARE NOT AVAILABLE ON AMAZON.COM

Close Move
Main Site Navigation Menu

The main site menu is divided into a few sections such as the online store, instrument specific information, online lessons, miscellaneous goodies, contact info and site information.

With over 300 pages of content the various sections and pages within each can be visited using the tabbed interface.

Tabbed section navigation

Each major section on the Curt Sheller Publication web site has additional pages of content that can be visited using the tabs at the top of the page directly above the page title.

Page Sub Sections

Most page sections can be expanded and collapsed. Allowing you to focus on specific content.

All page sections have go to top of page , go to contents and help buttons for quick page navigation.


Popup Views

Indicated as a gray border around an image. Additional information and larger views of samples pages, PDF files and book covers can be viewed in popup windows.

PDF file images and book covers can be viewed larger in a popup view by clickin on the actual image.