Ruby Cannot Load Such File - Active_Support/Core_Ext/Object/Blank

Ruby cannot load such file - active_support/core_ext/object/blank

Running brew style fixed this issue for me.


Update

As mentioned in the comments, for some people the solution is:

brew update-reset

Can't load `active_support/core_ext` in ruby 2.1.5

Presuming you're using bundler, try this diagnostic code to see what works:

require 'rubygems'        # You may be able to omit this line
require 'bundler/setup' # You may be able to omit this line
require 'active_support'
require 'active_support/core_ext'

Newer Ruby versions may be able skip rubygems, setup, and core_ext, and just use this:

require 'active_support'

why can I require 'active_support/core_ext'?

Look for the file named core_ext.rb.

But no require can't load directories.

How to fix Ruby error: `require': cannot load such file -Programing Ruby 1.9 & 2.0 4th edition

gserver used to be part of Ruby's standards library for some time. However, it was removed from the standards library with Ruby 2.2.0 since it was basically unmaintained and had no tests.

This (un-)maintenance status has not really changed since. If you still need the functionality of the library, you can install and use the gserver gem which contains the code state as it was removed form the standards library. However, I would strongly recommend to use something else instead...

Sidekiq -r a single demo_worker.rb file, and require active support in that worker doesnt work

This error happens cause the gem activesupport has not been installed yet (on your local machine), so just run command gem install activesupport, and it'll be ok.

But note that active_support in Rails use autoload so if we're going to use it's submodules outside Rails we need to require them directly, for example i want to use extension Integer#hours i need to require active_support/core_ext/integer/time

require 'sidekiq'
require "active_support/core_ext/integer/time"

class Demo
include Sidekiq::Worker

def perform(how_hard="super hard", how_long=1)
sleep how_long
puts "Workin' #{how_hard} #{8.hours}"
end
end


Related Topics



Leave a reply



Submit