Igal
Igal

Reputation: 6083

'Pygments gem or one of its dependencies isn't installed' error message

I tried to install this starter project: https://github.com/shakyShane/jekyll-gulp-sass-browser-sync

I have the latest Ruby and Node.js installed. I followed the setup instructions for this starter project: installed jekyll, gulp, ran the npm install command and after that gulp. And when I ran gulp I got this error message:

Dependency Error: Yikes! It looks like you don't have pygments or one of its dependencies installed. In order to use Jekyll as currently configured, you'll need to install this gem. The full error message from Ruby is: 'cannot load such file -- pygments' If you run into trouble, you can find helpful resources at http://jekyllrb.com/help/! Liquid Exception: pygments in C:/work/Web/MySite/_posts/2014-04-20-welcome-to-jekyll.markdown ERROR: YOUR SITE COULD NOT BE BUILT: ------------------------------------ pygments

I tried to install pygments manually: gem install pygments.rb, but it didn't help.

I'm new to Ruby and Jekyll... What went wrong here and how can it be fixed?

UPDATE This is the error message from gem install pygments.rb:

Temporarily enhancing PATH to include DevKit... Building native extensions. This could take a while... ERROR: Error installing pygments.rb: ERROR: Failed to build gem native extension.

current directory: C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/yajl-ruby-1.2.1/ext/yajl C:/Ruby23-x64/bin/ruby.exe -r ./siteconf20160811-6768-1qhknd7.rb extconf.rb creating Makefile

current directory: C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/yajl-ruby-1.2.1/ext/yajl make "DESTDIR=" clean

current directory: C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/yajl-ruby-1.2.1/ext/yajl make "DESTDIR=" generating yajl-x64-mingw32.def compiling yajl.c yajl.c: In function 'yajl_status_to_string': yajl.c:61:1: warning: visibility attribute not supported in this configuration; ignored [-Wattributes]

...more of these yajl_... visibility attribute not supported messages...

c:/ruby23-x64/devkit/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/lib/../lib/dllcrt2.o: file not recognized: File trun cated collect2.exe: error: ld returned 1 exit status make: *** [yajl.so] Error 1

make failed, exit code 2

Gem files will remain installed in C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/yajl-ruby-1.2.1 for inspection.

Results logged to C:/Ruby23-x64/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0/yajl-ruby-1.2.1/gem_make.out

Upvotes: 3

Views: 1256

Answers (1)

Igal
Igal

Reputation: 6083

OK, after a very long time I finally found a solution to the problem I had. Here's what I did:

  1. Completely uninstalled all gems.
  2. Uninstalled Ruby DevTools
  3. Uninstalled Ruby
  4. Re-installed Ruby
  5. Re-installed Ruby DevTools (downloaded it again, apparently my previous download had corrupted files) , changed config.yml to include - C:/Ruby23-x64
  6. Re-installed pygments.rb (this time it went well, without any errors)
  7. Installed Python (very important)
  8. Edited Gulp's _config.yml and changed default highlighter from pygments to rouge
  9. Installed redcarpet gem gem install redcarpet
  10. Ran gulp again and this time it finally worked as expected!

Upvotes: 2

Related Questions