Blog coding and discussion of coding about JavaScript, PHP, CGI, general web building etc.

Sunday, April 3, 2016

Rails 3 + Heroku: cannot load such file -- test/unit/testcase (LoadError)

Rails 3 + Heroku: cannot load such file -- test/unit/testcase (LoadError)


I'm having the following error when running the console in heroku (heroku run console...). The application is running without problems, but I seem to be unable to run the console because of this and in development I'm not having this issue.

/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:251:in `require': cannot load such file -- test/unit/testcase (LoadError)  from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:251:in `block in require'  from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:236:in `load_dependency'  from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:251:in `require'  from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.9/lib/active_support/test_case.rb:1:in `'  from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:251:in `require'  from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:251:in `block in require'  from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:236:in `load_dependency'  from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:251:in `require'  from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.9/lib/rails/console/app.rb:2:in `'  from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:251:in `require'  from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:251:in `block in require'  from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:236:in `load_dependency'  from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:251:in `require'  from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.9/lib/rails/application.rb:304:in `initialize_console'  from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.9/lib/rails/application.rb:152:in `load_console'  from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.9/lib/rails/commands/console.rb:27:in `start'  from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.9/lib/rails/commands/console.rb:8:in `start'  from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.9/lib/rails/commands.rb:41:in `'  from script/rails:6:in `require'  from script/rails:6:in `
'

This is my Gemfile:

source 'http://rubygems.org'  ruby '1.9.3'    gem 'rails', '3.2.9'    gem 'oauth', '~> 0.4.4'  gem 'twitter', '~> 1.4.1'  gem 'sendgrid'  gem 'koala'    gem 'therubyracer', '0.10.2'  gem 'execjs'    # Rails 3.1 - Asset Pipeline  gem 'json'    group :assets do    gem 'sass-rails', "  >= 3.2.3"    gem 'coffee-rails', ">= 3.2.1"    gem 'uglifier', '>= 1.0.3'    gem 'bootstrap-sass'  end    gem 'coffee-script'    gem 'jquery-rails'    gem "fog"  gem 'bootstrap-wysihtml5-rails', '0.3.1.10'    group :production do    gem "heroku"    gem 'pg', '0.13'    gem 'newrelic_rpm'    gem 'newrelic_api'  end    group :test do    gem 'email_spec'    gem "cucumber-rails"    gem "rspec-rails"    gem "capybara"    gem 'culerity'    gem "selenium-webdriver"    gem "database_cleaner"    gem 'factory_girl_rails'  end    group :development, :grades, :test do    gem "launchy"    gem "mysql2"    gem "letter_opener"    gem "pry"    gem "rails-erd"  end    gem "airbrake"  gem "authlogic"  gem 'awesome_print'  gem 'cancan'  gem 'dalli'    #gem "oink"  gem 'validates_timeliness', '~> 3.0.2'  gem 'hpricot'  gem "ruby_parser"  gem "prawn_rails"  gem "thin"  gem "nested_form", :git => "git://github.com/ryanb/nested_form.git"  gem "meta_search"  gem "carrierwave"  gem "aws-s3"  gem "mini_magick"  gem 'will_paginate'  gem "spreadsheet"  gem "oauth-plugin", ">= 0.4.0.pre1"  gem 'flash_cookie_session'  gem 'haml-rails'  gem 'squeel'  gem 'rails_best_practices', :group => :development  gem 'simple_form'  gem 'taps', :group => :development  gem 'resque'  gem "audited-activerecord", "~> 3.0"  gem "lograge"  gem 'quiet_assets'  gem 'yajl-ruby', :require => "yajl"  gem 'switch_user'  

I've got no idea why I'm getting this error. Any thoughts? Thanks

Answer by JBlake for Rails 3 + Heroku: cannot load such file -- test/unit/testcase (LoadError)


I tried disabling multithreading (comment out config.threadsafe!) and that seems to work for now until heroku gets their act together.

Answer by Jason Weathered for Rails 3 + Heroku: cannot load such file -- test/unit/testcase (LoadError)


We also ran into this issue today. I suspect something must have changed in Heroku's Ruby build pack.

For us it was a problem with prototype-rails trying to load ActionView::TestCase which in turn requires test/unit/testcase. The patch is pretty simple and is available as a fork.

If you're using Bundler, you might want something like:

gem 'prototype-rails', :git => 'git://github.com/ennova/prototype-rails.git'  

Answer by d33pika for Rails 3 + Heroku: cannot load such file -- test/unit/testcase (LoadError)


Removing test dir from .slugignore fixed the issue

Answer by Thibaud Guillaume-Gentil for Rails 3 + Heroku: cannot load such file -- test/unit/testcase (LoadError)


Removing test in the .slugignore file works for me.

Answer by Sukeerthi Adiga for Rails 3 + Heroku: cannot load such file -- test/unit/testcase (LoadError)


Remove test dir from .slugignore

Answer by Yoshinori Kawasaki for Rails 3 + Heroku: cannot load such file -- test/unit/testcase (LoadError)


Apparently Heroku has changed the way it interprets the .slugignore file.

In my case, I had rpc directory in .slugignore and it wiped out rpc subdirectory of one of the gems my app is depending on, which resulted in LoadError. I'm unsure Heroku made this change intentionally. Regardless of whether .slugignore is working as they expect, removing affecting line(s) from .slugignore should fix the issue for now.

P.S. I've raised a support ticket to Heroku on this.

UPDATE: As per Heroku support, there were some changes to .slugignore parsing to make it more consistent with .gitignore, and it is working as intended. The right way to only delete the top level directory is putting /rpc instead.

Answer by TNT for Rails 3 + Heroku: cannot load such file -- test/unit/testcase (LoadError)


With Rails 3.1.12 and Ruby 2.2.0 I had to add

gem 'test-unit'  

to my Gemfile.


Fatal error: Call to a member function getElementsByTagName() on a non-object in D:\XAMPP INSTALLASTION\xampp\htdocs\endunpratama9i\www-stackoverflow-info-proses.php on line 72

  1 comment:

Popular Posts

Powered by Blogger.