SyntaxError in octopress image_tag plugin when creating a blog

I use octopress for my tech blog. I updated my octopress codes from the official octopress repository and I get an error when I run rake generate :

  |1.9.3-p194| home in ~/Documents/work/git/muratcorlu.github.com Β± |source βœ“| β†’ rake generate ## Generating Site with Jekyll directory 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 

What is the problem?

+4
source share
1 answer

First I tried RegEx in irb:

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

I have no errors, but then I found out that my default ruby ​​version on the server was 1.8.7.

I selected ruby-1.9.3-p551 from rvm and made it active.

I have done the following:

 rvm use ruby-1.9.3-p551 bundle install bundle exec rake generate 

This resolved the error for me.

+1
source

Source: https://habr.com/ru/post/1447064/


All Articles