I am a newbie. I am trying to build capybara-webkit (0.8.0) with native extensions on window 7. I already installed (path set):RubyMine, Ruby SDK and Gems, Rails, DevKit, Qt, gmake, g++. But I still got the following error msg. Any help is greatly appreciated.
$ gem install capybara-webkit -v '0.8.0'
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing capybara-webkit:
ERROR: Failed to build gem native extension.
c:/Ruby193/bin/ruby.exe extconf.rb
c:\Qt\4.8.2\bin\qmake.EXE
c:\make\gmake.EXE
cd src/ && c:/Qt/4.8.2/bin/qmake.exe c:/Ruby193/lib/ruby/gems/1.9.1/gems/capybara-webkit-0.8.0/src/webkit_server.pro -spec c:/Qt/4.8.2/mkspecs/macx-g++ -o Makef\ile.webkit_server
c:\make\gmake.EXE
cd src/ && gmake -f Makefile.webkit_server
gmake[1]: Entering directory `c:/Ruby193/lib/ruby/gems/1.9.1/gems/capybara-webkit-0.8.0/src'
g++ -c -pipe -g -Wall -W -DQT_WEBKIT_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -Ic:/Qt/4.8.2/mkspecs/macx-g++ -I. -Ic:/Qt/4.8.2/include/QtCore -Ic:/Qt/4.8.2/include/QtNetwork -Ic:/Qt/4.8.2/include/QtGui -Ic:/Qt/4.8.2/include/QtWebKit -Ic:/Qt/4.8.2/include -I. -o RequestedUrl.o RequestedUrl.cpp
process_begin: CreateProcess((null), g++ -c -pipe -g -Wall -W -DQT_WEBKIT_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -Ic:/Qt/4.8.2/mkspecs/macx-g++ -I. -Ic:/Qt/4.8.2/include/QtCore -Ic:/Qt/4.8.2/include/QtNetwork -Ic:/Qt/4.8.2/include/QtGui -Ic:/Qt/4.8.2/include/QtWebKit -Ic:/Qt/4.8.2/include -I. -o RequestedUrl.o Req
uestedUrl.cpp, ...) failed.
make (e=2): The system cannot find the file specified.
gmake[1]: * [RequestedUrl.o] Error 2
gmake[1]: Leaving directory c:/Ruby193/lib/ruby/gems/1.9.1/gems/capybara-webkit-0.8.0/src'
c:/Ruby193/lib/ruby/1.9.1/fileutils.rb:1515:instat': No such file or directory
- src/webkit_server (Errno::ENOENT)
from c:/Ruby193/lib/ruby/1.9.1/fileutils.rb:1515:in block in fu_each_src_dest'
from c:/Ruby193/lib/ruby/1.9.1/fileutils.rb:1529:infu_each_src_dest0'
from c:/Ruby193/lib/ruby/1.9.1/fileutils.rb:1513:in fu_each_src_dest'
from c:/Ruby193/lib/ruby/1.9.1/fileutils.rb:395:incp'
from c:/Ruby193/lib/ruby/gems/1.9.1/gems/capybara-webkit-0.8.0/lib/capybara_webkit_builder.rb:33:in build'
from c:/Ruby193/lib/ruby/gems/1.9.1/gems/capybara-webkit-0.8.0/lib/capybara_webkit_builder.rb:39:inbuild_all'
from extconf.rb:2:in `'
Gem files will remain installed in c:/Ruby193/lib/ruby/gems/1.9.1/gems/capybara-webkit-0.8.0 for inspection.
Results logged to c:/Ruby193/lib/ruby/gems/1.9.1/gems/capybara-webkit-0.8.0/./gem_make.out
I was getting similar errors to this, as well as errors such as:
g++.exe: unrecognized option '-headerpad_max_install_names'
make[1]: Leaving directory /ruby/gems/shared/gems/capybara-webkit-0.12.1/src'
Errno::ENOENT: No such file or directory - C:/JRuby/lib/ruby/gems/shared/gems/capybara-webkit-0.12.1/src/webkit_server
LoadError: no such file to load
No such file or directory - C:/Ruby/capybara-webkit-0.12.1/src/webkit_server
Basically the answer to all these errors is to do with the version of capybara-webkit that you install on Windows depending on exactly the right versions of QT, and the right version of the g++ compiler included in mingw toolset. The right versions have to be installed and the correct bin directories added to your windows path.
Plus, there are issues with RbConfig::CONFIG['host_os'] which on windows 8 returns "mswin32" and not "mingw32". Therefore you have to fix capybara_webkit_builder.rb and spec_helper.rb to the following: /mingw32|mswin32/. If you don't do this then you will run macx-g++ which won't work on windows. You have to run win32-g++ on windows.
If you're using JRuby, then the RUBY_PLATFORM is set to "java". Therefore you have to change corresponding capybara_webkit_builder.rb and connection.rb to /mingw32|java/. If you don't do this, then the binary will compile (but with a bug in connection) but the compiler will crash out with the can't find the webkit-server error.
You have to follow the install script at https://github.com/thoughtbot/capybara-webkit/wiki/Installing-Qt-and-compiling-capybara-webkit
At the final instruction on windows, you have to "cd" to the gem directory and then run
bundle exec gem install capybara-webkit-0.12.1.gem
or whichever version you have built.
So, the answers are get all the right versions of each dependency, fix the bugs, ensure the windows path variable points to the right versions of g++ compilers (don't forget to restart cmd after you've changed the path variable) and then ensure you're in the right directory when you run commands.
Related
I get the error oci.h missing on running the installation:
cpan DBD::Oracle on OS X 10.8.
How can I fix this?
The specific error message is:
/usr/bin/perl -p -e "s/~DRIVER~/Oracle/g" /Library/Perl/5.12/darwin-thread-multi- 2level/auto/DBI/Driver.xst > Oracle.xsi
/usr/bin/perl /System/Library/Perl/5.12/ExtUtils/xsubpp -typemap /System/Library/Perl/5.12/ExtUtils/typemap -typemap typemap Oracle.xs > Oracle.xsc && mv Oracle.xsc Oracle.c
clang -c -I/Library/Perl/5.12/darwin-thread-multi-2level/auto/DBI -arch i386 -arch x86_64 -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector -I/usr/local/include -Os -DVERSION=\"1.68\" -DXS_VERSION=\"1.68\" "-I/System/Library/Perl/5.12/darwin-thread-multi-2level/CORE" -Wall -Wno-comment -DUTF8_SUPPORT -DORA_OCI_VERSION=\"11.2.0.3\" -DORA_OCI_102 -DORA_OCI_112 Oracle.c
In file included from Oracle.xs:1:
./Oracle.h:37:10: fatal error: 'oci.h' file not found
I had the same issue and I managed to solve it by adding the include directory of the oracle instance client sdk to C_INCLUDE_PATH env variable and installing it from the source directory:
tar xzf DBD-Oracle-1.74.tar.gz
cd DBD-Oracle-1.74
export C_INCLUDE_PATH="/opt/oracle/instantclient_12_2/sdk/include"
perl Makefile.PL
make
make install
It looks like you're trying to install DBD::Oracle without having installed the appropriate Oracle client prerequisite. Consult DBD::Oracle::Troubleshooting::Macos, DBD::Oracle installation nodes, ensure that the require environment variables are setup. It's easier to install this module outside of the cpan tool.
When installing Jekyll from gem using gem install jekyll, I am getting the following build error. I am using Cygwin on Windows 7 and have built the posix-spawn gem from source prior to installing.
Building native extensions. This could take a while...
ERROR: Error installing jekyll-1.1.2.gem:
ERROR: Failed to build gem native extension.
/usr/bin/ruby.exe extconf.rb
creating Makefile
make
gcc -I. -I/usr/include/ruby-1.9.1/x86_64-cygwin -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I. -ggdb -O2 -pipe -fno-strict-aliasing -o porter.o -c porter.c
gcc -I. -I/usr/include/ruby-1.9.1/x86_64-cygwin -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I. -ggdb -O2 -pipe -fno-strict-aliasing -o porter_wrap.o -c porter_wrap.c
rm -f stemmer.so
gcc -shared -o stemmer.so porter.o porter_wrap.o -L. -L/usr/lib -L. -Wl,--export-all-symbols -Wl,--enable-auto-image-base,--enable-auto-import -lruby191 -lpthread -lrt -ldl -lcrypt
/usr/lib/gcc/x86_64-pc-cygwin/4.8.1/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lcrypt
collect2: error: ld returned 1 exit status
Makefile:214: recipe for target `stemmer.so' failed
make: *** [stemmer.so] Error 1
Gem files will remain installed in /usr/lib/ruby/gems/1.9.1/gems/fast-stemmer-1.0.2 for inspection.
Results logged to /usr/lib/ruby/gems/1.9.1/gems/fast-stemmer-1.0.2/ext/gem_make.out
I am using gem v2.0.7, ruby v1.9.3p448, gcc v4.8.1 and g++ v4.8.1
Any ideas? I have no idea when it comes to Ruby gems. I cannot find any information on this "stemmer".
Dan
Turns out the crux of this error was in the cannot find -lcrypt. I installed libcrypt-devel and the gem compiled fine after that.
I think on most native Linux distros, this lib will already be included!
Yeah, Thanks, I installed :-).
Please installing 'libcrypt-devel' in cygwin
Im trying to install chef-solo on CentOS 6.3 x64 and when I run:
sudo chef-solo -c /etc/chef/solo.rb -j ~/chef.json -r http://s3.amazonaws.com/chef-solo/bootstrap-latest.tar.gz
I'm getting this output:
g++ -I. -ffast-math -fno-strict-aliasing -O3 -fvisibility=hidden -ggdb -pipe -Wall -Wextra -fPIC -pthread -DNDEBUG \
-c -o gecode/int/extensional.o gecode/int/extensional.cpp
make[1]: Leaving directory `/tmp/chef-solo/gecode-3.5.0'
STDERR: {standard input}: Assembler messages:
{standard input}:13822: Warning: end of file not at end of a line; newline inserted
{standard input}:14946: Error: unknown pseudo-op: `.'
{standard input}:14946: Error: open CFI at the end of file; missing .cfi_endproc directive
g++: Internal error: Killed (program cc1plus)
Please submit a full bug report.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
make[1]: *** [gecode/int/extensional.o] Error 1
make: *** [compilelib] Error 2
---- End output of "bash" "/tmp/chef-script20120904-19809-1ofhwoq" ----
Ran "bash" "/tmp/chef-script20120904-19809-1ofhwoq" returned 2
I can install gecode from the RBEL6 repo without any problems but the cookbook attempts to install from source. I found this pull request on github which attempts to install from the RBEL repo but I got an error saying that the repository metadata couldn't be found. Anyone know what to do?
Since I have been searching for an answer to this, my findings were rather ... unsurprising.
I simply ran out of memory. I had to compile my files on another system with the same OS (copied over /tmp/chef-solo/gecode-3.5.0 to the box and just ran make) and synced the resulting folder back to run make install
Once the library is found the compile step is skipped and you should be good to continue.
I'm using RVM 1.13.4 on Mac OS 10.6.8, with XCode 3.2.6. The upgrade to Snow Leopard was fairly recent, and I believe that's when I started having this problem.
When I run rvm pkg install libyaml, I get the following error:
Fetching yaml-0.1.4.tar.gz to /Users/tsherif/.rvm/archives
Extracting yaml-0.1.4.tar.gz to /Users/tsherif/.rvm/src
Prepare yaml in /Users/tsherif/.rvm/src/yaml-0.1.4.
Configuring yaml in /Users/tsherif/.rvm/src/yaml-0.1.4.
Compiling yaml in /Users/tsherif/.rvm/src/yaml-0.1.4.
Error running 'make ', please read /Users/tsherif/.rvm/log/yaml/make.log
Database file /Users/tsherif/.rvm/config/packages does not exist.
Not sure what the story is with config/packages. The make.log file contains the following:
[2012-05-06 05:37:14] make
make all-recursive
Making all in include
make[2]: Nothing to be done for `all'.
Making all in src
/bin/sh ../libtool --tag=CC --mode=compile /usr/bin/gcc-4.2 -DHAVE_CONFIG_H -I. -I.. -I../include -g -O2 -MT api.lo -MD -MP -MF .deps/api.Tpo -c -o api.lo api.c
../libtool: line 787: X--tag=CC: command not found
../libtool: line 820: libtool: ignoring unknown tag : command not found
../libtool: line 787: X--mode=compile: command not found
../libtool: line 953: *** Warning: inferring the mode of operation is deprecated.: command not found
../libtool: line 954: *** Future versions of Libtool will require --mode=MODE be specified.: command not found
../libtool: line 984: libtool: warning: cannot infer operation mode from `/usr/bin/gcc-4.2': No such file or directory
../libtool: line 7011: libtool: you must specify a MODE: command not found
../libtool: line 7012: Try `libtool --help' for more information.: command not found
make[2]: *** [api.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
It seems like the shell is trying to execute arguments to libtool as commands before passing them to libtool? The commands aren't found so the string command not found is passed to libtool, which then spews out a bunch of error output that sh tries to execute and, of course, fails to do. Does it maybe have something to do with the Xs that seem to be added to the --tag and --mode options? That's my best guess, anyway, given my limited understanding of libtool and make.
I've tried adding the following options, based on similar questions I've seen on SO, but to no avail:
--with-gcc=clang
--enable-shared
I've also tried installing libyaml separately (without RVM) using both MacPorts and compiling from source, but neither worked. And oddly enough, if I install Psych as a gem after installing Ruby, there's no problem (but I do want it compiled with Ruby).
Have you tried installing with Homebrew? It makes most dependency packages very easy to install, then run brew install libyaml.
I have tried to install ruby-opencv and I can't get it to work.
I am running fedora 15 with rvm using ruby 1.8.7
I have tried this fork as it seems most up to date:
https://github.com/ser1zw/ruby-opencv
I have installed the packages opencv and opencv-devel both of which are version 2.2
When I try to compile the native extensions by running:
ruby extconf.rb
I get the error:
>> check require headers...
checking for core/core_c.h... no
*** extconf.rb failed ***
The mkmf.log file provides this information:
have_header: checking for core/core_c.h... -------------------- no
"gcc -E -I. -I/home/derek/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/x86_64-linux -I. -I/usr
/include -I/usr/local/include -I/usr/local/include/opencv2 -g -O2 -fPIC conftest.c -o conftest.i"
conftest.c:1:25: fatal error: core/core_c.h: No such file or directory
compilation terminated.
checked program was:
/* begin */
1: #include <core/core_c.h>
/* end */
does anyone know how to fix this error?
Did you check where opencv-devel was installed?
This is from the github page:
ruby extconf.rb \
--with-opencv-lib=/opt/local/lib \
--with-opencv-include=/opt/local/include/opencv2
Notice the -I lines on your compilation message, they did not include those locations. So double-check where opencv-devel went to, and fix the locations with the --with-opencv flags.