So I'm on Fedora 17 trying to install Capybara Webkit. I followed the directions here and did a bundle install for another (near-identical) branch of this project, so I know it works.
When I try to bundle install, it has this error. Anyone have thoughts, or should I just log a bug with co?
Installing capybara-webkit (0.12.1)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
-- SNIP --
g++ -c -pipe -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_WEBKIT_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/lib/qt4/mkspecs/linux-g++ -I. -I/usr/include/QtCore -I/usr/include/QtNetwork -I/usr/include/QtGui -I/usr/include/QtWebKit -I/usr/include -I. -o WebPage.o
WebPage.cpp
WebPage.cpp: In member function ‘bool WebPage::render(const QString&)’:
WebPage.cpp:148:3: error: ‘QFileInfo’ was not declared in this scope
WebPage.cpp:148:13: error: expected ‘;’ before ‘fileInfo’
WebPage.cpp:149:3: error: ‘QDir’ was not declared in this scope
WebPage.cpp:149:8: error: expected ‘;’ before ‘dir’
WebPage.cpp:150:3: error: ‘dir’ was not declared in this scope
WebPage.cpp:150:14: error: ‘fileInfo’ was not declared in this scope
make[1]: *** [WebPage.o] Error 1
make[1]: Leaving directory `/usr/local/rvm/gems/ruby-1.9.3-p286/gems/capybara-webkit-0.12.1/src'
make: *** [sub-src-webkit_server-pro-make_default-ordered] Error 2
make
cd src/ && make -f Makefile.webkit_server
make[1]: Entering directory `/usr/local/rvm/gems/ruby-1.9.3-p286/gems/capybara-webkit-0.12.1/src'
g++ -c -pipe -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_WEBKIT_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/lib/qt4/mkspecs/linux-g++ -I. -I/usr/include/QtCore -I/usr/include/QtNetwork -I/usr/include/QtGui -I/usr/include/QtWebKit -I/usr/include -I. -o WebPage.o WebPage.cpp
WebPage.cpp: In member function ‘bool WebPage::render(const QString&)’:
WebPage.cpp:148:3: error: ‘QFileInfo’ was not declared in this scope
WebPage.cpp:148:13: error: expected ‘;’ before ‘fileInfo’
WebPage.cpp:149:3: error: ‘QDir’ was not declared in this scope
WebPage.cpp:149:8: error: expected ‘;’ before ‘dir’
WebPage.cpp:150:3: error: ‘dir’ was not declared in this scope
WebPage.cpp:150:14: error: ‘fileInfo’ was not declared in this scope
make[1]: *** [WebPage.o] Error 1
make[1]: Leaving directory `/usr/local/rvm/gems/ruby-1.9.3-p286/gems/capybara-webkit-0.12.1/src'
make: *** [sub-src-webkit_server-pro-make_default-ordered] Error 2
Gem files will remain installed in /usr/local/rvm/gems/ruby-1.9.3-p286/gems/capybara-webkit-0.12.1 for inspection.
Results logged to /usr/local/rvm/gems/ruby-1.9.3-p286/gems/capybara-webkit-0.12.1/./gem_make.out
An error occurred while installing capybara-webkit (0.12.1), and Bundler cannot
continue.
Make sure that gem install capybara-webkit -v '0.12.1' succeeds before
bundling.
version 0.12.1 is quite an outdated version of the gem - I had a lot of trouble getting a similar version installed for an older project I had.
I recommend upgrading to a newer version - the dependencies will be newer and the installation will be a lot less hassle.
capybara-webkit depends on a WebKit implementation from Qt, a cross-platform development toolkit. You'll need to download the Qt libraries to build and install the gem. Instructions for downloading and installing QT: https://github.com/thoughtbot/capybara-webkit/wiki/Installing-Qt-and-compiling-capybara-webkit
Related
recently I updated my armadillo to version 5.200.1, but when i tried to compile my code using
g++ -std=c++11 -m64 -O3 -Wall -I. -I/opt/OpenBLAS/include -fopenmp -o code.cpp.o -c code.cpp
g++ -std=c++11 -m64 -O3 -Wall -I. -I/opt/OpenBLAS/include -fopenmp -o main.cpp.o -c main.cpp
g++ -std=c++11 -m64 -O3 -o code.cpp.o main.cpp.o -lgomp -L/opt/OpenBLAS/lib -lopenblas -larmadillo
I got error message in the final linking step
/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../../lib/libarmadillo.so:
undefined reference to `pthread_atfork'
collect2: error: ld returned 1 exit status
make: *** [a.out] Error 1
This error appears in my machine with Ubuntu 14.04LTS + gcc 4.9.2.
The Armadillo itself is linked with OpenBLAS 0.2.14 (I followed the procedure provided by Armadillo in installation)
such error doesn't occur in my macosx laptop (the same library). It means something problems with my ubuntu machine. I tried to re-install the Armadillo 4.650.2 (this version worked before), but the same error kept appearing (now older doesn't work like before). The only thing that i did before updating those libraries were "apt-self update" and "apt-self upgrade" of my ubuntu machine
is there any suggestion to fix this problem?
I also use armadillo on Ubuntu Linux
I had the same problem first when I started to program with armadillo. For g++ I only had to add -larmadillo as command line option. such as this
g++ -O2 -o armadillo_example armadillo_example.cpp -larmadillo
I have run the command:
gem install bcrypt '3.1.7'.
Unfortunately the gem fails to install. Instead I get the following output:
Fetching: bcrypt-3.1.7.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing bcrypt-ruby:
ERROR: Failed to build gem native extension.
/usr/local/rvm/rubies/ruby-1.8.7-head/bin/ruby extconf.rb
checking for ruby/util.h... yes
creating Makefile
make
gcc -I. -I/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/x86_64-linux -I/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/x86_64-linux -I. -DHAVE_RUBY_UTIL_H -fPIC -O2 -fno-tree
-dce -fno-optimize-sibling-calls -fPIC -c crypt.c
gcc -I. -I/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/x86_64-linux -I/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/x86_64-linux -I. -DHAVE_RUBY_UTIL_H -fPIC -O2 -fno-tree
-dce -fno-optimize-sibling-calls -fPIC -c crypt_gensalt.c
gcc -I. -I/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/x86_64-linux -I/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/x86_64-linux -I. -DHAVE_RUBY_UTIL_H -fPIC -O2 -fno-tree
-dce -fno-optimize-sibling-calls -fPIC -c crypt_blowfish.c
gcc -I. -I/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/x86_64-linux -I/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/x86_64-linux -I. -DHAVE_RUBY_UTIL_H -fPIC -O2 -fno-tree
-dce -fno-optimize-sibling-calls -fPIC -c bcrypt_ext.c
gcc -I. -I/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/x86_64-linux -I/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/x86_64-linux -I. -DHAVE_RUBY_UTIL_H -fPIC -O2 -fno-tree
-dce -fno-optimize-sibling-calls -fPIC -c wrapper.c
In file included from /usr/include/ruby/util.h:22:0,
from wrapper.c:28:
/usr/include/ruby/defines.h:71:7: error: conflicting types for ‘ruby_xmalloc’
void *xmalloc(size_t);
^
In file included from /usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/x86_64-linux/ruby.h:37:0,
from wrapper.c:26:
/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/x86_64-linux/defines.h:49:7: note: previous declaration of ‘ruby_xmalloc’ was here
void *xmalloc _((long));
^
In file included from /usr/include/ruby/util.h:22:0,
from wrapper.c:28:
/usr/include/ruby/defines.h:73:7: error: conflicting types for ‘ruby_xcalloc’
void *xcalloc(size_t,size_t);
^
In file included from /usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/x86_64-linux/ruby.h:37:0,
from wrapper.c:26:
/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/x86_64-linux/defines.h:50:7: note: previous declaration of ‘ruby_xcalloc’ was here
void *xcalloc _((long,long));
^
In file included from /usr/include/ruby/util.h:22:0,
from wrapper.c:28:
/usr/include/ruby/defines.h:74:7: error: conflicting types for ‘ruby_xrealloc’
void *xrealloc(void*,size_t);
^
In file included from /usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/x86_64-linux/ruby.h:37:0,
from wrapper.c:26:
/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/x86_64-linux/defines.h:51:7: note: previous declaration of ‘ruby_xrealloc’ was here
void *xrealloc _((void*,long));
^
make: *** [wrapper.o] Error 1
Gem files will remain installed in /usr/local/rvm/gems/ruby-1.8.7-head/gems/bcrypt-3.1.7 for inspection.
Results logged to /usr/local/rvm/gems/ruby-1.8.7-head/gems/bcrypt-3.1.7/ext/mri/gem_make.out
ERROR: Could not find a valid gem '3.1.5' (>= 0) in any repository
This is basically a rather spurious outpouring of problems from 'make' failing to complete. I have found a lot of people have had problems installing bcrypt but none of the suggestions they use solve this particular problem.
How can I solve this problem?
After a closer look at the output, I noticed the list of errors are paired. It looks like they are seperate errors however, they are actually in pairs based on the conflict mentioned in the output. Each pair is referring to two different directories, each corresponding to a different installation of ruby.
After removing the system installed version (ie through 'yum') and leaving the rvm installed version, then running the gem install command, the problem is solved.
I attempt to intsall rails on mac by error still exist
I really frustrated and want some suggestions
Building native extensions. This could take a while...
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
creating Makefile
make "DESTDIR="
xcrun cc -I. -I. - I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal- darwin12.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common -c atomic_reference.c
xcrun: Error: could not stat active Xcode path '/Developer'. (No such file or directory)
cc -arch i386 -arch x86_64 -pipe -bundle -undefined dynamic_lookup -o atomic_reference.bundle atomic_reference.o -L. - L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -L. -arch i386 -arch x86_64 -lruby -lpthread -ldl -lobjc
clang: error: no such file or directory: 'atomic_reference.o'
make: *** [atomic_reference.bundle] Error 1
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/atomic-1.1.12 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/atomic-1.1.12/ext/gem_make.out
I've found the best way is with Homebrew and RVM. There's an excellent Railscast on this: http://railscasts.com/episodes/310-getting-started-with-rails
I am trying to do a gem install therubyracer-heroku -v '0.8.1.pre3', but I am getting errors while building, it is a big log but here is the last failing lines (pasted full log in the end):
g++ -o obj/release/bootstrapper.o -c -Wall -Werror -W -Wno-unused-parameter -Wnon-virtual-dtor -pedantic -m32 -O3 -fomit-frame-pointer -fdata-sections -ffunction-sections -ansi -fno-rtti -fno-exceptions -fvisibility=hidden -Wall -Werror -W -Wno-unused-parameter -Wnon-virtual-dtor -pedantic -m32 -O3 -fomit-frame-pointer -fdata-sections -ffunction-sections -ansi -DV8_TARGET_ARCH_IA32 -DENABLE_VMSTATE_TRACKING -DENABLE_LOGGING_AND_PROFILING -DENABLE_DEBUGGER_SUPPORT -Isrc src/bootstrapper.cc
src/bootstrapper.cc: In static member function 'static bool v8::internal::Genesis::CompileScriptCached(v8::internal::Vector<const char>, v8::internal::Handle<v8::internal::String>, v8::internal::SourceCodeCache*, v8::Extension*, v8::internal::Handle<v8::internal::Context>, bool)':
src/bootstrapper.cc:1002:18: error: variable 'result' set but not used [-Werror=unused-but-set-variable]
src/bootstrapper.cc: In member function 'bool v8::internal::Genesis::InstallNatives()':
src/bootstrapper.cc:1227:24: error: variable 'name' set but not used [-Werror=unused-but-set-variable]
cc1plus: all warnings being treated as errors
scons: *** [obj/release/bootstrapper.o] Error 1
scons: building terminated because of errors.
make: *** [build/v8/libv8.a] Error 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.
I have googled about his for many hours and looked into a lot of SO similar questions, but nothing helped, also I don't know what is mkmf log mean and where to find it.
Additional information:
OS: Ubuntu, 12.04
I already have nodeJs installed, version is v0.8.14 (Just giving this info, since it may be linked with this)
Ruby version: 1.9.3
RVM is used
I am trying to configure a rails server to use PostgreSQL, but getting stuck when installing the postgres gem. I have installed PostgreSQL successfully on the machine (and can use it for other applications) but am getting an error when attempting to install the ruby gem for it.
I do: sudo gem install postgres
And get the following output:
Building native extensions. This could take a while...
ERROR: Error installing postgres:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
checking for main() in -lpq... yes
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for PQsetClientEncoding()... no
checking for pg_encoding_to_char()... no
checking for PQfreemem()... no
checking for PQserverVersion()... no
checking for PQescapeString()... no
creating Makefile
make
gcc -I. -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0 -I. -DHAVE_LIBPQ_FE_H -DHAVE_LIBPQ_LIBPQ_FS_H -I/Library/PostgreSQL/8.4/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common -c libpq-compat.c
libpq-compat.c: In function ‘PQescapeBytea’:
libpq-compat.c:104: warning: incompatible implicit declaration of built-in function ‘sprintf’
libpq-compat.c: In function ‘PQunescapeBytea’:
libpq-compat.c:158: warning: incompatible implicit declaration of built-in function ‘strlen’
libpq-compat.c: In function ‘PQescapeBytea’:
libpq-compat.c:104: warning: incompatible implicit declaration of built-in function ‘sprintf’
libpq-compat.c: In function ‘PQunescapeBytea’:
libpq-compat.c:158: warning: incompatible implicit declaration of built-in function ‘strlen’
gcc -I. -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0 -I. -DHAVE_LIBPQ_FE_H -DHAVE_LIBPQ_LIBPQ_FS_H -I/Library/PostgreSQL/8.4/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common -c postgres.c
postgres.c:41: error: static declaration of ‘PQserverVersion’ follows non-static declaration
/Library/PostgreSQL/8.4/include/libpq-fe.h:289: error: previous declaration of ‘PQserverVersion’ was here
postgres.c: In function ‘Init_postgres’:
postgres.c:2676: error: ‘pgconn_protocol_version’ undeclared (first use in this function)
postgres.c:2676: error: (Each undeclared identifier is reported only once
postgres.c:2676: error: for each function it appears in.)
postgres.c:2677: error: ‘pgconn_server_version’ undeclared (first use in this function)
postgres.c:41: error: static declaration of ‘PQserverVersion’ follows non-static declaration
/Library/PostgreSQL/8.4/include/libpq-fe.h:289: error: previous declaration of ‘PQserverVersion’ was here
postgres.c: In function ‘Init_postgres’:
postgres.c:2676: error: ‘pgconn_protocol_version’ undeclared (first use in this function)
postgres.c:2676: error: (Each undeclared identifier is reported only once
postgres.c:2676: error: for each function it appears in.)
postgres.c:2677: error: ‘pgconn_server_version’ undeclared (first use in this function)
lipo: can't open input file: /var/tmp//ccpTMtE2.out (No such file or directory)
make: *** [postgres.o] Error 1
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/postgres-0.7.9.2008.01.28 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/postgres-0.7.9.2008.01.28/ext/gem_make.out
I am using Mac OS 10.6.4 and Postgres version 8.4.
And idea what could be happening here or how to fix it?
Looks like you're using the EnterpriseDB distribution of Posgres so you need to do this on Snow Leopard:
$ export ARCHFLAGS='-arch i386'
$ sudo gem install pg -- --with-pg-config=/Library/PostgreSQL/8.4/bin/pg_config