I installed clearance and followed the last steps which were "rails generate clearance:install". However rails server does not start up for me when I try to open in terminal.
/Users/lexi87/areyoutaken/config/initializers/clearance.rb:4:in `block in <top (required)>': uninitialized constant Clearance::PasswordStrategies::BCrypt (NameError)
from /Users/lexi87/.rvm/gems/ruby-1.9.3-p374/gems/clearance-0.16.3/lib/clearance/configuration.rb:36:in `configure'
from /Users/lexi87/areyoutaken/config/initializers/clearance.rb:1:in `<top (required)>'
from /Users/lexi87/.rvm/gems/ruby-1.9.3-p374/gems/railties-3.2.12/lib/rails/engine.rb:588:in `block (2 levels) in <class:Engine>'
Here's my Gemfile and I have bcrypt gem inside.
source 'https://rubygems.org'
gem 'rails', '3.2.12'
gem 'bootstrap-sass', '2.1'
gem 'bcrypt-ruby', '3.0.1'
gem 'faker', '1.0.1'
gem 'will_paginate', '3.0.3'
gem 'bootstrap-will_paginate', '0.0.6'
gem 'jquery-rails', '2.0.2'
gem 'annotate', '2.5.0'
gem 'clearance'
group :development, :test do
gem 'sqlite3', '1.3.5'
gem 'rspec-rails', '2.11.0'
gem 'guard-rspec', '1.2.1'
gem 'guard-spork', '1.4.2'
gem 'spork', '0.9.2'
gem 'rb-fsevent', '~> 0.9.1'
end
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '3.2.5'
gem 'coffee-rails', '3.2.2'
gem 'uglifier', '1.2.3'
end
group :test do
gem 'capybara', '1.1.2'
gem 'factory_girl_rails', '4.1.0'
gem 'cucumber-rails', '1.2.1', :require => false
gem 'database_cleaner', '0.7.0'
# gem 'launchy', '2.1.0'
# gem 'rb-fsevent', '0.9.1', :require => false
gem 'growl', '1.0.3'
end
group :production do
gem 'pg', '0.12.2'
end
Any help would be greatly appreciated.
You appear to be running gem version 0.16.3 of clearance, which doesn't support the Clearance::PasswordStrategies::BCrypt password strategy. If you upgrade to v1.0.0.rc1 or higher than that should work.
The only supported password strategies in 0.16.3 are Clearance::PasswordStrategies::Blowfish and Clearance::PasswordStrategies::SHA1.
If you want to try a version that supports BCrypt, you can update your Gemfile to say:
gem 'clearance', :git => "git://github.com/thoughtbot/clearance.git", :tag => "v1.0.0.rc4"
That will pull a specific tag of that repository. You can leave off the :tag to grab the latest version from GitHub. Keep in mind, that it may not be as stable as 0.16.3.
Related
In updating dependencies, I have come across updating sprockets. However there doe not appear to be a proper dependency for my set of gems. After returning to: 2.11.3, the erorr apepars:
/Users/..../rvm/gems/ruby-2.3.0/gems/bootstrap-sass-3.3.6/lib/bootstrap-sass/engine.rb:11:in `block in <class:Engine>': uninitialized constant Sprockets::Rails::VERSION (NameError)
Gemfile:
source 'http://rubygems.org'
ruby '2.3.0' # '1.9.3'
#ruby-gemset=railstutorial_rails_4_0
gem 'rails', '4.2.6'
#gem 'pg', '0.15.1'
gem 'mysql2', '0.4.4'
gem 'bootstrap-sass', '3.3.6'
gem 'bcrypt', '3.1.11'
gem 'faker', '1.1.2'
gem 'will_paginate', '3.1.0'
gem 'bootstrap-will_paginate', '0.0.10'
gem 'geocoder', '1.3.7'
gem 'nested_form', '0.3.2'
gem 'utf8-cleaner', '0.2.4'
gem 'sprockets', '3.6.0' #2.11.3
gem 'json', '1.8.3'
gem 'ffi'
gem 'iconv', '1.0.4'
gem 'chosen-rails', '1.5.2'
gem 'compass-rails', github: 'Compass/compass-rails'
# For image uploads
gem 'carrierwave', '0.11.2'
# For uploading CSV
gem 'roo', '2.4.0'
# DataTables
gem 'jquery-datatables-rails', '3.4.0' # git: 'git://github.com/rweng/jquery-datatables-rails.git'
gem 'jquery-ui-rails', '5.0.5'
# Editing in line:
gem 'best_in_place', '3.1.0'
# Passing data from controller to coffeescript
gem 'gon', '6.0.1'
#gem 'jquery-turbolinks' '2.1.0'
# For searching and webservice queries-NO LONGER USED
#gem 'sunspot_rails', '2.1.0'
#gem 'sunspot_solr', '2.1.0'
gem 'progress_bar', '1.0.5'
gem 'responders', '2.2.0'
# Calendar Date and Validation
gem 'bootstrap-datepicker-rails'
# For Google Maps overlays
gem 'gmaps4rails', '~> 2.1.2'
gem 'underscore-rails', '~> 1.8.3'
group :development, :test do
gem 'rspec-rails', '3.4.2'
gem 'guard-rspec', '4.7.2'
gem 'spork-rails', '4.0.0'
gem 'childprocess', '0.5.9'
gem 'guard-spork', '2.1.0'
end
group :test do
gem 'selenium-webdriver', '2.53.3'
gem 'capybara', '2.7.1'
gem 'factory_girl_rails', '4.7.0'
end
gem 'sass-rails', '4.0.1'
gem 'uglifier', '3.0.0'
gem 'coffee-rails', '4.1.1'
gem 'jquery-rails', '4.1.1'
gem 'turbolinks', '2.5.3'
gem 'jbuilder', '2.5.0'
group :doc do
gem 'sdoc', '0.4.1', require: false
end
gem 'rails_12factor', '0.0.3'
How can I make this work?
You can fix this problem following steps:
First, you run gem update to update your gems.
And sprockets-rails should be at version 3.0.4
Second, open your Gemfile.lock in your rails project, modify the following line to update sprocket version
sprockets-rails (3.0.4)
Finally, you run bundle install
Above one is the answer,
You can fix this problem following steps:
First, you run gem update to update your gems.
And sprockets-rails should be at version 3.0.4
Second, open your Gemfile.lock in your rails project, modify the following line to update sprocket version
sprockets-rails (3.0.4)
Finally, you run bundle install
Since I isntalled better_errors gem I can't start my server using command rails server. I have tried adding lines into my development.rb like BetterErrors::Middleware.allow_ip! "0.0.0.0/0" or BetterErrors::Middleware.allow_ip! ENV['TRUSTED_IP'] if ENV['TRUSTED_IP'] but it didn't work.
This is my error message when I try to start server:
/home/jakub/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/better_errors-2.1.1/lib/better_errors/exception_extension.rb:6:in `caller_locations': stack level too deep (SystemStackError)
from /home/jakub/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/better_errors-2.1.1/lib/better_errors/exception_extension.rb:6:in `set_backtrace'
from /home/jakub/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/web-console-2.0.0.beta3/lib/web_console/exception_extension.rb:15:in `call'
from /home/jakub/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/web-console-2.0.0.beta3/lib/web_console/exception_extension.rb:15:in `block in <class:Exception>'
from /home/jakub/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/better_errors-2.1.1/lib/better_errors/exception_extension.rb:10:in `set_backtrace'
from /home/jakub/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/web-console-2.0.0.beta3/lib/web_console/exception_extension.rb:15:in `call'
from /home/jakub/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/web-console-2.0.0.beta3/lib/web_console/exception_extension.rb:15:in `block in <class:Exception>'
from /home/jakub/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/better_errors-2.1.1/lib/better_errors/exception_extension.rb:10:in `set_backtrace'
from /home/jakub/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/web-console-2.0.0.beta3/lib/web_console/exception_extension.rb:15:in `call'
... 5885 levels...
from /home/jakub/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
And my gemfile:
source 'https://rubygems.org'
gem 'rails', '4.2.2'
gem 'bcrypt', '3.1.7'
gem "paperclip",
git: "git://github.com/thoughtbot/paperclip.git"
gem 'faker', '1.4.2'
gem 'will_paginate', '3.0.7'
gem 'bootstrap-will_paginate', '0.0.10'
gem 'sass-rails', '5.0.2'
gem 'uglifier', '2.5.3'
gem 'coffee-rails', '4.1.0'
gem 'jquery-rails', '4.0.3'
gem 'turbolinks', '2.3.0'
gem 'jbuilder', '2.2.3'
gem 'sdoc', '0.4.0', group: :doc
group :development, :test do
gem 'better_errors', '~> 2.1.1'
gem 'sqlite3', '1.3.9'
gem 'byebug', '3.4.0'
gem 'web-console', '2.0.0.beta3'
gem 'spring', '1.1.3'
end
group :test do
gem 'minitest-reporters', '1.0.5'
gem 'mini_backtrace', '0.1.3'
gem 'guard-minitest', '2.3.1'
end
group :production do
gem 'pg', '0.17.1'
gem 'rails_12factor', '0.0.2'
end
This is an active issue on github since 2014. One workaround seems to be to move gem 'better_errors' out of the development and testing groups from your Gemfile.
You can also start to restart spring manually which might resolve your problem:
cd /your/project
spring stop
...
spring start
...
In your Gemfile:
source 'https://rubygems.org'
gem 'rails', '4.2.2'
gem 'bcrypt', '3.1.7'
gem "paperclip",
git: "git://github.com/thoughtbot/paperclip.git"
gem 'better_errors', '~> 2.1.1'
group :development, :test do
# ...
end
Other things you could try:
Remove your Gemfile.lock, keep your Gemfile as is and rerun bundle install. Make sure rails s is not run while doing that.
Remove better_errors version from you Gemfile
We are upgrading our Rails app from 4.1 to 4.2.
While this code works great in 4.0 and 4.1:
admin_root_url(:subdomain => 'www')
When I try it on 4.2.3 I get this error:
ArgumentError: wrong number of arguments (3 for 1..2)
I checked it several time in console, running this code:
include Rails.application.routes.url_helpers
default_url_options[:host] = "localhost"
root_url
Our Gemfile looks like this:
source 'https://rubygems.org'
ruby "2.1.2"
gem 'rails', '4.2.4'
gem 'rake', "~> 10.2.2"
group :development do
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Generates model and controller UML diagrams
gem 'railroady'
gem 'bullet'
gem 'web-console', '~> 2.0'
end
group :staging, :production do
gem 'pg'
gem 'rails_12factor'
gem 'newrelic_rpm'
end
gem 'sass-rails', '~> 4.0.0'
gem 'less-rails-bootstrap'
gem 'uglifier', '>= 1.3.0'
gem 'yui-compressor'
gem 'coffee-rails', '~> 4.0.0'
gem 'therubyracer', platforms: :ruby
gem 'jquery-rails'
gem 'jquery-ui-rails'
gem 'jbuilder', '~> 1.2'
group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', require: false
end
gem 'simple_form', '~> 3.1.0'
gem "paperclip", "~> 4.2"
gem 'aws-sdk'
gem 'devise', '~> 3.5.2'
gem "cancan"
gem 'friendly_id', '~> 5.0.2'
gem 'pusher', '~> 0.14.5'
gem "configurable_engine", :path => "vendor/gems/configurable_engine"
gem 'backbone-rails'
gem 'marionette-rails'
gem "breadcrumbs_on_rails"
gem 'subdomain-fu', :git => "git://github.com/mbleigh/subdomain-fu.git"
gem 'bitly'
gem 'social-share-button', '~> 0.1.8'
gem 'momentjs-rails', '~> 2.5.0'
gem 'bootstrap3-datetimepicker-rails', '~> 3.0.0'
gem 'rails_autolink'
gem 'jquery-datatables-rails', github: 'rweng/jquery-datatables-rails'
gem "twitter"
gem 'unicorn'
gem 'i18n-js', '>= 3.0.0.rc11'
gem 'sitemap_generator'
gem 'will_paginate-bootstrap'
group :test, :development, :staging do
gem 'populator'
gem 'faker'
end
gem "jquery-fileupload-rails"
gem 'rails-timeago', '~> 2.0'
gem 'font-awesome-rails'
gem 'omniauth'
gem 'omniauth-twitter'
gem 'omniauth-facebook'
gem 'jquery-minicolors-rails'
gem 'htmlentities', '~> 4.3.2'
gem 'sanitize'
gem 'nokogiri'
gem 'dalli'
gem 'kgio', '~> 2.9.3'
gem 'useragent'
gem "fog", "~>1.20"#, require: "fog/aws/storage"
gem 'asset_sync'
gem 'responders', '~> 2.0'
gem 'rails-deprecated_sanitizer'
================ edit ===============
Stack-trace in console:
ArgumentError: wrong number of arguments (3 for 1..2)
from /home/guy/.rvm/gems/ruby-2.1.2/bundler/gems/subdomain-fu-3752799a02c0/lib/subdomain_fu/url_rewriter.rb:6:in `url_for_with_subdomains'
from /home/guy/.rvm/gems/ruby-2.1.2/gems/actionpack-4.2.4/lib/action_dispatch/routing/route_set.rb:282:in `call'
from /home/guy/.rvm/gems/ruby-2.1.2/gems/actionpack-4.2.4/lib/action_dispatch/routing/route_set.rb:225:in `call'
from /home/guy/.rvm/gems/ruby-2.1.2/gems/actionpack-4.2.4/lib/action_dispatch/routing/route_set.rb:347:in `block (2 levels) in define_url_helper'
from (irb):3
from /home/guy/.rvm/gems/ruby-2.1.2/gems/railties-4.2.4/lib/rails/commands/console.rb:110:in `start'
from /home/guy/.rvm/gems/ruby-2.1.2/gems/railties-4.2.4/lib/rails/commands/console.rb:9:in `start'
from /home/guy/.rvm/gems/ruby-2.1.2/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:68:in `console'
from /home/guy/.rvm/gems/ruby-2.1.2/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /home/guy/.rvm/gems/ruby-2.1.2/gems/railties-4.2.4/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
================ edit (2) ===============
I dived into the code and saw that the line in /gems/actionpack-4.2.4/lib/action_dispatch/routing/route_set.rb (282) that raises the error is that:
t._routes.url_for(hash, route_name, url_strategy)
While the url_for function signature in url_rewriter is:
def url_for_with_subdomains(options, path_segments=nil)
Looks like I need to update something, but I don't know what.
================ edit (3) ===============
Just to be sure that it has nothing to do with my routes.rb file, I cleaned it and left it like that:
MyApp::Application.routes.draw do
root 'pages#index', :constraints => {:subdomain => /www|$^/}
end
As expected, still have the same error.
Had the same problem, the solution was instead of using:
include Rails.application.routes.url_helpers
I din't included and added url_helpers to a variable, like this:
url_helpers = Rails.application.routes.url_helpers
url_helpers.root_url
I had exactly same problem and at the end in my case
t._routes.url_for(hash, route_name, url_strategy)
called url_for_with_secure_option from bartt-ssl_requirement gem.
Since we don't need bartt-ssl_requirement gem anymore in our case solution was to simply remove bartt-ssl_requirement gem.
Try to remove subdomain-fu and use Rails4 request.subdomain when needed.
In case you get that error in the console, because you use a helper that uses URL helpers:
class << helper; include Rails.application.routes.url_helpers; end
helper.my_method # \o/
When I run RAILS_ENV=development rails s my app works fine. But when I run RAILS_ENV=production rails s I get the message:
christophecompaq#ubuntu:~/FunkyApp$ RAILS_ENV=production rails s
DEPRECATION WARNING: require "activerecord" is deprecated and will be removed in Rails 3. Use require "active_record" instead. (called from /usr/lib/ruby/vendor_ruby/activerecord.rb:2)
=> Booting WEBrick
=> Rails 3.2.3 application starting in production on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/var/lib/gems/1.8/gems/omniauth-1.1.0/lib/omniauth/strategy.rb:136:in `initialize': Received wrong number of arguments. [nil] (ArgumentError)
from /var/lib/gems/1.8/gems/actionpack-3.2.3/lib/action_dispatch/middleware/stack.rb:43:in `new'
from /var/lib/gems/1.8/gems/actionpack-3.2.3/lib/action_dispatch/middleware/stack.rb:43:in `build'
from /var/lib/gems/1.8/gems/actionpack-3.2.3/lib/action_dispatch/middleware/stack.rb:113:in `build'
from /var/lib/gems/1.8/gems/railties-3.2.3/lib/rails/application.rb:282:in `inject'
from /var/lib/gems/1.8/gems/actionpack-3.2.3/lib/action_dispatch/middleware/stack.rb:113:in `each'
from /var/lib/gems/1.8/gems/actionpack-3.2.3/lib/action_dispatch/middleware/stack.rb:113:in `inject'
from /var/lib/gems/1.8/gems/actionpack-3.2.3/lib/action_dispatch/middleware/stack.rb:113:in `build'
from /var/lib/gems/1.8/gems/railties-3.2.3/lib/rails/engine.rb:470:in `build_middleware_stack'
from /var/lib/gems/1.8/gems/railties-3.2.3/lib/rails/application/finisher.rb:31
from /var/lib/gems/1.8/gems/railties-3.2.3/lib/rails/initializable.rb:30:in `instance_exec'
from /var/lib/gems/1.8/gems/railties-3.2.3/lib/rails/initializable.rb:30:in `run'
from /var/lib/gems/1.8/gems/railties-3.2.3/lib/rails/initializable.rb:55:in `run_initializers'
from /var/lib/gems/1.8/gems/railties-3.2.3/lib/rails/initializable.rb:54:in `each'
from /var/lib/gems/1.8/gems/railties-3.2.3/lib/rails/initializable.rb:54:in `run_initializers'
from /var/lib/gems/1.8/gems/railties-3.2.3/lib/rails/application.rb:136:in `initialize!'
from /var/lib/gems/1.8/gems/railties-3.2.3/lib/rails/railtie/configurable.rb:30:in `send'
from /var/lib/gems/1.8/gems/railties-3.2.3/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /home/christophecompaq/FunkyApp/config/environment.rb:5
from /var/lib/gems/1.8/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
from /var/lib/gems/1.8/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
from /var/lib/gems/1.8/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:236:in `load_dependency'
from /var/lib/gems/1.8/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
from /home/christophecompaq/FunkyApp/config.ru:4
from /var/lib/gems/1.8/gems/rack-1.4.1/lib/rack/builder.rb:51:in `instance_eval'
from /var/lib/gems/1.8/gems/rack-1.4.1/lib/rack/builder.rb:51:in `initialize'
from /home/christophecompaq/FunkyApp/config.ru:1:in `new'
from /home/christophecompaq/FunkyApp/config.ru:1
christophecompaq#ubuntu:~/FunkyApp$
With my limited Rails knowledge, I think I figure it out right when I say there's a problem with the omniauth gem - strategy.rb, line 136, specifically.
But I've never, ever, changed anything in my var/lib/gems folder. And when I compare my strategy.rb against the one on github: https://github.com/intridea/omniauth/blob/v1.1.0/lib/omniauth/strategy.rb#L124 I get the exact same file - even the formatting is identical.
I have backups of my app and even when I go into those backup folders and do RAILS_ENV=production rails s I get the exact same error message - which would lead me to believe it's some core dependency/gem file issue, not some configuration/deploy thing I accidentlly changed in my app folder. (although I'm probably wrong!...) Everything was working fine up to about 3 weeks ago - no rails s errors at all
I'm just throwing ideas out there, but something maybe in .bashrc, .bash_profile?...I don't know. Any help would be appreciated!
Edit: adding my gemfile, below:
source 'https://rubygems.org'
gem 'rails', '3.2.3'
gem 'rake', '~> 10.0.4'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'mysql2', '~> 0.3.11'
gem 'json', '~> 1.7.3'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'compass-rails', '~> 1.0.1'
gem 'bootstrap-sass', '~> 2.0.2'
gem 'coffee-rails', '~> 3.2.1'
gem 'therubyracer', '~> 0.10.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platform => :ruby
gem 'uglifier', '>= 1.0.3'
gem 'jquery-fileupload-rails'
end
gem 'jquery-rails', '~> 2.0.2'
gem 'inherited_resources', '~> 1.3.1'
gem 'simple_form', '~> 2.0.2'
gem 'will_paginate', '~> 3.0.3'
gem 'bootstrap-will_paginate', '~> 0.0.7'
gem 'has_scope', '~> 0.5.1'
gem "best_in_place", "~> 1.1.2"
gem 'devise', '~> 2.0.4'
gem 'omniauth'
gem 'omniauth-facebook'
gem 'linkedin'
gem 'omnicontacts', '~> 0.2.3'
gem 'SystemTimer', '~> 1.2.3'
gem 'resque', '~> 1.20.0'
gem 'resque-scheduler', :require => 'resque_scheduler'
gem 'rest-client', '~> 1.6.7'
gem 'rest-graph', '~> 2.0.1'
gem 'geokit', '=1.6.5'
gem 'geokit-rails3', '~> 0.1.5'
gem 'memcache-client'
gem 'forgery', '~> 0.5.0'
gem 'factory_girl_rails', '~> 1.7.0'
gem "amoeba", "~> 1.2.1"
# 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 'ruby-debug'
group :development do
gem 'mongrel'
gem 'pry-rails'
gem 'quiet_assets'
gem 'email_spec'
gem 'capistrano', '~> 2.12.0'
gem 'capistrano-ext', '~> 1.2.1'
gem 'rvm-capistrano', '~> 1.2.1'
gem 'ruby-debug-base', '=0.10.4'
gem 'ruby-debug', '=0.10.4'
gem 'annotate'
gem 'letter_opener', :git => 'https://github.com/ryanb/letter_opener.git'
gem 'localtunnel'
end
group :test do
gem 'cucumber-rails', '~> 1.3.0', :require => false
gem 'capybara-webkit', '~> 0.11.0'
gem 'headless', '~> 0.3.1'
gem 'database_cleaner', '~> 0.7.2'
gem 'rspec-rails', '~> 2.9.0'
gem 'email_spec'
end
You could set the environment using bin/rails db:environment:set RAILS_ENV=production
Anyone know of a more up-to-date version of a Rails Rspec/Guard/Spork/Growl test suite set up?
These used to be great, but have become outdated as Ruby, Rails and the gems upgraded.
http://ygamretuta.me/2011/08/10/rails-3-setting-up-guard-with-rspec-and-spork-with-growl-notifications-in-osx/
https://eq8scrapbook.heroku.com/equivalents_scrap/on_rspec_spork_guard_configuration
Even the M. Hartl Ruby on Rails Tutorial instructions results in Guard tossing up a ChildProcess error and doesn't load the DRb server.
Here's what I've found to fix my problem above:
rails new app_name --skip-test-framework
Gemfile
source 'https://rubygems.org'
gem 'rails', '3.2.12'
gem 'bootstrap-sass', '2.1'
gem 'bcrypt-ruby', '3.0.1'
gem 'faker', '1.0.1'
gem 'will_paginate', '3.0.3'
gem 'bootstrap-will_paginate', '0.0.6'
gem 'jquery-rails', '2.0.2'
group :development, :test do
gem 'sqlite3', '1.3.5'
gem 'rspec-rails', '2.11.0'
gem 'rspec', '2.11.0'
gem 'guard', '1.6.2'
gem 'guard-rspec', '1.2.1'
gem 'guard-spork', '1.4.2'
gem 'spork-rails', '3.2.1'
gem 'spork', '1.0.0rc3'
end
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '3.2.5'
gem 'coffee-rails', '3.2.2'
gem 'uglifier', '1.2.3'
end
group :test do
gem 'capybara', '1.1.2'
gem 'factory_girl_rails', '4.1.0'
gem 'database_cleaner', '0.7.0'
gem 'launchy', '2.1.0'
gem 'rb-fsevent', :require => false
gem 'growl', '1.0.3'
end
group :production do
gem 'pg', '0.12.2'
end
Then run this:
bundle update; bundle install; rails g rspec:install; guard init rspec; guard init spork; spork --bootstrap
Guardfile
Put the boostrapped spork block before the rspec block
spec_helper.rb
Put the block starting with "ENV["RAILS_ENV"] ||= 'test'" inside the Spork.prefork block
.rspec
add --drb
Run 'guard' and you should be all set.