This is just a mini post about my experience with Hartl's exercises, but using Ruby 1.9.3-p194, rvm, Rails 4.0.0 to build the micro-post blogging engine.
Really, in summation, there were a few tricks that made this experience more painful than necessary.
I should also mention that due to other client work, I'm now on Xcode5 DP3. This is only relevant for the time being. Once iOS7 is out of beta and Xcode5 is RC, then maybe the command line tools will work better. For now, the nokogiri gem refused to install, and that's because the libxml2 and libxlts gems refused to install because something in the gcc from Xcode5 DP3 did not like playing well. That said, I could not run capybara or webrat to utilize have_selector("attribute", "value") in any of my rspec's. It was rather unfortunate, but kept me on my toes.
Basically, my gemfile (after the jump), has a couple of gems commented out b/c of the aforementioned Xcode differences. I did not use webrat (or capybara) or annotate-models. I did use PostgreSQL, which I found easier to manipulate, and though it required some config changes, allowed me to deploy to Heroku with no problems. Because of Heroku, and resetting the db, I had to put the faker gem in the normal list, and not development, b/c Heroku tried to use Faker for resetting the db :(
The one gem I did not anticipate ever having to add was the protected_attributes. Rails 4 removed the mass assignment of attributes for security, and there is plenty of good reason for it (just google 'rails protected_attributes, or 'rails 4 attr_accessible'). To follow Hartl's Rails 3 example in Rails 4, I used the protected_attributes and devise gems.
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0'
# Faker for dev and heroku
# Strong protection
gem 'devise', '3.0.0.rc'
# Use postgres as the database for Active Record
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.2'
group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', require: false
# Use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# Use unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
group :development do
group :test do
# gem 'capistrano', group: :development
# Use debugger
# gem 'debugger', group: [:development, :test]