Ruby on Rails Tutorial News

Rails Tutorial print edition and a reward for railstutorial.org reviews

Summary: The Ruby on Rails Tutorial print edition is out. Please leave a review at Amazon, and get a bonus reward for leaving a review at railstutorial.org.

Greetings, all! I’ve got a bunch of exciting Rails Tutorial–related announcements planned for the coming months, but first I’ve got one that’s long overdue: the Ruby on Rails Tutorial print edition is out, and currently available at Amazon.com. It’s actually been out for a while, but the first print run at Amazon sold out fast, and I didn’t want to send an announcement until they’d restocked the supplies. That bottleneck has now been cleared, so anyone who wants a print version of the book should head to Amazon and pick up a copy. (The content is essentially the same as the version available via railstutorial.org, but a lot of people like owning a physical copy as well.)

To help keep up sales momentum, I hope you’ll take the time to leave a couple of reviews. The steps are simple:

  1. Leave a review at railstutorial.org. (This requires a Softcover account, which has your email address, which in turn is how I’ll know where to send the free command-line tutorial. If you bought the 3rd edition from railstutorial.org, you already have a Softcover account; otherwise, you will probably have to make one.)
  2. Leave a review at Amazon (no purchase necessary; can be based on electronic version from railstutorial.org)

I have a special reward for those who complete Step 1, which is a free copy of Learn Enough™ Command Line to Be Dangerous, an upcoming tutorial on the Unix command line. (I’d appreciate it if you completed Step 2 as well, but leaving an Amazon review is not necessary to get the reward.) There is no need to take further action once you leave a review at railstutorial.org; as long as your email address there is correct, you will automatically receive a copy of the command-line product when it’s ready. Thanks!

Cheers,

Michael

P.S. Rails 5 is slated to come out in the fall or winter (though no one knows exactly when). To answer the inevitable question: yes, I’m planning to update the Rails Tutorial accordingly. (Because the Rails Tutorial is designed to teach web development generally rather than Rails specifically, any changes will be aimed at compatibility rather than at covering new features.) Whether the upgrade is free or a paid supplement depends on how extensive the changes are; I’m cautiously optimistic I’ll be able to get away with minor updates, but there’s no way to know until Rails 5 actually ships. I’ll plan to send out an announcement with more details when the time comes.

P.P.S. Get the Ruby on Rails Tutorial print edition and/or leave a review to get a free copy of Learn Enough™ Command Line to Be Dangerous!

Launch of the Ruby on Rails Tutorial screencasts (3rd edition)

tl;dr: The 3rd Edition of the Ruby on Rails Tutorial screencast series is now available. Designed to complement the book Ruby on Rails Tutorial: Learn Web Development with Rails, the Rails Tutorial screencast series consists of 12 lessons (one for each chapter of the book), totaling more than 15 hours of HD video. A teaser trailer and a full sample lesson are also available. As part of the launch, you can get 20% off all Rails Tutorial products through the end of this week (Friday, December 5).

Discuss this post at Hacker News

I’m pleased to announce the launch of the 3rd Edition of the Ruby on Rails Tutorial screencasts. The new screencasts have been recorded from scratch and are designed to get you started with professional-grade Ruby on Rails web development as fast as possible. Based on the Ruby on Rails Tutorial book, the 3rd edition screencasts should be especially useful for Rails Tutorial readers who want to see exactly how to develop (or at least how I develop) Ruby on Rails web apps.

The 3rd edition of the Ruby on Rails Tutorial screencast series has been extensively revised from previous versions. Here are some of the changes:

  1. Use of a standard integrated development environment in the cloud, with a pre-configured workspace specifically tailored to the needs of the Ruby on Rails Tutorial. Use of the custom Cloud9 IDE environment allows you to see exactly how to follow every step of the Rails Tutorial using the same development environment shown in the screencasts.

  2. 100% default stack. The 3rd edition of the Ruby on Rails Tutorial screencasts uses the default Rails choices for all relevant technologies, thereby substantially reducing the configuration necessary to get started.

  3. Lighter-weight testing approach. The 3rd edition still covers test-driven development (TDD), but uses it more sparingly and judiciously. The more forbidding “wall of tests” sections have been eliminated, with concise and expressive integration tests (usually written after the application code) taking their place.

  4. A fully revised lesson on login and authentication. The newly revised Lesson 8 covers all three of the most common login models on the Web: session expiration upon browser close, automatically remembering users, and optionally remembering users with a “remember me” checkbox.

  5. An all-new section on image upload. Lesson 11 now shows how to add pictures to the Twitter-style “microposts” developed in the tutorial’s main sample application. Topics include client- and server-side image validations, automatic image resizing, and using a cloud storage service (Amazon S3) in production.

  6. An all-new lesson on account activation and password resets, including sending email with Rails. The all-new Lesson 10 considerably extends the core sample application by adding account activation (thereby verifying the account’s email address) and allowing users to reset forgotten passwords. In the process, the chapter covers how to send email with Rails, both in development (using the server log) and in production (using SendGrid).

Each lesson in the screencast series corresponds to a chapter in the book, which appear as follows (links are to the online version of the book, which as always is available for free):

As a reminder, you can get a 20% discount on any purchase through the end of the week (Friday, December 5).

The Rails Tutorial and Heroku Cedar-14

UPDATE: Due to continuing annoyance, I’ve determined that, in the case of the Rails Tutorial, the costs of specifying a particular version of Ruby in the Gemfile don’t justify the benefits. The Ruby on Rails Tutorial book has been updated accordingly. As a result, there is no need to follow the steps below to install a new version of Ruby.

This is a quick update for users of the 3rd Edition of the Ruby on Rails Tutorial , especially those deploying to Heroku from the Cloud9 IDE, but it’s potentially useful to anyone deploying Ruby apps to Heroku. Heroku’s recently announced Cedar-14 stack is incompatible with all but the most recent version of each Ruby sequence, meaning (for example) that it works with Ruby 2.1.4 but not with 2.1.3. Unfortunately, this makes it incompatible with the local Ruby versions on many systems, including Cloud9’s default, which as of this writing is Ruby 2.1.1. In such cases, Heroku deployments to the new stack won’t work. Here are the kinds of errors you might see:

1
2
3
local/Cloud9 => Your Ruby version is 2.1.1, but your Gemfile specified 2.1.4

Heroku => Only the most recent version of Ruby 2.1 is supported on Cedar-14

For the benefit of Rails Tutorial readers, I’ve gotten in touch with Cloud9 support and expect that they will eventually be able to change the default Ruby version for Rails Tutorial workspaces. UPDATE: This has now happened, so new workspaces will get Ruby 2.1.4 automatically, but existing workspaces will still have to be updated manually. You can do this with the Ruby Version Manager as follows:

1
2
3
$ rvm install 2.1.4
<get a beverage of your choice and wait a while>
$ rvm use 2.1.4

Then change your Gemfile to use the line ruby '2.1.4' and re-deploy:

1
2
3
<update Gemfile>
$ git commit -am "Update Ruby version"
$ git push heroku

You may also have to restart any Rails servers, consoles, or Spring servers (spring stop) in order to get them to use the new version of Ruby.

By the way, if you’re using rbenv on a local machine (as I am) and need to upgrade to the latest Ruby version, here are the steps you might follow:

1
2
3
$ cd ~/.rbenv/plugins/ruby-build/
$ git pull
$ rbenv install 2.1.4

Launch of the 3rd Edition of the Ruby on Rails Tutorial book

tl;dr: The 3rd Edition of the Ruby on Rails Tutorial book is out, together with early access to the screencasts (currently in preparation). Click here to get an automatic 10% discount on any purchase through the end of October.

I’m pleased to announce the launch of the 3rd Edition of the Ruby on Rails Tutorial book, together with early access to the screencasts (which are currently in preparation). Here are the main product bundles:

As a special launch offer, you can click here to get an automatic 10% discount on any purchase through the end of October.

The full screencast series included with every screencasts purchase, including the completed lessons (currently Lessons 1–4) and immediate access to new lessons as I finish them. I hope to finish the full twelve-lesson screencast series by the end of November.

The 3rd edition of the Ruby on Rails Tutorial has been extensively revised from previous versions. Here are some of the changes:

  1. Use of a standard integrated development environment in the cloud, with a pre-configured workspace specifically tailored to the needs of the Ruby on Rails Tutorial. Use of the custom Cloud9 IDE environment eliminates the installation and configuration overhead encountered in previous editions, while also providing the text editor, terminal window, and filesystem navigation necessary to complete the book’s three example applications.

  2. 100% default stack. The 3rd edition of the Ruby on Rails Tutorial uses the default Rails choices for all relevant technologies, thereby substantially reducing the configuration necessary to get started. The excellent but syntactically heavy RSpec testing framework has been replaced with the default Rails testing stack (MiniTest), making for a much gentler introduction to testing than in previous editions.

  3. Lighter-weight testing approach. The 3rd edition still covers test-driven development (TDD), but uses it more sparingly and judiciously. The more forbidding “wall of tests” sections have been eliminated, with concise and expressive integration tests (usually written after the application code) taking their place.

  4. A completely rewritten chapter on login and authentication. The newly revised Chapter 8 covers all three of the most common login models on the Web: session expiration upon browser close, automatically remembering users, and optionally remembering users with a “remember me” checkbox.
  5. An all-new section on image upload. Chapter 11 now shows how to add pictures to the Twitter-style “microposts” developed in the tutorial’s main sample application. Topics include client- and server-side image validations, automatic image resizing, and using a cloud storage service (Amazon S3) in production.
  6. An all-new chapter on account activation and password resets, including sending email with Rails. The all-new Chapter 10 considerably extends the core sample application by adding account activation (thereby verifying the account’s email address) and allowing users to reset forgotten passwords. In the process, the chapter covers how to send email with Rails, both in development (using the server log) and in production (using SendGrid).

