I have perused many sites and nothing that has worked for everyone else seems to be working for me.
C:/Users/Holly/Desktop/Brolie>gem install mysql2 Temporarily enhancing
PATH to include DevKit... Building native extensions. This could take
a while... ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.
C:/Ruby200-x64/bin/ruby.exe extconf.rb checking for rb_thread_blocking_region()... yes checking for
rb_wait_for_single_fd()... yes checking for rb_hash_dup()... yes
checking for rb_intern3()... 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=C:/Ruby200-x64/bin/ruby
--with-mysql-dir
--without-mysql-dir
--with-mysql-include
--without-mysql-include=${mysql-dir}/include
--with-mysql-lib
--without-mysql-lib=${mysql-dir}/ extconf.rb:37:in `<main>': undefined method `[]' for nil:NilClass (NoMethodError )
Gem files will remain installed in
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/mysql 2-0.3.13 for inspection.
Results logged to
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/mysql2-0.3.13/ext/mysq
l2/gem_make.out
My DevKit is the correct download. I've tried adding the connector, that didn't do anything. Doing a step by step installation through a class and so I know I'm doing things in the correct order but nothing is helping this error.
That actually seems like a bug on extconf.rb:37 instead of a missing dependency or some compilation problem.
Assuming that you triple-check that your ruby version is supported by this version of the gem and you are using the lastest version supported for your ruby version, I suggest open an issue on github.
Related
I need to build apache ODE 1.3.5 from the source. Building from the source is important for me because we plan to make some changes in the ODE code. I tried out their instructions for building. I was able to install jruby 1.5.1 but I was not able to install buildr 1.4.4 using the said version of jruby. I googled a bit and it seemed like I had to upgrade to jruby 1.6.2. After the newer version of jruby(1.6.2), I was able to install buildr 1.4.4 but when I go to the root of the ODE source and execute the following command
buildr package test=no
I get the below exceptions on the console
LoadError: no such file to load -- rubygems/source_info_cache
require at org/jruby/RubyKernel.java:1038
require at c:/jruby-1.6.2/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29
(root) at c:/jruby-1.6.2/lib/ruby/gems/1.8/gems/buildr-1.4.4-java/lib/buildr/core/application.rb:41
require at org/jruby/RubyKernel.java:1038
require at c:/jruby-1.6.2/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29
(root) at c:/jruby-1.6.2/lib/ruby/gems/1.8/gems/buildr-1.4.4-java/lib/buildr/core/application.rb:17
require at org/jruby/RubyKernel.java:1038
require at c:/jruby-1.6.2/lib/ruby/gems/1.8/gems/buildr-1.4.4-java/lib/buildr/core.rb:29
(root) at c:/jruby-1.6.2/lib/ruby/gems/1.8/gems/buildr-1.4.4-java/lib/buildr.rb:20
require at org/jruby/RubyKernel.java:1038
require at c:/jruby-1.6.2/lib/ruby/gems/1.8/gems/buildr-1.4.4-java/lib/buildr.rb:29
(root) at c:/jruby-1.6.2/lib/ruby/gems/1.8/gems/buildr-1.4.4-java/bin/buildr:18
load at org/jruby/RubyKernel.java:1063
(root) at c:\jruby-1.6.2\bin\buildr:19
I have no idea what I am doing wrong. This is my first interaction with jruby as well as buildr. I appreciate any pointers towards the building of this repository.
Edit 1: Below is the result of jruby -S gem list after installing jruby 1.7.13 and buildr 1.4.19
C:\Users\16030053.CS-6606-DT>jruby -S gem list
*** LOCAL GEMS ***
atoulme-Antwrap (0.7.5 java)
bouncy-castle-java (1.5.0147)
builder (3.2.2)
buildr (1.4.19 java)
bundler (1.15.3)
diff-lcs (1.2.4)
ffi (1.9.3 java)
hoe (3.7.1)
jruby-openssl (0.9.5 java, 0.8.10)
jruby-pageant (1.1.1 java)
jruby-win32ole (0.8.5)
json (1.8.0 java)
json_pure (1.8.0)
krypt (0.0.2)
krypt-core (0.0.2 universal-java)
krypt-provider-jdk (0.0.2)
minitar (0.5.4)
net-sftp (2.1.2)
net-ssh (2.7.0)
orderedhash (0.0.6)
rake (10.1.0, 0.9.2.2)
rdoc (4.0.1)
rspec (2.14.1)
rspec-core (2.14.5)
rspec-expectations (2.14.3)
rspec-mocks (2.14.3)
rubyzip (0.9.9)
xml-simple (1.1.2)
C:\Users\16030053.CS-6606-DT>
Edit 2 When I execute the command buildr package test=no --trace in apache-ode-sources-1.3.5, I get the following errors
F:\apache-ode-sources-1.3.5>buildr package test=no --trace
Buildr aborted!
SyntaxError : F:/apache-ode-sources-1.3.5/tasks/jbi.rake:79: formal argument cannot be an instance variable
Tempfile.open("MANIFEST.MF") { |#jbi_xml_tmp| #jbi_xml_tmp.write descriptor }
^
org/jruby/RubyKernel.java:1081:in `load'
c:/jruby-1.7.13/lib/ruby/gems/shared/gems/buildr-1.4.19-java/lib/buildr/core/application.rb:1:in `(root)'
org/jruby/RubyArray.java:1613:in `each'
c:/jruby-1.7.13/lib/ruby/gems/shared/gems/buildr-1.4.19-java/lib/buildr/core/application.rb:497:in `load_tasks'
c:/jruby-1.7.13/lib/ruby/gems/shared/gems/buildr-1.4.19-java/lib/buildr/core/application.rb:494:in `load_tasks'
c:/jruby-1.7.13/lib/ruby/gems/shared/gems/buildr-1.4.19-java/lib/buildr/core/application.rb:224:in `load_buildfile'
c:/jruby-1.7.13/lib/ruby/gems/shared/gems/buildr-1.4.19-java/lib/buildr/core/application.rb:535:in `standard_exception_handling'
c:/jruby-1.7.13/lib/ruby/gems/shared/gems/buildr-1.4.19-java/lib/buildr/core/application.rb:220:in `load_buildfile'
c:/jruby-1.7.13/lib/ruby/gems/shared/gems/buildr-1.4.19-java/lib/buildr/core/application.rb:130:in `run'
c:/jruby-1.7.13/lib/ruby/gems/shared/gems/buildr-1.4.19-java/lib/buildr/core/application.rb:535:in `standard_exception_handling'
c:/jruby-1.7.13/lib/ruby/gems/shared/gems/buildr-1.4.19-java/lib/buildr/core/application.rb:128:in `run'
org/jruby/RubyKernel.java:1081:in `load'
c:\jruby-1.7.13\bin\buildr:23:in `(root)'
F:\apache-ode-sources-1.3.5>
Below is the response of #sathwik on apache-ode mailing list that helped me compile the ode source for version 1.3.5
Hi Muhammad,
Use jruby 1.7.13 and buildr 1.4.19
Edit file <ode 1.3.5 source>/tasks/jbi.rake. Find and Replace the
initialize method with the content below
def initialize(*args)
super
prepare { path("lib").include((component.libs +
bootstrap.libs).flatten.uniq) }
enhance do
case jbi_xml
when String
path("META-INF").include jbi_xml.path, :as=>"jbi.xml"
when nil, true
# Tempfiles gets deleted on garbage collection, so we're going to
hold on to it
# through instance variable not closure variable.
#jbi_xml_tmp = Tempfile.new('MANIFEST.MF')
#jbi_xml_tmp.write descriptor
path("META-INF").include #jbi_xml_tmp.path, :as=>"jbi.xml"
#jbi_xml_tmp.close
when Proc, Method
#jbi_xml_tmp = Tempfile.new('MANIFEST.MF')
#jbi_xml_tmp.write jbi_xml.call.to_s
path("META-INF").include #jbi_xml_tmp.path, :as=>"jbi.xml"
#jbi_xml_tmp.close
end
end
end
Besides the above changes I had to change line 37 of dependencies.rb
file from
AXIS2_WAR = "org.apache.axis2:axis2-webapp:war:1.3" to
AXIS2_WAR = "org.apache.axis2:axis2-webapp:war:1.6.2"
The above change was needed because all the repositories containing
reference to axis2-webapp:war:1.3 are down. Furthermore, you need to
add following line at the end of repositories.rb file
repositories.remote << "http://people.apache.org/~vanto/m2/"
This is required to fulfill one of the required dependencies namely
xdoclet:xjavadoc-1.1-j5.
I'm trying to install insoshi on my linux OS. However, I continue to get this error message that prevents me from installing it:
LoadError: cannot load such file -- rake/rdoctask
/home/james/insoshi/Rakefile:8:in `<top (required)>'
How do I fix this error in order to install this application?
Here's part of the Rakefile throwing that error:
# inoshi/Rakefile
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
According to this answer:
ERROR: 'rake/rdoctask' is obsolete and no longer supported. Use 'rdoc/task' (available in RDoc 2.4.2+) instead
'rake/rdoctask' is deprecated; try 'rdoc/task'.
FWIW, that project (https://github.com/insoshi/insoshi) has not been updated in six years. Just a suggestion that you might want to consider another tool. There may be a lot of error messages like this ahead.
I have just changed to Fedora 20 and I am trying to get used to it and to learn it. Before I have only worked with ubuntu so there are some new things for me.
I have tried to compile openni_master by downloading the package from git. The first step is to enter
/OpenNi_Master/Platform/Linux/CreateDist/
ans to run
sudo ./RedistMaker .
When I do that I get the following:
fatal error: libusb-1.0/libusb.h: No such file or directory.
So I tried running
sudo yum install libgusb.x86_64.
Running locate libgusb gives the .so files
/usr/lib64/libgusb.so.2
/usr/lib64/libgusb.so.2.0.3
but no libusb-1.0.h.
So I tried downloading the package libusb-1.0.18 from the web and compile it on my computer.
But running ./configure in the folder gives
checking for libudev.h... no
configure: error: "udev support requested but libudev not installed"
So I installed
libgudev1-devel.x86_64
and
libgudev1.x86_64.
Probably I am installing the wrong packages, but I am new to Fedora and I don't really know where to search for them.
Any help is appreciated!
/ Erik
In Fedora (and other distros using yum for package management), you can find out which package provides a certain file like so:
$ yum provides /path/to/my/file
If you only know a portion of the filename, you can use wildcards:
$ yum provides */myfile
So, what provides libusb.h?
$ yum provides */libusb.h
[...]
libusbx-devel-1.0.17-1.fc21.x86_64 : Development files for libusbx
Repo : rawhide
Matched from:
Filename : /usr/include/libusb-1.0/libusb.h
[...]
So you need to install libusbx-devel.
I had a similar problem but libusb.h was present.
# CFLAGS="-O2 -Wall -march=native " ./configure --enable-scrypt --enable-Avalon
...
checking libudev.h usability... no
checking libudev.h presence... no
checking for libudev.h... no
configure: error: "udev support requested but libudev not installed"
configure: error: ./configure failed for compat/libusb-1.0
Fixed by installing an updated libudev:
# yum provides */libudev.h
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: mirrors.clouvider.net
* epel: ftp-stud.hs-esslingen.de
* extras: centos.mirroring.pulsant.co.uk
* rpmforge: fr2.rpmfind.net
* updates: mozart.ee.ic.ac.uk
libudev-devel-147-2.73.el6_8.2.x86_64 : Development files for libudev
Repo : base
Matched from:
Filename : /usr/include/libudev.h
# yum install libudev-devel-147-2.73.el6_8.2.x86_64
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: mirrors.clouvider.net
* epel: ftp-stud.hs-esslingen.de
* extras: centos.mirroring.pulsant.co.uk
* rpmforge: fr2.rpmfind.net
* updates: mozart.ee.ic.ac.uk
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package libudev-devel.x86_64 0:147-2.73.el6_8.2 will be installed
--> Processing Dependency: udev = 147-2.73.el6_8.2 for package: libudev-devel-147-2.73.el6_8.2.x86_64
--> Running transaction check
---> Package udev.x86_64 0:147-2.46.el6 will be updated
---> Package udev.x86_64 0:147-2.73.el6_8.2 will be an update
--> Finished Dependency Resolution
# CFLAGS="-O2 -Wall -march=native " ./configure --enable-scrypt --enable-Avalon
...
checking libudev.h usability... yes
checking libudev.h presence... yes
checking for libudev.h... yes
checking for udev_new in -ludev... yes
i have tried installing Apache Axis2/C on Linux but no success.. with libxml2
Here are my efforts
1) libxml2 was installed successfully
Flags : LIBXML2_CFLAGS = -I/usr/local/include/libxml2
LIBXML2_LIBS='-L/usr/local/lib/hpux32 -lxml2 -lz -lpthread -liconv -lm'
AXIS2C_HOME = /tmp
LD_LIBRARY_PATH = {$LD_LIBRARY_PATH}:$AXIS2C_HOME/lib
Ran --prefix=${AXIS2C_HOME} --enable-libxml2=yes
Installation fails with following error:
checking whether to build libxml2 xml parser library... checking pkg-config is at least version 0.9.0... ./configure[21268]: /local/lib/hpux32.
no
yes
checking for LIBXML2... configure: error: The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.
Alternatively, you may set the environment variables LIBXML2_CFLAGS
and LIBXML2_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
i do not hold pkg-config utility but i have set LIBXML2_CFLAGS and LIBXML2_LIBS, configuration file does not have any information.
can someone please assist here?
Thanks,
Hilesh
Windows XP. Ruby 1.9.2. Rails installed. MySQL installed. When I try to run gem install mysql2 (or bundle install) I get errors:
C:\ruby\cred2>gem install mysql2
Building native extensions. This could take a while...
ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.
C:/Ruby192/bin/ruby.exe extconf.rb
checking for rb_thread_blocking_region()... *** 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:/Ruby192/bin/ruby
C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:368:in `try_do': The complier failed to genera
te an executable file. (RuntimeError)
You have to install development tools first.
from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:435:in `try_link0'
from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:440:in `try_link'
from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:552:in `try_func'
from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:797:in `block in have_func'
from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:693:in `block in checking_for'
from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:280:in `block (2 levels) in postp
one'
from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:280:in `block in postpone'
from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:276:in `postpone'
from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:692:in `checking_for'
from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:796:in `have_func'
from extconf.rb:9:in `<main>'
Gem files will remain installed in C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.
2.4 for inspection.
Results logged to C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.2.4/ext/mysql2/ge
m_make.out
C:\ruby\cred2>
Just for the record: The problem should be solved!
The mysql2 gem v.0.2.6 is out, having win32 support.
gem install mysql2 worked without problems now (DevKit installed).
See: http://github.com/brianmario/mysql2/issues/issue/8#issue/8/comment/479748
I guess that this gem uses C bindings and so has to be compiled. To do that in Windows you'd probably need to have the whole mingw (or possibly cygwin) environment set up. And still, I'm not sure this will help.
You can try to use mysql or ruby-mysql on your Windows machine.
if you haven't installed DevKit yet, this is the way to go.
I did it yesterday it worked perfectly (i have a Win XP box too).
the installation process is relatively straightforward (but well documented)
http://www.rubyinstaller.org/add-ons/devkit/