ruby – 生成博客时octopress image_tag插件的SyntaxError

ruby – 生成博客时octopress image_tag插件的SyntaxError,第1张

概述我使用 octopress作为我的技术博客.我从官方的octopress repo更新了我的octopress代码,当我运行rake generate时出现类似的错误: |1.9.3-p194| home in ~/Documents/work/git/muratcorlu.github.com± |source ✓| → rake generate## Generating Site wit 我使用 octopress作为我的技术博客.我从官方的octopress repo更新了我的octopress代码,当我运行rake generate时出现类似的错误:

|1.9.3-p194| home in ~/documents/work/git/muratcorlu.github.com± |source ✓| → rake generate## Generating Site with Jekylldirectory source/stylesheets/    create source/stylesheets/screen.CSS Configuration from /Users/muratcorlu/documents/work/git/muratcorlu.github.com/_config.yml/Users/muratcorlu/documents/work/git/muratcorlu.github.com/plugins/category_generator.rb:109: warning: regexp has invalID interval/Users/muratcorlu/documents/work/git/muratcorlu.github.com/plugins/category_generator.rb:109: warning: regexp has `}' without escape/Users/muratcorlu/documents/work/git/muratcorlu.github.com/plugins/category_generator.rb:146: warning: regexp has invalID interval/Users/muratcorlu/documents/work/git/muratcorlu.github.com/plugins/category_generator.rb:146: warning: regexp has `}' without escape/library/Ruby/Gems/1.8/gems/jekyll-0.11.2/bin/../lib/jekyll/site.rb:76:in `require': /Users/muratcorlu/documents/work/git/muratcorlu.github.com/plugins/image_tag.rb:27: undefined (?...) sequence: /(?<class>\S.*\s+)?(?<src>(?:https?:\/\/|\/|\S+\/)\S+)(?:\s+(?<wIDth>\d+))?(?:\s+(?<height>\d+))?(?<Title>\s+.+)?/ (SyntaxError)/Users/muratcorlu/documents/work/git/muratcorlu.github.com/plugins/image_tag.rb:29: undefined (?...) sequence: /(?:"|')(?<Title>[^"']+)?(?:"|')\s+(?:"|')(?<alt>[^"']+)?(?:"|')/    from /library/Ruby/Gems/1.8/gems/jekyll-0.11.2/bin/../lib/jekyll/site.rb:76:in `setup'    from /library/Ruby/Gems/1.8/gems/jekyll-0.11.2/bin/../lib/jekyll/site.rb:75:in `each'    from /library/Ruby/Gems/1.8/gems/jekyll-0.11.2/bin/../lib/jekyll/site.rb:75:in `setup'    from /library/Ruby/Gems/1.8/gems/jekyll-0.11.2/bin/../lib/jekyll/site.rb:30:in `initialize'    from /library/Ruby/Gems/1.8/gems/jekyll-0.11.2/bin/jekyll:224:in `new'    from /library/Ruby/Gems/1.8/gems/jekyll-0.11.2/bin/jekyll:224    from /usr/bin/jekyll:23:in `load'    from /usr/bin/jekyll:23

问题是什么?

解决方法 首先,我尝试了irb中的RegEx:

$irbirb(main):001:0> /(?:"|')(?<Title>[^"']+)?(?:"|')\s+(?:"|')(?<alt>[^"']+)?(?:"|')/=> /(?:"|')(?<Title>[^"']+)?(?:"|')\s+(?:"|')(?<alt>[^"']+)?(?:"|')/irb(main):002:0>

我没有错误,但后来我发现服务器上的默认ruby版本是1.8.7.

我从rvm中选择了ruby-1.9.3-p551并将其激活.

我做了以下事情:

rvm use ruby-1.9.3-p551bundle installbundle exec rake generate

这解决了我的错误.

总结

以上是内存溢出为你收集整理的ruby – 生成博客时octopress image_tag插件的SyntaxError全部内容,希望文章能够帮你解决ruby – 生成博客时octopress image_tag插件的SyntaxError所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/1268475.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-08
下一篇 2022-06-08

发表评论

登录后才能评论

评论列表(0条)

保存