windows ruby install jsduck error - ruby

I am trying to install jsduck on ruby gem, however I got error.
I've downloaded Ruby 2.3.0(x64).
I've also downloaded DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe which is for x64.
I installed the ruby 2.3.0(x64). Then I extracted devkit to "C:/rubydevkit"
I ran the below commands in "C:/rubydevkit" folder :
$ruby dk.rb init
and
$ruby dk.rb install
So far, everything is okay. I installed sass successfully by
$gem install sass
However, when I try
$gem install jsduck
or
$gem install rdiscount --platform=ruby
I got followin error:
$ gem install jsduck
ERROR: Error installing jsduck:
ERROR: Failed to build gem native extension.
current directory: C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/rdiscount-2.1.8/ext
C:/Ruby23-x64/bin/ruby.exe -r ./siteconf20160411-6020-6ayo32.rb extconf.rb
checking for random()... no
checking for srandom()... no
checking for rand()... yes
checking for srand()... yes
checking size of unsigned long... 4
checking size of unsigned int... failed
checking size of unsigned short... 2
no int with size 2
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/Ruby23-x64/bin/$(RUBY_BASE_NAME)
--with-rdiscount-dir
--without-rdiscount-dir
--with-rdiscount-include
--without-rdiscount-include=${rdiscount-dir}/include
--with-rdiscount-lib
--without-rdiscount-lib=${rdiscount-dir}/lib
To see why this extension failed to compile, please check the mkmf.log which can be found here:
C:/Ruby23-x64/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0/rdiscount-2.1.8/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/rdiscount-2.1.8 for inspection.
Results logged to C:/Ruby23-x64/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0/rdiscount-2.1.8/gem_make.out
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
Below are my current versions versions:
Windows 8.1 64bit
$ gem -v
2.5.1
$ ruby -v
ruby 2.3.0p0 (2015-12-25 revision 53290) [x64-mingw32]

Have you tried using a precompiled windows binary?
You're really running into issues with compiling binary extensions for Ruby. Specifically the rdiscount dependency is failing to compile - you might get better help from rdiscount developers.

RDiscount definitely works on Ruby 2.2.2 on Windows (since this is covered by CI) and in Ruby 2.3.0 on Linux (since this is also covered by CI).
But RDiscount + Ruby 2.3.0 + Windows hasn't been tested yet.
See if you can build successfully with Ruby 2.2.2 on your Windows box.

Related

An error occurred while installing "gem" and Bundler cannot continue. Mac OS - big sur

This error happened to me before with nio4r gem when I upgraded to Catalina and #dmitry barskov answered it. A similar issue is happening now after big sur upgrade with json, oj and therubyracer (tried using the solution from nio4r, but no luck). When I run gem list I see the gems installed but bundle install fails. So I tried bundle update json oj therubyracer. it works for json and oj but for therubyracer, it throws errors.
therubyracer error -->
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /Users/me/.gem/gems/therubyracer-0.12.2/ext/v8
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r
./siteconf20210106-9670-edtaxk.rb extconf.rb --with-v8-dir\=/usr/local/opt/v8
checking for -lpthread... yes
checking for -lobjc... yes
checking for v8.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/$(RUBY_BASE_NAME)
--with-pthreadlib
--without-pthreadlib
--with-objclib
--without-objclib
--enable-debug
--disable-debug
--with-v8-dir
--with-v8-include
--without-v8-include=${v8-dir}/include
--with-v8-lib
--without-v8-lib=${v8-dir}/lib
/Users/me/.gem/gems/libv8-3.16.14.19/ext/libv8/location.rb:50:in `configure': By using --with-system-v8, you have chosen to use the version
(Libv8::Location::System::NotFoundError)
of V8 found on your system and *not* the one that is bundled with
the libv8 rubygem.
However, your system version of v8 could not be located.
Please make sure your system version of v8 that is compatible
with 3.16.14.19 installed.
json error -->
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r
./siteconf20210106-29155-126itgi.rb extconf.rb
creating Makefile
current directory: /Users/me/.gem/gems/json-1.8.3/ext/json/ext/generator
make "DESTDIR=" clean
current directory: /Users/me/.gem/gems/json-1.8.3/ext/json/ext/generator
make "DESTDIR="
compiling generator.c
generator.c:861:25: error: use of undeclared identifier 'rb_cFixnum'
} else if (klass == rb_cFixnum) {
^
generator.c:863:25: error: use of undeclared identifier 'rb_cBignum'
} else if (klass == rb_cBignum) {
^
2 errors generated.
make: *** [generator.o] Error 1
make failed, exit code 2
*** LOCAL GEMS ***
bigdecimal (1.2.8)
bundler (1.17.3)
json (1.8.3)
libv8 (3.16.14.17)
oj (2.15.0)
rake (10.4.2)
ref (2.0.0)
therubyracer (0.12.3)
checking for v8.h... no I understand that this maybe an issue, so here's what I've tried to fix it, unsuccessfully ->
brew install v8-315
gem uninstall -a libv8
bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8#3.15)
gem install libv8 -v '3.16.14.17' — —with-system-v8
gem uninstall -a therubyracer
bundle config build.libv8 --with-system-v8
gem install therubyracer -v '0.12.2' -- --with-v8-dir=$(brew --prefix v8#3.15)
When I do bundle update, it gets stuck in resolving dependencies.... I kept it running for 12 hours before I gave up.
When I delete my gemfile.lock, and run bundle install, it gets stuck in resolving dependencies... again.
I'm using ruby v 2.3.1
bundler version 1.17.3
One thing I noticed was the path /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby shows 2.6.0 but I'm using 2.3.1 (confirmed by running rbenv local and ruby -v)
If any other information is needed, please tell me. Any help will be much appreciated.
I ended up deleting the project folder and clone a new one. Removed all gems, reinstalled rbenv like #taylorthurlow pointed out.
Things worked, bundle install was green.

Cant install rails 4.0 using rubyinstaller. *** extconf.rb failed ***

I am trying to install ruby on rails (v4.0) using ruby installer. It is throwing me this error. I am brand new to RoR and some websites told me to install devkit. I have done that. I ran gem install thin
C:\Users\shashid\Downloads>gem install rails
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
C:/RubyRails/bin/ruby.exe extconf.rb
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/RubyRails/bin/ruby
--with-atomic_reference-dir
--without-atomic_reference-dir
--with-atomic_reference-include
--without-atomic_reference-include=${atomic_reference-dir}/include
--with-atomic_reference-lib
--without-atomic_reference-lib=${atomic_reference-dir}/
C:/RubyRails/lib/ruby/2.0.0/mkmf.rb:431:in `try_do': The compiler failed to gene
rate an executable file. (RuntimeError)
You have to install development tools first.
from C:/RubyRails/lib/ruby/2.0.0/mkmf.rb:516:in `try_link0'
from C:/RubyRails/lib/ruby/2.0.0/mkmf.rb:814:in `try_run'
from extconf.rb:22:in `<main>'
Gem files will remain installed in C:/RubyRails/lib/ruby/gems/2.0.0/gems/atomic-
1.1.10 for inspection.
Results logged to C:/RubyRails/lib/ruby/gems/2.0.0/gems/atomic-1.1.10/ext/gem_ma
ke.out
Thank you in advance for your help
You need to install Ruby DevKit if on windows, get it from: http://rubyinstaller.org/downloads/ (scroll down a little).
Same story here deleting ruby and installing:
Ruby 2.0.0-p247
DevKit-mingw64-32-4.7.2-20130224-1151-sfx.exe
from http://rubyinstaller.org/downloads/ solved the problem.
Try to use railsinstaller from http://railsinstaller.org/
it will install follwing
Ruby 1.9.3-p392
Rails 4
Bundler
Git
Sqlite
TinyTDS
SQL Server Support
DevKit
The same can happen when you try to combine 32-bit Ruby and 64-bit DevKit.
The solution is to use same-bit versions.
For instance current versions:
rubyinstaller-2.0.0-p247-x64.exe
DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe

bundle install doesn't work on with RVM

I have a problem installing my bundle.
These were my last steps:
git clone http:...
git checkout -b daniel
bundle install
The error I got was:
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native
extension.
/Users/daniel/.rvm/rubies/ruby-1.9.3-p286/bin/ruby extconf.rb checking for main() in -lpthread... yes checking for main() in
-lobjc... yes
*** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check
the mkmf.log file for more details. You may need configuration
options.
Provided configuration options: --with-opt-dir --without-opt-dir
--with-opt-include --without-opt-include=${opt-dir}/include
--with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog
--without-make-prog --srcdir=. --curdir
--ruby=/Users/daniel/.rvm/rubies/ruby-1.9.3-p286/bin/ruby
--with-pthreadlib --without-pthreadlib --with-objclib
--without-objclib --enable-debug --disable-debug
/Users/daniel/.rvm/gems/ruby-1.9.3-p286/gems/therubyracer-0.11.0/ext/v8/build.rb:50:in
`build_with_rubygem_libv8': undefined local variable or method
`libv8_include_flags' for main:Object (NameError) from
extconf.rb:20:in `<main>'
Gem files will remain installed in
/Users/daniel/.rvm/gems/ruby-1.9.3-p286/gems/therubyracer-0.11.0 for
inspection. Results logged to
/Users/daniel/.rvm/gems/ruby-1.9.3-p286/gems/therubyracer-0.11.0/ext/v8/gem_make.out
An error occurred while installing therubyracer (0.11.0), and Bundler
cannot continue. Make sure that `gem install therubyracer -v '0.11.0'`
succeeds before bundling.
When I tried to run gem install therubyracer -v '0.11.0' I got:
Building native extensions. This could take a while... ERROR: Error
installing therubyracer: ERROR: Failed to build gem native extension.
/Users/daniel/.rvm/rubies/ruby-1.9.3-p286/bin/ruby extconf.rb checking for main() in -lpthread... yes checking for main() in
-lobjc... yes
*** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check
the mkmf.log file for more details. You may need configuration
options.
Provided configuration options: --with-opt-dir --without-opt-dir
--with-opt-include --without-opt-include=${opt-dir}/include
--with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog
--without-make-prog --srcdir=. --curdir
--ruby=/Users/daniel/.rvm/rubies/ruby-1.9.3-p286/bin/ruby
--with-pthreadlib --without-pthreadlib --with-objclib
--without-objclib --enable-debug --disable-debug
/Users/daniel/.rvm/gems/ruby-1.9.3-p286/gems/therubyracer-0.11.0/ext/v8/build.rb:50:in
`build_with_rubygem_libv8': undefined local variable or method
`libv8_include_flags' for main:Object (NameError) from
extconf.rb:20:in `<main>'
Gem files will remain installed in
/Users/daniel/.rvm/gems/ruby-1.9.3-p286/gems/therubyracer-0.11.0 for
inspection. Results logged to
/Users/daniel/.rvm/gems/ruby-1.9.3-p286/gems/therubyracer-0.11.0/ext/v8/gem_make.out
I am working on Mac OS 10.7.5. Xcode and its command line tools and Rails are up to date.
SQLite 3 is also installed.
Can anyone help me?
EDIT:
I also tried to delete the repository and to clone it again, with the same errors.
EDIT:
Is the installation path of Rails and Sqlite3 correct?
daniel:~
daniel$ sudo gem update --system Latest version currently
installed. Aborting.
daniel:~
daniel$ sudo gem install rails
Fetching:
rails-3.2.11.gem (100%) Successfully installed
rails-3.2.11 1 gem installed
Installing ri documentation for rails-3.2.11...
Installing RDoc documentation for rails-3.2.11...
daniel:~
daniel$ sudo gem install sqlite3
Fetching: sqlite3-1.3.7.gem (100%)
Building native extensions. This could take a while...
Successfully installed sqlite3-1.3.7 1 gem installed
Installing ri documentation for sqlite3-1.3.7...
Installing RDoc documentation for sqlite3-1.3.7...
daniel:~
daniel$ which ruby irb gem rake
/Users/daniel/.rvm/rubies/ruby-1.9.3-p286/bin/ruby
/Users/daniel/.rvm/rubies/ruby-1.9.3-p286/bin/irb
/Users/daniel/.rvm/rubies/ruby-1.9.3-p286/bin/gem
/Users/daniel/.rvm/gems/ruby-1.9.3-p286/bin/rake
At least one problem is that you are running RVM, but used sudo to install gems on your system.
Read "RVM and RubyGems", especially the part that says:
"DO NOT use sudo..."
RVM creates a sandbox for you, the user, in your own user-space on a machine, that allows you to manage it without needing to be the system administrator. In other words, that means you don't have to use sudo for any RVM or gems management.
If you do use sudo, you temporarily cease being you, the user, and become the administrator, with administrator privileges and the administrator's environment, which does NOT include the RVM sandbox in your /Users/daniel/.rvm/rubies/ruby-1.9.3-p286 path. Knowledge of the sandbox is carried by the PATH in your environment, which the root on your machine doesn't use. Gems installed inside that sudo sub-shell get installed into the location that the administrator account knows about, which is inside the System Ruby installation, which is why your RVM sandboxed Ruby doesn't see them: There is no crossover between the System's Ruby and your RVM-controlled RUby. That's the whole idea of a sandbox: separation of the elements and resources to avoid contamination.
You could have figured this all out by looking at the output of:
which ruby irb gem rake
The path for all of them is pointing to your sandbox:
/Users/daniel/.rvm/rubies
On a Mac OS system, that command should have reported:
/usr/bin/ruby
/usr/bin/irb
/usr/bin/gem
/usr/bin/rake
Reinstall Rails and the SQLite gem using:
gem install rails sqlite3
and see how your bundle behaves.
And, by the way, do NOT use sudo to deliberately try to manage/delete the System installed Ruby. That was installed by Apple for their own purposes, to enable software they installed. It's OK to take advantage of its existence, but it's there for their use. Use a RVM-managed Ruby for your own purposes.

Problems with jslint-v8 Ruby gem installation on Windows7 64-bit

There is a problem during Rally App SDK 2.0p environment setup on Windows 7 (64-bit). I have installed Ruby 1.8.7-p358 from rubyinstaller.org and managed to install rake Ruby gem. But I have problems installing jslint-v8 gem. It has dependencies on therubyracer and libv8 gems which need to be built using Ruby DevKit. During the installation I got the following error:
C:\ruby> gem install jslint-v8
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing jslint-v8:
ERROR: Failed to build gem native extension.
C:/ruby/bin/ruby.exe extconf.rb
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/ruby/bin/ruby
extconf.rb:13: uninitialized constant Gem (NameError)
Checking for Python...
Gem files will remain installed in C:/ruby/lib/ruby/gems/1.8/gems/libv8-3.3.10.4 for inspection.
Results logged to C:/ruby/lib/ruby/gems/1.8/gems/libv8-3.3.10.4/ext/libv8/gem_make.out
Does anyone know how to install it correctly in Win7?
Thank you!
The gem you try to install depends on libv8 gem, which is nothing more than a wrapper for Google V8 JavaScript VM.
There is no pre-compiled libv8 for Windows (like there is for Linux or OSX), this means it needs to build V8 from scratch.
The code around the build process of V8 is not very portable, not to mention that to compile libv8 you need Python installed :-P
Until today nobody was able to follow the instructions for libv8 pre-compilation on Windows, following the repository instructions:
https://github.com/cowboyd/libv8
Sorry not been able to provide you a better response.
Try this gem install libv8 -v '3.16.14.3' -- --with-system-v8
Reference: Error installing libv8: ERROR: Failed to build gem native extension
For building gem native extensions in Windows when you install a gem, you usually need the DevKit installed too:
http://rubyinstaller.org/downloads/ - go to the devkit download link
Their github page has instructions for installing it: https://github.com/oneclick/rubyinstaller/wiki/Development-Kit
I would also recommend using Ruby 1.9.3 instead of 1.8.7, but that shouldn't be much of an issue
Hope that helps.

Error when installing dm-mysql-adapter

I am very new to Ruby . I installed DataMapper and I am trying to install dm-mysql-adapter-1.0.2 gem . But when I try to install , I get the below error . I am using ubuntu OS .
vinoth#vinoth-laptop:~/Downloads$ gem install dm-mysql-adapter-1.0.2 -- --with-mysql- lib=/usr/lib/mysql -- --with-mysql-conf=/usr/bin/mysql
WARNING: Installing to ~/.gem since /home/vinoth/gems and
/home/vinoth/gems/bin aren't both writable.
WARNING: You don't have /home/vinoth/.gem/ruby/1.8/bin in your PATH,
gem executables will not run.
Building native extensions. This could take a while...
ERROR: Error installing dm-mysql-adapter-1.0.2:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb --with-mysql-lib=/usr/lib/mysql -- --with-mysql- conf=/usr/bin/mysql
checking for mysql_query() in -lmysqlclient... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
- ........
Gem files will remain installed in /home/vinoth/.gem/ruby/1.8/gems/do_mysql-0.10.2 for inspection.
Results logged to /home/vinoth/.gem/ruby/1.8/gems/do_mysql-0.10.2/ext/do_mysql/gem_make.out
Am I missing something ?
Additional information .
Ruby Version : ruby 1.8.7 (2010-01-10 patchlevel 249) [i486-linux]
Gem Version : 1.3.5
You need to have mysql dev package installed:
sudo apt-get install libmysqlclient-dev
Should do the trick

Resources