繁体   English   中英

没有要加载的此类文件-json(LoadError)

[英]No such file to load — json (LoadError)

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

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

尝试这个:

require 'rubygems'
require 'json'

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

运行通过bundle管理的项目时,我遇到了相同的错误:

bundle exec jekyll build

Gemfile中缺少以下行:

gem "json"

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM