Skip to content

Instantly share code, notes, and snippets.

@yitzhakbg
yitzhakbg / spec_helper.rb
Created December 13, 2011 13:45
My spec_helper.rb
require 'rubygems'
require 'spork'
def start_simplecov
require 'simplecov'
SimpleCov.start 'rails' unless ENV["SKIP_COV"]
end
def spork?
defined?(Spork) && Spork.using_spork?
Here's the screen output (log output follows it, below):
NoMethodError in Surveyor#edit
Showing vendor/plugins/surveyor/app/views/partials/_question.html.haml where line #4 raised:
undefined method `id' for 0:Fixnum
Extracted source (around line #4):
@yitzhakbg
yitzhakbg / rake surveyor blows up with ruby 1.9.2
Created March 3, 2011 17:18
rake surveyor blows up with ruby 1.9.2
rake surveyor FILE=surveys/kitchen_sink_survey.rb
(in /home/ybg/Projects/tryme)
--- Parsing /home/ybg/Projects/tryme/surveys/kitchen_sink_survey.rb ---
rake aborted!
Anonymous modules have no name to be referenced by
/usr/lib/ruby/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:585:in `to_constant_name'
/usr/lib/ruby/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:391:in `qualified_name_for'
/usr/lib/ruby/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:104:in `rescue in const_missing'
/usr/lib/ruby/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:94:in `const_missing'
/usr/lib/ruby/gems/1.9.1/gems/surveyor-0.18.0/lib/tasks/surveyor_tasks.rake:10:in `block (2 levels) in <top (required)>'
(installed gems list below)
yitzhakbg@ybguntu:~/Projects$ rails -v
Rails 2.3.8
yitzhakbg@ybguntu:~/Projects$ rails nsurv
create
create app/controllers
create app/helpers
create app/models
create app/views/layouts
create config/environments
# Delete unnecessary files
run "rm README"
run "rm public/index.html"
run "rm public/favicon.ico"
run "rm public/robots.txt"
run "rm -f public/javascripts/*"
# rake "rails:freeze:edge"
# run "touch app/controllers/application.rb"
git :init
# Delete unnecessary files
run "rm README"
run "rm public/index.html"
run "rm public/favicon.ico"
run "rm public/robots.txt"
run "rm -f public/javascripts/*"
rake "rails:freeze:edge"
# run "touch app/controllers/application.rb"
git :init
load_template "/home/yitzhakbg/matal_template/base.rb"
name = ask("What do you want a user to be called?")
generate :nifty_authentication => " --haml --rspec #{name}"
rake "db:migrate"
git :add => ".", :commit => "-m 'adding authentication'"