Dependency Error: Yikes! It looks like you don't have _plugins/lunrjs/jekyll_lunr_js_search.rb or one of its dependencies installed - jekyll

When compiling Jekyll project with plugin jekyll_lunr_js_search always getting following error in windows. However it compiles on gitlabci.
Dependency Error: Yikes! It looks like you don't have D:/myproject/_plugins/lunrjs/jekyll_lunr_js_search.rb 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 -- v8' If you run into trouble, you can find helpful resources at https://jekyllrb.com/help/!
Upon using gem install jekyll-lunr-js-search following error:
C:\MyProj>gem install jekyll-lunr-js-search
Fetching: json-2.0.3.gem (100%)
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
Successfully installed json-2.0.3
Fetching: ref-2.0.0.gem (100%)
Successfully installed ref-2.0.0
Fetching: libv8-3.16.14.19.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing jekyll-lunr-js-search:
ERROR: Failed to build gem native extension.
current directory: C:/APPs/Ruby23-x64/lib/ruby/gems/2.3.0/gems/libv8-3.16.14.19/ext/libv8
C:/APPs/Ruby23-x64/bin/ruby.exe -r ./siteconf20170310-14120-1y669dw.rb extconf.rb
creating Makefile
The system cannot find the path specified.
C:/APPs/Ruby23-x64/lib/ruby/gems/2.3.0/gems/libv8-3.16.14.19/ext/libv8/builder.rb:86:in `setup_python!': libv8 requires python 2 to be installed in order to build, but it is currently 3.4.4 (RuntimeError)
from C:/APPs/Ruby23-x64/lib/ruby/gems/2.3.0/gems/libv8-3.16.14.19/ext/libv8/builder.rb:53:in `build_libv8!'
from C:/APPs/Ruby23-x64/lib/ruby/gems/2.3.0/gems/libv8-3.16.14.19/ext/libv8/location.rb:24:in `install!'
from extconf.rb:7:in `<main>'
extconf failed, exit code 1
Gem files will remain installed in C:/APPs/Ruby23-x64/lib/ruby/gems/2.3.0/gems/libv8-3.16.14.19 for inspection.
Results logged to C:/APPs/Ruby23-x64/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0/libv8-3.16.14.19/gem_make.out
** FILE CONTENTS (gem_make.out)**
current directory: C:/APPs/Ruby23-x64/lib/ruby/gems/2.3.0/gems/libv8-3.16.14.19/ext/libv8
C:/APPs/Ruby23-x64/bin/ruby.exe -r ./siteconf20170310-14120-1y669dw.rb extconf.rb
creating Makefile
The system cannot find the path specified.
C:/APPs/Ruby23-x64/lib/ruby/gems/2.3.0/gems/libv8-3.16.14.19/ext/libv8/builder.rb:86:in `setup_python!': libv8 requires python 2 to be installed in order to build, but it is currently 3.4.4 (RuntimeError)
from C:/APPs/Ruby23-x64/lib/ruby/gems/2.3.0/gems/libv8-3.16.14.19/ext/libv8/builder.rb:53:in `build_libv8!'
from C:/APPs/Ruby23-x64/lib/ruby/gems/2.3.0/gems/libv8-3.16.14.19/ext/libv8/location.rb:24:in `install!'
from extconf.rb:7:in `<main>'
extconf failed, exit code 1
NOTE:
I've both python v2 and v3 installed and working fine. Tested python shell using py -2 output follows:
C:\>py -2
Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:53:40) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>

If you look into the lib directory, you'll see that the ruby file is jekyll-lunr-js-search.rb instead of jekyll_lunr_js_search.rb. Moreover, it is also available as a Rubygem package.
Simply add the gem to the :jekyll_plugins group in your Gemfile, run bundle install and proceed building / serving with Jekyll.

Related

Installing gem json 2.2.0 failed - windows

I got an error trying to install gem json 2.2.0 to my project, so I look for many sites and tutorials but nothing help me with windows.
Please see the problem below:
Fetching json 2.2.0
Installing json 2.2.0 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory:
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/json-2.2.0/ext/json/ext/generator
C:/Ruby24-x64/bin/ruby.exe -I C:/Ruby24-x64/lib/ruby/site_ruby/2.4.0 -r
./siteconf20190412-3460-119pn5l.rb extconf.rb
creating Makefile
current directory:
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/json-2.2.0/ext/json/ext/generator
make "DESTDIR=" clean
current directory:
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/json-2.2.0/ext/json/ext/generator
make "DESTDIR="
make failedNo such file or directory - make "DESTDIR="
Gem files will remain installed in
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/json-2.2.0 for inspection.
Results logged to
C:/Ruby24-x64/lib/ruby/gems/2.4.0/extensions/x64-mingw32/2.4.0/json-2.2.0/gem_make.out
An error occurred while installing json (2.2.0), and Bundler cannot continue.
Make sure that `gem install json -v '2.2.0' --source 'https://rubygems.org/'`
succeeds before bundling.
In Gemfile:
calabash-android was resolved to 0.9.8, which depends on
luffa was resolved to 2.1.0, which depends on
json
For ubuntu the solution was: install libgmp3-dev.
For macOS the solution was: use XCode
But I found nothing for windows. Should be a solution to use RVM? If yes, how can I install it on Windows?
I really appreciate your help!

Why can't I install json -v '1.8.3' on Windows 10?

When trying to install this gem, I receive the following:
Temporarily enhancing path to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing json:
ERROR: Failed to build gem native extension
C:/Ruby22-x64/bin/ruby.exe -r ./siteconf20161103-12844-13cqnmb.rb extconf.rb creating Makefile
make "DESTDIR=" clean
'make' is not recognized as an internal or external command, operable program, or batch file.
make "DESTDIR="
'make is not recognized as an internal or external command, operable program, or batch file.
make failed, exit code 1
Gem files will remain installed in C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/json-1.8.3 for inspection.
Results logged to C:/Ruby22-x64/lib/ruby/gems/2.2.0/extensions/x64-mingw32/2.2.0/json-1.8.3/gem_make.out
The gem_make.out file is not in that folder. This is the last gem I need to install. What do I need to do to resolve this?

Can't install json (Ruby doesn't work)

windows 10. ruby 2.2.4. I've tried all the devkit stuff and whatever to fix this. I've looked stuff up for hours and hours with no success. When I try to bundle it doesn't install json. When I try to install json it says
"Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing json:
ERROR: Failed to build gem native extension.
C:/Ruby22-x64/bin/ruby.exe -r ./siteconf20160303-4132-alefq2.rb extconf.rb
creating Makefile
make "DESTDIR=" clean
'make' is not recognized as an internal or external command,
operable program or batch file.
make "DESTDIR="
'make' is not recognized as an internal or external command,
operable program or batch file.
make failed, exit code 1
Gem files will remain installed in C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/json-1.8.3 for inspection.
Results logged to C:/Ruby22-x64/lib/ruby/gems/2.2.0/extensions/x64-mingw32/2.2.0/json-1.8.3/gem_make.out"
I was facing the same problem. The Gemfile.lock in the repo I cloned had a json version older than the one I had already installed. I did not manage to uninstall the newer version, but I did replace the old version number in the Gemfile.lock with the new one and it seems to work now.
You should run the devkit installation scripts.
In particular, pay attention to devkitvars.bat.

How to enable C extensions error in Jruby?

I am getting the following error and dont know how to solve this. Can someone simplify this process?
My Jruby is installed in
C:/jruby-1.7.13/bin
my project is in
C:/Users/myname/downloads/projectdirectory
The error is when I do
bundle install
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
c:/jruby-1.7.13/bin/jruby.exe extconf.rb
NotImplementedError: C extension support is not enabled. Pass -Xcext.enabled=true to JRuby or set JRUBY_OPTS.
(root) at c:/jruby-1.7.13/lib/ruby/shared/mkmf.rb:8
require at org/jruby/RubyKernel.java:1065
(root) at c:/jruby-1.7.13/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:1
(root) at extconf.rb:2
Gem files will remain installed in c:/jruby-1.7.13/lib/ruby/gems/shared/gems/pg-0.17.0 for inspection.
Results logged to c:/jruby-1.7.13/lib/ruby/gems/shared/gems/pg-0.17.0/ext/gem_make.out
An error occurred while installing pg (0.17.0), and Bundler cannot continue.
Make sure that `gem install pg -v '0.17.0'` succeeds before bundling.
C- extensions are not really supported in JRuby and were actually dropped in the 1.7.x line ...
thus despite the message mentioning -Xcext.enabled=true won't help you!
since it's pg you're trying, there's a jruby alternative that uses a Java API instead of C pg_jruby, alternatively if you're using active-record look for activerecord-jdbc-adapter + jdbc-postgres

Installing ruby-oci8 with jruby

Trying to install ruby-oci8 with jruby gemset. It's giving me below error
I've tried to use export JRUBY_OPTS="--1.9 -Xcext.enabled=true" as suggested in other similar questions with no luck.
$ jruby -S gem install ruby-oci8
Fetching: ruby-oci8-2.1.7.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing ruby-oci8:
ERROR: Failed to build gem native extension.
/home/user/.rvm/rubies/jruby-1.7.5/bin/jruby extconf.rb
/home/user/.rvm/rubies/jruby-1.7.5/lib/ruby/shared/mkmf.rb:14: Use RbConfig instead of obsolete and deprecated Config.
mkmf.rb can't find header files for ruby at /home/user/.rvm/rubies/jruby-1.7.5/lib/native/include/ruby/ruby.h
Gem files will remain installed in /home/oracle/.rvm/gems/jruby-1.7.5/gems/ruby-oci8-2.1.7 for inspection.
Results logged to /home/oracle/.rvm/gems/jruby-1.7.5/gems/ruby-oci8-2.1.7/ext/oci8/gem_make.out
We can use JDBC, instead of oci8. oci8 needs c extenssions which has been deprecated in jruby.
See this for a working example :: https://gist.github.com/rogerleite/217543