The final chapter list appears as follows (links are to the online version of the book, which as always is available for free):

As a reminder, you can click here to get an automatic 10% discount on any purchase through the end of October.

Discuss this post at Hacker News

Full draft of the Rails Tutorial 3rd Ed.

Drafts of Chapters 9–12 from the Ruby on Rails Tutorial (3rd Ed.) are now available:

Chapters 9, 11, and 12 have been extensively revised for the 3rd edition, and Chapter 10 is completely new. With this release, the 3rd edition draft is now available in its entirety; see the main 3rd edition announcement post for more details, and sign up here for priority notifications and an exclusive coupon code.

I hope to launch ebooks sales of the 3rd edition within a few weeks. All current customers will get upgrade discounts, with especially generous discounts for those who made recent purchases.

Drafts of Chapters 5–8 from the Rails Tutorial 3rd Ed.

Drafts of Chapters 5–8 from the Ruby on Rails Tutorial (3rd Ed.) are now available:

All four of these chapters has been extensively revised, and the last has been almost completely rewritten. It now includes all three of the most common login models (temporary sessions, automatic persistent sessions, and optional persistent sessions with a “remember me” checkbox). See the main 3rd edition announcement post for more details, and sign up here for priority notifications and an exclusive coupon code.

Draft chapters of the Ruby on Rails Tutorial (3rd Ed.)

tl;dr: Draft chapters of the 3rd edition of the Ruby on Rails Tutorial are now available. I believe it’s the best edition yet. Sign up here for priority notifications and an exclusive coupon code.

In the past few years, the Ruby on Rails Tutorial book has become one of the leading introductions to web development. Both the 1st and 2nd editions have found broad audiences, and now I’m pleased to offer draft chapters of the 3rd edition, called Ruby on Rails Tutorial: Learn Web Development with Rails. For reasons detailed below, I believe it’s the best edition yet. A draft of the full manuscript is currently available:

The 3rd edition of the Ruby on Rails Tutorial will follow the same basic model as previous editions: a free online version, with ebooks and screencasts available for purchase. I also plan to produce a solutions manual for the book’s exercises, which will probably be included with one or more product bundles.

Perhaps the most surprising feature of the 3rd edition is that it is simultaneously easier and more advanced than previous editions. Whereas previous editions required readers to climb (sometimes unavoidable) brick walls, the 3rd edition is more like a ramp: smoothly increasing in difficulty, but ultimately reaching a greater height than before.

Here are the main factors that make the 3rd edition easier:

  1. Use of a standard integrated development environment in the cloud, with a pre-configured workspace specifically tailored to the needs of the Ruby on Rails Tutorial. Use of the custom Cloud9 IDE environment eliminates the installation and configuration overhead encountered in previous editions, while also providing the text editor, terminal window, and filesystem navigation necessary to complete the book’s three example applications.

  2. 100% default stack. The 3rd edition of the Ruby on Rails Tutorial uses the default Rails choices for all relevant technologies, thereby substantially reducing the configuration necessary to get started. The excellent but syntactically heavy RSpec testing framework has been replaced with the default Rails testing stack (MiniTest), making for a much gentler introduction to testing than in previous editions.

  3. Lighter-weight testing approach. The 3rd edition still covers test-driven development (TDD), but uses it more sparingly and judiciously. The more forbidding “wall of tests” sections have been eliminated, with concise and expressive integration tests (usually written after the application code) taking their place.

  4. Less emphasis on version-specific features. Rather than trying to incorporate mini-tutorials on new features for each version of Rails, the 3rd edition focuses on the most general principles of web development. This means that, although the tutorial does use the most recent Rails release, this fact is incidental, and it is not tightly coupled to the details of any particular version.

  5. Highlighted lines and red/green indicators. By making use of features of the underlying Softcover self-publishing platform, the 3rd edition of the Ruby on Rails Tutorial now includes highlighted lines in many code samples, allowing readers to see at a glance which parts of the code are most important. In addition, many code listings now include explicit labels indicating whether the test suite should be passing or failing at that point in the tutorial, thereby orienting the reader and making the exposition much easier to follow. (See Listing 3.12 for an example.)

Meanwhile, these are the main factors that make the 3rd edition more advanced:

  1. A completely rewritten chapter on login and authentication. The newly revised Chapter 8 covers all three of the most common login models on the Web: session expiration upon browser close, automatically remembering users, and optionally remembering users with a “remember me” checkbox.
  2. An all-new section on image upload. Chapter 11 now shows how to add pictures to the Twitter-style “microposts” developed in the tutorial’s main sample application. Topics include client- and server-side image validations, automatic image resizing, and using a cloud storage service (Amazon S3) in production.
  3. An all-new chapter on account activation and password resets, including sending email with Rails. The all-new Chapter 10 considerably extends the core sample application by adding account activation (thereby verifying the account’s email address) and allowing users to reset forgotten passwords. In the process, the chapter covers how to send email with Rails, both in development (using the server log) and in production (using SendGrid).

I’m more excited about the 3rd edition of the Ruby on Rails Tutorial than about any previous version. As reflected the new subtitle, Learn Web Development with Rails, I believe that the Ruby on Rails Tutorial constitutes not only a solid introduction to Rails, but also a thorough general introduction to web development. It wouldn’t be nearly as good as it is, though, without the contributions of hundreds (perhaps thousands) of readers who have taken the time to write in with bug & typo reports and other suggestions. As with previous editions, I thus look forward to getting feedback on the draft chapters of the 3rd edition of the Ruby on Rails Tutorial. And don’t forget to sign up here for priority notifications and an exclusive coupon code.

Softcover – A publishing platform based on the Rails Tutorial

When I published the first four chapters of the Ruby on Rails Tutorial in 2009, it represented an experiment: would it be possible to give away a book for free online while still making a successful product business? The answer, happily, turned out to be yes. I have been pleased at how many people have been able to use the free online version of the Ruby on Rails Tutorial book to learn web development. At the same time, right from the beginning sales of the Rails Tutorial ebooks and screencast videos have made it profitable as well. It’s been deeply gratifying to be able to play a role in lowering the financial barrier to acquiring such a valuable skill as web development while still building a sustainable business.

Now, I’m pleased to announce Softcover, a publishing platform based on the Rails Tutorial production system and business model. Using Softcover, authors can build multi-format ebooks (HTML, EPUB, MOBI, and PDF) from common source files, optionally bundle them with media like screencast videos, and publish them to Softcover’s integrated sales platform with a single command. Of course, Softcover also outputs an HTML version of each book—which, as with the Rails Tutorial, authors can (optionally) make available for free online.

To see what a full product on Softcover looks like, check out Conquering the Command Line, a book and screencast series on Linux and Unix commands by author Mark Bates, which (like the Rails Tutorial) includes a free online version. In addition, there is already a version of the Rails Tutorial book that builds on Softcover, and in the coming weeks I plan to move the full tutorial over to the Softcover platform (taking care to preserve things like legacy download links). Watch for an announcement once the change-over is complete.

My hope is that Softcover will help allow many other authors to replicate the success of the Ruby on Rails Tutorial. If you’re interested in using Softcover yourself, you can learn a little more about it on the Softcover home page. Then sign up for an account and follow the instructions on the start page.

Japanese translation of the Rails Tutorial

I’m pleased to announce the availability of a translation of the Ruby on Rails Tutorial to Japanese, the native language of Ruby creator Yukihiro “Matz” Matsumoto. I’ve had the pleasure of meeting Matz and several other Japanese Ruby developers over the years, and they’ve always impressed me both with their technical brilliance and their friendliness. I consider it a great honor that Yohei Yasukawa, Shozo Hatta, and their fellow contributors have chosen to translate the Rails Tutorial to Japanese, and I thank them for their excellent work.

As with the English version of the Rails Tutorial, the Japanese translation is available for free online as HTML; with my blessing, the Japanese translators are also offering ebook sales of the translation, the proceeds of which go to support their efforts. If you are a Japanese speaker, please check it out!

Rails Tutorial updated for Rails 4.0.1

I’ve just updated the Ruby on Rails Tutorial book for the newest Rails release, Rails 4.0.1. If you’re updating your sample_app to Rails 4.0.1, you’ll need to change rails to 4.0.1 and bcrypt-ruby to 3.1.2, as seen in the reference sample app Gemfile:

1
2
3
4
5
6
7
8
9
10
source 'https://rubygems.org'
ruby '2.0.0'
#ruby-gemset=railstutorial_rails_4_0

gem 'rails', '4.0.1'
gem 'bootstrap-sass', '2.3.2.0'
gem 'bcrypt-ruby', '3.1.2'
.
.
.

Then run

1
2
3
4
bundle install
bundle update
bundle install
rspec spec/

(I’m actually not sure if both calls to bundle install are necessary, but they can’t hurt.)

As far as I can tell, there are no changes between Rails 4.0.0 and 4.0.1 that affect the Rails Tutorial, but please let me know if you run into any issues.