Learning Enough to be Dangerous – Go From Being a Novice to an Advanced Developer

current courses at Learn Enough to be Dangerous

While I think the venerable Ruby on Rails Tutorial is still the best way to learn Rails, jumping into this tutorial can be challenging for those who are new to programming.

With the fourth and latest beta of Rails 5 being released this past week, it is appropriate that Michael Hartl, the creator of the Rails Tutorial, has devised yet another tool to help new and experienced developers learn enough to make the most of it.

Appropriately, the title of this site is “Learn Enough to Be Dangerous”.

current courses at Learn Enough to be Dangerous

As of the end of April 2016, only three “Learn Enough” courses are available: Command Line, Text Editor, and Git. However, future courses including HTML, CSS & Layout, JavaScript, Ruby, Sinatra, and the Ruby on Rails Tutorial for Rails 5 are scheduled to be added.

The cost is $29 per month, the same as Code School (if you subscribe on a per-month basis to CS). Unlike CS, there is not yet a discounted yearly rate.

Since I’m excited to see the new Rails Tutorial as soon as it’s released, I’ve decided to sign up. Were it not for the access to this mammoth resource, I don’t know that I would pay this price – but considering that the Rails Tutorial with screencasts generally costs about $150 by itself, it seems like a reasonable deal. At any rate, I’ve come to expect only the highest quality learning materials from Dr. Hartl, so I am definitely looking forward to the upcoming classes.

Fix for “`require’: cannot load such file” Error

Ruby on Rails logo

While working through Chapter 3 of the RailsTutorial for Rails 4.0, I encountered an error when running the first integration test using RSpec.

Upon running the command:

bundle exec rspec spec/requests/static_pages_spec.rb


for the first time, I got the following error:

/Users/davidyoung/.rvm/gems/ruby-2.0.0-p451@railstutorial_rails_4_0/gems/selenium-webdriver-2.0.0/lib/selenium/webdriver/common/zipper.rb:1:in `require': cannot load such file -- zip/zip (LoadError)
	from /Users/davidyoung/.rvm/gems/ruby-2.0.0-p451@railstutorial_rails_4_0/gems/selenium-webdriver-2.0.0/lib/selenium/webdriver/common/zipper.rb:1:in `<top (required)>'
	from /Users/davidyoung/.rvm/gems/ruby-2.0.0-p451@railstutorial_rails_4_0/gems/selenium-webdriver-2.0.0/lib/selenium/webdriver/common.rb:9:in `require'
.
.
.

It appears this is caused by a bug in version 2.0.0 of the ‘selenium-webdriver’ gem. If you change the Gemfile line to use a newer version, this error goes away.

Gemfile:

source 'https://rubygems.org'
ruby '2.0.0'
#ruby-gemset=railstutorial_rails_4_0

gem 'rails', '4.0.0'

group :development, :test do
	gem 'sqlite3', '1.3.7'
	gem 'rspec-rails', '2.13.1'
end

group :test do
	gem 'selenium-webdriver', '~> 2.35.1'
	gem 'capybara', '2.1.0'
end

gem 'sass-rails', '~> 4.0.0'
gem 'uglifier', '2.1.1'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails', '2.2.1'
gem 'turbolinks', '1.1.1'
gem 'jbuilder', '1.0.2'

group :doc do
  gem 'sdoc', '0.3.20', require: false
end 

group :production do
	gem 'pg', '0.15.1'
	gem 'rails_12factor', '0.0.2'
end

Now when the command is run, I get the proper output:

F

Failures:

  1) Static pages Home page should have the content 'Sample App'
     Failure/Error: expect(page).to have_content('Sample App')
       expected #has_content?("Sample App") to return true, got false
     # ./spec/requests/static_pages_spec.rb:7:in `block (3 levels) in <top (required)>'

Finished in 0.86025 seconds
1 example, 1 failure

Failed examples:

rspec ./spec/requests/static_pages_spec.rb:5 # Static pages Home page should have the content 'Sample App'

Randomized with seed 48261

Michael Hartl’s Ruby on Rails 4.0 Tutorial

Ruby on Rails logo

Ruby on Rails, even eight years after its first release, is still recognized as one of the best frameworks for Web applications for many reasons, not the least of which are its cost (it’s free) and its scalability (sites as big as Twitter have used it).

Rails 4.0 was released last year, and soon after, Michael Hartl updated his famous Rails Tutorial.

For those wanting to learn RoR, the Rails Tutorial is (in my opinion) the best way to do it.

I’ve just begun working through the latest release of the tutorial, and have so far been pleased with the small number of typos and various errata that are common in technical instruction manuals.

One error I encountered with the default gemfile configuration file provided in the Rails Tutorial had to do with the versions of sass-rails and coffee-rails. The Tutorial suggests that you use (exactly) version ‘4.0.0’ for both of these gems, but I got an error like this:

Bundler could not find compatible versions for gem "railties":
  In Gemfile:
    rails (= 4.0.0) ruby depends on
      railties (= 4.0.0) ruby

    sass-rails (= 4.0.0) ruby depends on
      railties (4.1.0.rc1)

I set both of these gems to ‘~> 4.0.0’, and both bundle update and bundle install worked fine. My gemfile is below:

source 'https://rubygems.org'
ruby '2.0.0'
#ruby-gemset=railstutorial_rails_4_0

gem 'rails', '4.0.0'

group :development do
	gem 'sqlite3', '1.3.7'
end

group :production do
	gem 'pg', '0.15.1'
	gem 'rails_12factor', '0.0.2'
end

gem 'sass-rails', '~>; 4.0.0'
gem 'uglifier', '2.1.1'
gem 'coffee-rails', '~>; 4.0.0'
gem 'jquery-rails', '2.2.1'
gem 'turbolinks', '1.1.1'
gem 'jbuilder', '1.0.2'

group :doc do
  gem 'sdoc', '0.3.20', require: false
end