Rip's Domain

RailsTutorial.org problems

Posted in Uncategorized by rip747 on June 2, 2012

below are some of the problems I’ve been having while following the railstutorial.org screencasts. These are in no particular order and may only pertain to my system, but I thought that I would document them here in case others run into them. Also, I’m going by the information that is provided in the screencasts themselves. During the screencasts, there are several time where the author refers to the online book in order to get the proper configuration. Most people are not going to take the time to search through the book to get the proper configuration to follow along in the screencasts. Hopefully this post will help people along when following the screencast and prevent them from having to refer to the book.

Lesson 1

when pushing to heroku, you will receive the following error:

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb
checking for sqlite3.h… no
sqlite3.h is missing. Try ‘port install sqlite3 +universal’
or ‘yum install sqlite-devel’ and check your shared library search path (the
location where your sqlite3 shared library is located).
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.

basically this means that heroku couldn’t compile the sqlite gem. You Gemfile should have the following in it if you’re following along:


source 'https://rubygems.org'

gem 'rails', '3.2.5'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

gem 'sqlite3'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
 gem 'sass-rails', '~> 3.2.3'
 gem 'coffee-rails', '~> 3.2.1'

# See https://github.com/sstephenson/execjs#readme for more supported runtimes
 # gem 'therubyracer', :platforms => :ruby

gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'

# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# To use Jbuilder templates for JSON
# gem 'jbuilder'

# Use unicorn as the app server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'debugger'

To fix, you need to make it so that the sqlite gem is not installed in production. to do this add change the `gem ‘sqlite3’` line in your Gemfile to the following:


gem 'sqlite3', :group => [:development, :test]

Lesson 3

When running the tests from with ruby you receive the error `/bin/sh: rspec: command not found` Basically this is cause because you having started SublimeText from the command line and don’t have `~/bin` in your path. To add `~/bin` to your path open up your .bash_profile file in an editor. WARNING! During the installation tutorial, you installed RVM so that you can manage your ruby installation. This causes a major problem because creating a `.bash_profile` to allow you to edit your path will cause rvm to break, which will result in rails to break. In order to prevent this, YOU MUST run the rvm script from within your `.bash_profile`. Below is a fixed path and script for your .bash_profile:

export PATH=/opt/local/bin:/opt/local/sbin:$HOME/bin:$PATH
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"

Depending on the installation of your system, your path could contain a bunch of stuff. Don’t worry what it looks like, just make sure you add `$HOME/bin` to the end. Now close and reopen the Terminal. Next follow the instructions here to link the `subl` executable to by issuing the following command in the Terminal window:

ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/subl

After that, you should be able to open SublimeText from a command prompt by doing `subl .`

subl .

Now when you run RubyTests it will be able to find rspec and work.

Lesson 10

The css for the micropost is located at Listing 10.24.

One Response

Subscribe to comments with RSS.

  1. edwardbeckett said, on August 31, 2012 at 8:03 pm

    Would using ~/.MacOSX/environment.plist work to pass $env to the apps … ?


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

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

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

%d bloggers like this: