![](/img/trans.png)
[英]Travis-CI is giving me an error when I am trying to build my site. What is wrong if the bundler matches with the gemfile.lock file?
[英]travis-ci : error during the build (No such file or directory)
我在尝试为jekyll应用程序在travis-ci上测试构建时遇到问题。 其中一个插件会生成一个json,其中包含我的应用程序可用于搜索工具的信息。
build命令在我的计算机上工作正常:
bundle exec jekyll build --source octopress
Witch将信息索引到我的内置目录(_site)中的search.json文件中。
但是它在Travis-ci上失败了,在Heroku上失败了。
writting search.json to /home/travis/build/alain-andre/mon_site/_site
jekyll 2.5.3 | Error: No such file or directory - /home/travis/build/alain-andre/mon_site/_site/search.json
有人可以帮忙吗?
好的,我找到了解决方案。
我必须将search.json
添加到site.keep_files
。
首先要做的是在Jekyll模块内创建一个Jekyll :: StaticFile 。
class SearchJson < Jekyll::StaticFile
def write(dest)
begin
super(dest)
rescue
end
true
end
end
然后,在创建文件后,将其添加到site.static_files
如下所示:
# Keep the file from being cleaned by Jekyll
Jekyll::SearchJson.new(site, site.dest, "/", filename)
site.keep_files << filename
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.