1

这个应用程序一切正常,现在当我尝试推送到 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'

非常奇怪-在任何地方都找不到有关此错误的任何信息-并且在本地运行良好...

4

2 回答 2

6

试试这个:

require 'rubygems'
require 'json'
于 2013-04-04T13:36:30.457 回答
3

有关详细信息,请参阅此答案

我在运行通过以下方式管理的项目时遇到了同样的错误bundle

bundle exec jekyll build

中缺少以下行Gemfile

gem "json"
于 2016-04-24T06:32:41.123 回答