thinkfuture
thinkfuture

Reputation: 241

No such file to load -- json (LoadError)

Everything was working fine on this app, and now today I get this when I try to push to Heroku:

Counting objects: 28, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (22/22), done.
Writing objects: 100% (22/22), 2.20 KiB, done.
Total 22 (delta 14), reused 0 (delta 0)
/app/slug-compiler/lib/slug.rb:12:in `require': no such file to load -- json (LoadError)
    from /app/slug-compiler/lib/slug.rb:12
    from /app/slug-compiler/bin/slugc:14:in `require'
    from /app/slug-compiler/bin/slugc:14
To [email protected]:cold-night-9597.git
! [remote rejected] master -> master (pre-receive hook declined)
 error: failed to push some refs to '[email protected]:server-name-1234.git'

Very strange - couldn't find anything on this error anywhere - and its running fine locally...

Upvotes: 1

Views: 5925

Answers (2)

uvsmtid
uvsmtid

Reputation: 4295

See this answer for details.

I had the same error while running project managed via bundle:

bundle exec jekyll build

The following line was missing in Gemfile:

gem "json"

Upvotes: 4

Anthony Garcia-Labiad
Anthony Garcia-Labiad

Reputation: 3711

Try this:

require 'rubygems'
require 'json'

Upvotes: 6

Related Questions