Ruby on Rails - cannot run the following command : rails generate rspec:install - ruby-on-rails

I'm studying Rails tutorial Chapter 3.
I cannot execute the following command. If you have an idea to solve this problem, please tell me.
Thanks.
exec command
bundle exec rails generate rspec:install
Errors
/Users/mofuty/rails_projects/sample_app/config/application.rb:5:in `require': cannot load such file -- active_job/railtie (LoadError)
from /Users/mofuty/rails_projects/sample_app/config/application.rb:5:in `<top (required)>'
from /Users/mofuty/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/railties-4.0.5/lib/rails/commands.rb:43:in `require'
from /Users/mofuty/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/railties-4.0.5/lib/rails/commands.rb:43:in `<top (required)>'
from bin/rails:8:in `require'
from bin/rails:8:in `<main>'
Gemfile
source 'https://rubygems.org'
ruby '2.1.2'
#ruby-gemset=railstutorial_rails_4_0
gem 'rails', '4.0.5'
group :development, :test do
gem 'sqlite3', '1.3.8'
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.5'
gem 'uglifier', '2.1.1'
gem 'coffee-rails', '4.0.1'
gem 'jquery-rails', '3.0.4'
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
The following is apprication.rb. If you needs more details, please ask me.
config/application.rb
require File.expand_path('../boot', __FILE__)
# Pick the frameworks you want: require "active_model/railtie" require "active_job/railtie" require "active_record/railtie" require "action_controller/railtie" require "action_mailer/railtie" require "action_view/railtie" require "sprockets/railtie"
# require "rails/test_unit/railtie"
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production. Bundler.require(*Rails.groups)
module SampleApp class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
# config.time_zone = 'Central Time (US & Canada)'
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de
# Do not swallow errors in after_commit/after_rollback callbacks.
config.active_record.raise_in_transactional_callbacks = true end end

