在这个应用程序上一切都很好,今天我试着推到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'

很奇怪-在任何地方都找不到这个错误的任何信息-而且它在本地运行良好。。。

最佳答案

试试这个:

require 'rubygems'
require 'json'

关于ruby - 没有要加载的此类文件-json(LoadError),我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/15776582/

10-14 19:45