thinkfuture thinkfuture - 7 months ago 17
Ruby Question

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 git@heroku.com:cold-night-9597.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:server-name-1234.git'


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

Answer

Try this:

require 'rubygems'
require 'json'
Comments