Try bundle exec rails generate rspec:install
bundle exec is a Bundler command to execute a script in the context of the current bundle (the one from your directory's Gemfile)

It sounds as though your test suite is invoking some code with a dependency on the new ActiveJob framework that is part of Rails 4.
The error suggests that you do not have the railtie included in your config/application.rb file. If you open it, you'll likely find it is commented out, look for a line like this: # require "active_job/railtie"
If so, uncomment it. If that line is not included in the file, add require "active_job/railtie" on a new line after this require "active_model/railtie".
This will ensure that the active job railtie is loaded on Rails initialization.

Thanks for your advice. The problem is I executed rails new with rails 4.2.x. So, I rebuild the project with 4.0.5. Then I could executed bundle exec rails generate rspec:install. I appreciate you.

Related

rails active_storage:install IS NOT WORKING

I have updated my rails api application from 5.1 to 5.2.
I am using rails api only.
I am trying to use the active storage. I think the problem is due to the line config.api_only = true in config/application.rb.
I did lot of google but did not find any thing how to use active storage in rails api.
Here is my Gemfile:
source 'https://rubygems.org'
ruby '2.5.1'
git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
"https://github.com/#{repo_name}.git"
end
gem 'rails', '~> 5.2.0'
gem 'pg', '>= 0.18', '< 2.0'
gem 'puma', '~> 3.7'
gem 'rack-cors'
# Auth
gem 'bcrypt'
gem 'jwt'
#Media file upload
gem 'activestorage'
# gem 'devise', '4.4.3'
# gem 'devise-jwt', '~> 0.5.6'
gem 'active_model_serializers', '~> 0.10.0', require: true
# backgroud jobs
gem 'sidekiq'
# fast boot
gem 'bootsnap', require: false
group :development, :test do
gem 'rspec-rails', '~> 3.7'
gem 'brakeman'
gem 'rubocop'
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end
group :development do
gem 'foreman'
gem 'listen', '>= 3.0.5', '< 3.2'
gem 'spring'
gem 'pry'
gem 'spring-watcher-listen', '~> 2.0.0'
gem 'annotate'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
Here is my config/application.rb
require_relative 'boot'
require "rails"
# Pick the frameworks you want:
require "active_model/railtie"
require "active_job/railtie"
require "active_record/railtie"
require "action_controller/railtie"
require "action_mailer/railtie"
require "action_view/railtie"
require "action_cable/engine"
require "active_storage"
# require "sprockets/railtie"
require "rails/test_unit/railtie"
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module CelebrationBackend
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 5.1
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
# Only loads a smaller set of middleware suitable for API only apps.
# Middleware like session, flash, cookies can be added back manually.
# Skip views, helpers and assets when generating a new resource.
config.api_only = true
config.active_job.queue_adapter = :sidekiq
config.autoload_paths << Rails.root.join('lib')
end
end
While running the rails activestorage:install in to console.
I am getting the following error:
rails aborted!
Don't know how to build task 'activestorage:install' (see --tasks)
/home/sourabh/.rvm/gems/ruby-2.5.1#celeb/gems/railties-5.2.0/lib/rails/commands/rake/rake_command.rb:23:in block in perform'
/home/sourabh/.rvm/gems/ruby-2.5.1#celeb/gems/railties-5.2.0/lib/rails/commands/rake/rake_command.rb:20:inperform'
/home/sourabh/.rvm/gems/ruby-2.5.1#celeb/gems/railties-5.2.0/lib/rails/command.rb:48:in invoke'
/home/sourabh/.rvm/gems/ruby-2.5.1#celeb/gems/railties-5.2.0/lib/rails/commands.rb:18:in'
/home/sourabh/.rvm/gems/ruby-2.5.1#celeb/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in require'
/home/sourabh/.rvm/gems/ruby-2.5.1#celeb/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:inblock in require_with_bootsnap_lfi'
/home/sourabh/.rvm/gems/ruby-2.5.1#celeb/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in register'
/home/sourabh/.rvm/gems/ruby-2.5.1#celeb/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:inrequire_with_bootsnap_lfi'
/home/sourabh/.rvm/gems/ruby-2.5.1#celeb/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in require'
/home/sourabh/.rvm/gems/ruby-2.5.1#celeb/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:inblock in require'
/home/sourabh/.rvm/gems/ruby-2.5.1#celeb/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:249:in load_dependency'
/home/sourabh/.rvm/gems/ruby-2.5.1#celeb/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:inrequire'
/home/sourabh/dev/celebration/bin/rails:9:in <top (required)>'
/home/sourabh/.rvm/gems/ruby-2.5.1#celeb/gems/spring-2.0.2/lib/spring/client/rails.rb:28:inload'
/home/sourabh/.rvm/gems/ruby-2.5.1#celeb/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in call'
/home/sourabh/.rvm/gems/ruby-2.5.1#celeb/gems/spring-2.0.2/lib/spring/client/command.rb:7:incall'
/home/sourabh/.rvm/gems/ruby-2.5.1#celeb/gems/spring-2.0.2/lib/spring/client.rb:30:in run'
/home/sourabh/.rvm/gems/ruby-2.5.1#celeb/gems/spring-2.0.2/bin/spring:49:in'
/home/sourabh/.rvm/gems/ruby-2.5.1#celeb/gems/spring-2.0.2/lib/spring/binstub.rb:31:in load'
/home/sourabh/.rvm/gems/ruby-2.5.1#celeb/gems/spring-2.0.2/lib/spring/binstub.rb:31:in'
/home/sourabh/dev/celebration/bin/spring:15:in require'
/home/sourabh/dev/celebration/bin/spring:15:in'
bin/rails:3:in load'
bin/rails:3:in'
(See full trace by running task with --trace)
I am not getting the exact thing what I am doing wrong.
Your problem is here:
require "active_storage"
You need to require the engine:
require "active_storage/engine"
The current rails official documents talks about the new application. But
if you're upgrading a pre 5.2 app, you have to add or uncomment the field in application.rb
require "active_storage/engine"
For the new application, this will be already added.
Try running command in the project root
bin/rails active_storage:install
or
rake active_storage:install

Unable to access app once pushed to heroku

I've pushed my app to heroku after some maneuvering around in the gemfile and config/application.rb file
I have config.assets.initialize_on_precompile = false in my application.rb file above my Bundler.require.
Here is the gemfile.
source 'https://rubygems.org'
ruby '2.1.0'
gem 'rails', '4.0.5'
group :development, :test do
gem 'sqlite3'
end
group :production do
gem 'pg'
end
gem 'sass-rails', '~> 4.0.2'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 1.2'
group :doc do
gem 'sdoc', require: false
end
gem 'bcrypt', '~> 3.1.7'
group :test, :development do
gem "rspec-rails", "2.13.1"
end
group :test do
gem "capybara", "2.1.0"
end
group :development do
gem 'pry-rails'
gem 'nokogiri', '1.6.3.1'
end
When I try to access the application on heroku I get an:
'Application Error
An error occurred in the application and your page could not be served. Please try again in a few moments.
If you are the application owner, check your logs for details.'
Any ideas?
EDIT: Application.rb posted below as requested:
require File.expand_path('../boot', __FILE__)
require 'rails/all'
config.assets.initialize_on_precompile = false
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module Planner
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
# config.time_zone = 'Central Time (US & Canada)'
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de
end
end
It is complaining about the config statement that is on line 5. That needs to be inside the Application class definition, like so:
require File.expand_path('../boot', __FILE__)
require 'rails/all'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module Planner
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
# config.time_zone = 'Central Time (US & Canada)'
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de
config.assets.initialize_on_precompile = false
end
end

Ruby: can't convert true into String

Novice Ruby on Rails dev here. I recently pulled code from a remote team that was building an iPhone App, including the API for the Rails backend, but once I finished pulling the code, I get the following error in terminal when I try and start the Rails server.
/usr/local/rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.5/lib/bundler/runtime.rb:68:in `require': can't convert true into String (TypeError)
from /usr/local/rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.5/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from /usr/local/rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.5/lib/bundler/runtime.rb:66:in `each'
from /usr/local/rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.5/lib/bundler/runtime.rb:66:in `block in require'
from /usr/local/rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.5/lib/bundler/runtime.rb:55:in `each'
from /usr/local/rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.5/lib/bundler/runtime.rb:55:in `require'
from /usr/local/rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.5/lib/bundler.rb:119:in `require'
from /Users/tmylonas/Sites/getlocal/config/application.rb:7:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/commands.rb:53:in `require'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/commands.rb:53:in `block in <top (required)>'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/commands.rb:50:in `tap'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
And here's the application.rb:
require File.expand_path('../boot', __FILE__)
require 'rails/all'
if defined?(Bundler)
# If you precompile assets before deploying to production, use this line
Bundler.require(*Rails.groups(:assets => %w(development test)))
# If you want your assets lazily compiled in production, use this line
# Bundler.require(:default, :assets, Rails.env)
end
module Getlocal
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
# Custom directories with classes and modules you want to be autoloadable.
config.autoload_paths += %W(#{config.root}/lib)
# Only load the plugins named here, in the order given (default is alphabetical).
# :all can be used as a placeholder for all plugins not explicitly named.
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
# Activate observers that should always be running.
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
# config.time_zone = 'Central Time (US & Canada)'
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de
# Configure the default encoding used in templates for Ruby 1.9.
config.encoding = "utf-8"
# Configure sensitive parameters which will be filtered from the log file.
config.filter_parameters += [:password]
# Enable escaping HTML in JSON.
config.active_support.escape_html_entities_in_json = true
# Use SQL instead of Active Record's schema dumper when creating the database.
# This is necessary if your schema can't be completely dumped by the schema dumper,
# like if you have constraints or database-specific column types
# config.active_record.schema_format = :sql
# Enforce whitelist mode for mass assignment.
# This will create an empty whitelist of attributes available for mass-assignment for all models
# in your app. As such, your models will need to explicitly whitelist or blacklist accessible
# parameters by using an attr_accessible or attr_protected declaration.
config.active_record.whitelist_attributes = true
# Enable the asset pipeline
config.assets.enabled = true
# Version of your assets, change this if you want to expire all your assets
config.assets.version = '1.0'
config.assets.initialize_on_precompile = false
end
end
And here's the gem file:
source 'https://rubygems.org'
ruby '1.9.3'
gem 'rails', '3.2.8'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'pg'
gem 'devise'
gem 'simple_form'
gem 'thin'
gem 'cancan'
gem 'sidekiq'
gem 'sinatra', require: false
gem 'slim'
gem 'kaminari'
gem 'high_voltage'
gem 'bootbox-rails'
gem 'rails_autolink'
gem 'newrelic_rpm'
gem "active_model_serializers", "~> 0.8.1"
gem 'google_places'
gem 'figaro'
gem 'houston', :require => true
# 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'
gem 'underscore-rails'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
group :development, :test do
gem 'pry'
gem 'pry-rails'
end
group :development do
gem 'better_errors'
gem 'binding_of_caller'
gem 'sextant'
end
Unfortunately, the error is very nondescript. I'm not sure if this question is specific enough for SO. If it's not, apologies, but after googling for several hours, reading threads like this one: can't convert true into String and this one: Ruby returns TypeError: can't convert Object into String, where the code is identifiable, I thought I'd see if I could get someone to give me some more specific advice about how to diagnose and ultimately fix this issue.
Thank you much.
As usual, the best way to answer my SO questions is to go through the process of submitting the question, sitting on it for 24 hours and then trying again.
The issue here is that the "Houston" gem, which I'm not familiar with, doesn't appear to work with Ruby 1.9.3. Once I commented that gem out of the gemfile (thanks for Santosh for suggesting I post the gemfile because this is why I looked deeper at it!), the Rails server started right up.

Installing Doorkeeper : Uninitialized Constant Error

I'm attempting to install Doorkeeper on a fresh rails (4.0.2) install. After I add the gem to the gemfile and install it, I try to run
rails generate doorkeeper:install
and get the following error:
/Users/mam8cc/Projects/doorkeeper/config/application.rb:10:in `<module:Doorkeeper>': uninitialized constant Doorkeeper::Rails::Application (NameError)
from /Users/mam8cc/Projects/doorkeeper/config/application.rb:9:in `<top (required)>'
from /Users/mam8cc/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.2/lib/rails/commands.rb:43:in `require'
from /Users/mam8cc/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.2/lib/rails/commands.rb:43:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
My applications.rb
require File.expand_path('../boot', __FILE__)
require 'rails/all'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(:default, Rails.env)
module Doorkeeper
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
# config.time_zone = 'Central Time (US & Canada)'
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de
end
end
And my Gemfile for posterity
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.2'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'
# Use Uglifier as compressor for JavaScript assets
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
gem 'doorkeeper'
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem '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
end
# Use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.1.2'
# Use unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano', group: :development
# Use debugger
# gem 'debugger', group: [:development, :test]
The issue is with your project having the same name as the package you are trying to install. Change the name of the project and it should work.

RSpec 2.13.1 hanging in Ruby 1.9.3 with Rails 3.2.13 and Spork 1.0.0rc3

Trying to resurrect an old project by upgrading gems. Ran into an issue where RSpec hangs on startup with the '--drb' option.
By itself, 'rspec spec' works fine. But start 'spork' in another terminal and then 'rspec --drb spec' spins up CPU to ~40% and just sits.
Using Rails 3.2.13, Ruby 1.9.3-p392, RSpec 2.13.1 and spork-rails 3.2.1, which depends on Spork 1.0.0rc3.
Gemfile
source 'http://rubygems.org'
gem 'rails', '~> 3.2.13'
gem 'devise', '~> 2.2.0'
gem 'event-calendar', :require => 'event_calendar'
gem 'has_scope'
gem 'high_voltage'
gem 'inherited_resources'
gem 'jquery-rails'
gem 'kaminari'
gem 'ransack'
gem 'simple_form'
gem 'validates_timeliness'
# deployment process management
gem 'foreman'
gem 'thin'
# 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'
gem 'uglifier', '< 2.0'
gem 'bootstrap-sass', '~> 2.3.1'
end
group :production do
gem 'pg'
end
group :development, :test do
gem 'factory_girl_rails', '~> 4.2.0'
gem 'rspec-rails', '~> 2.13.1'
gem 'spork-rails'
gem 'sqlite3'
end
group :test do
gem 'capybara'
gem 'growl'
gem 'launchy'
gem 'ruby-prof'
gem 'test-unit'
end
spec/spec_helper.rb
require 'rubygems'
require 'spork'
#uncomment the following line to use spork with the debugger
#require 'spork/ext/ruby-debug'
Spork.prefork do
# Prevent Devise from loading the User model super early with it's routes
# see: https://github.com/sporkrb/spork/wiki/Spork.trap_method-Jujitsu
require "rails/application"
Spork.trap_method(Rails::Application::RoutesReloader, :reload!)
# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'rspec/autorun'
# Since I have included Test::Unit for perfomance tests, disable auto-run
Test::Unit::AutoRunner.need_auto_run = false if defined?(Test::Unit::AutoRunner)
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
RSpec.configure do |config|
# ## Mock Framework
#
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
#
# config.mock_with :mocha
# config.mock_with :flexmock
# config.mock_with :rr
# If you're not using ActiveRecord, or you'd prefer not to run each of your
# examples within a transaction, remove the following line or assign false
# instead of true.
config.use_transactional_fixtures = true
# If true, the base class of anonymous controllers will be inferred
# automatically. This will be the default behavior in future versions of
# rspec-rails.
config.infer_base_class_for_anonymous_controllers = false
# Run specs in random order to surface order dependencies. If you find an
# order dependency and want to debug it, you can fix the order by providing
# the seed, which is printed after each run.
# --seed 1234
config.order = "random"
end
end
Spork.each_run do
# This code will be run each time you run your specs.
end
I'm not getting any error messages or feedback on the console, so I don't even know where to start looking for problems. Any suggestions?
Upgrading ruby-build via brew update ruby-build picked up a new version dated 2013-05-01. After the update, I trashed and reinstalled all my Rubies, and the problem seems to have resolved itself.
I don't know what specifically addressed the issue, but here are some notes and a relevant commit: https://github.com/sstephenson/ruby-build/commit/9f8d53365aef52c940095f583cdc82f02caba90f

Resources