gem install t gives "Failed to build gem native extension" - ruby

I'm trying to gem install t(a command line tool for Twitter) in my OSX High Sierra. My Ruby version is ruby 2.3.7p456.
But I am getting the error below:
~> gem install t
Building native extensions. This could take a while...
ERROR: Error installing t:
ERROR: Failed to build gem native extension.
/Users/akira/.rbenv/versions/2.2.1/bin/ruby -r ./siteconf20181213-96401-3tpab1.rb extconf.rb
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling ryah_http_parser.c
In file included from ryah_http_parser.c:24:
In file included from ./ryah_http_parser.h:44:
In file included from /usr/local/include/stdint.h:59:
In file included from /usr/local/include/stdint.h:59:
....
/usr/local/include/stdint.h:2:10: error: #include nested too deeply
#include <stddef.h>
^
/usr/local/include/stdint.h:59:11: error: #include nested too deeply
# include <stdint.h>
^
/usr/local/include/stdint.h:72:11: error: #include nested too deeply
# include <sys/types.h>
^
In file included from ryah_http_parser.c:24:
./ryah_http_parser.h:210:3: error: unknown type name 'uint64_t'
uint64_t content_length; /* # bytes in body (0 if no Content-Length header) */
^
In file included from ryah_http_parser.c:28:
In file included from /usr/include/stdlib.h:65:
In file included from /usr/include/sys/wait.h:110:
/usr/include/sys/resource.h:197:2: error: unknown type name 'uint64_t'
uint64_t ri_user_time;
^
/usr/include/sys/resource.h:198:2: error: unknown type name 'uint64_t'
uint64_t ri_system_time;
^
/usr/include/sys/resource.h:199:2: error: unknown type name 'uint64_t'
uint64_t ri_pkg_idle_wkups;
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [ryah_http_parser.o] Error 1
make failed, exit code 2
Gem files will remain installed in /Users/akira/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/http_parser.rb-0.6.0 for inspection.
Results logged to /Users/akira/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-15/2.2.0-static/http_parser.rb-0.6.0/gem_make.out
Does anyone have any idea what the problem is here?

Looks like you need to install the command line dev tools on osx.
Run xcode-select --install and try again.

Related

error: unknown type name 'uint64_t' on MacOS while installing libraries

Kept getting the following error when trying to install Apache Airflow by
pip install apache-airflow
I removed command line tools, upgraded OS from Mojave to Catalina, re installed xcode using xcode-select --install even then the following errors failed to get resolved :-
---many similar lines---
In file included from /usr/local/include/stdint.h:59:
In file included from /usr/local/include/stdint.h:59:
In file included from /usr/local/include/stdint.h:59:
/usr/local/include/stdint.h:2:10: error: #include nested too deeply
#include <stddef.h>
^
/usr/local/include/stdint.h:72:11: error: #include nested too deeply
# include <sys/types.h>
^
/usr/local/include/stdint.h:82:11: error: #include nested too deeply
# include <inttypes.h>
^
In file included from src/setproctitle.c:14:
In file included from src/spt.h:15:
In file included from src/spt_python.h:14:
---many similar lines---
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/resource.h:216:2: error: unknown type name 'uint64_t'
uint64_t ri_wired_size;
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
error: command 'clang' failed with exit status 1
Read these issues on Github https://github.com/giampaolo/psutil/issues/1388 and https://github.com/cython/cython/issues/2009
Renamed my folder /usr/local/include to /usr/local/include_old for keeping it as backup in case even this doesn't work
mv /usr/local/include /usr/local/include_old
and then ran same installation command again:-
pip install apache-airflow
which worked flawlessly this time.

Installing gosu on FreeBSD

I'm trying to install this Ruby gem on FreeBSD, and it's failing with the following error:
# gem install gosu
Building native extensions. This could take a while...
ERROR: Error installing gosu:
ERROR: Failed to build gem native extension.
current directory: /usr/local/lib/ruby/gems/2.4/gems/gosu-0.14.5/ext/gosu
/usr/local/bin/ruby24 -I /usr/local/lib/ruby/site_ruby/2.4 -r ./siteconf20190322-6847-x8s25j.rb extconf.rb
The Gosu gem requires some libraries to be installed system-wide.
See the following site for a list:
https://github.com/gosu/gosu/wiki/Getting-Started-on-Linux
cat: /proc/cpuinfo: No such file or directory
checking for -lopenal... yes
checking for AL/al.h... yes
creating Makefile
current directory: /usr/local/lib/ruby/gems/2.4/gems/gosu-0.14.5/ext/gosu
make "DESTDIR=" clean
current directory: /usr/local/lib/ruby/gems/2.4/gems/gosu-0.14.5/ext/gosu
make "DESTDIR="
compiling ../../src/Audio.cpp
In file included from ../../src/Audio.cpp:17:
../../src/SndFile.hpp:111:33: warning: field 'buffer' is uninitialized when used here [-Wuninitialized]
: file(nullptr), reader(buffer.front_reader())
^
../../src/SndFile.hpp:123:33: warning: field 'buffer' is uninitialized when used here [-Wuninitialized]
: file(nullptr), reader(buffer.front_reader())
^
2 warnings generated.
compiling ../../src/AudioImpl.cpp
compiling ../../src/Bitmap.cpp
compiling ../../src/BitmapIO.cpp
compiling ../../src/BlockAllocator.cpp
compiling ../../src/Channel.cpp
compiling ../../src/Color.cpp
compiling ../../src/DirectoriesApple.cpp
compiling ../../src/DirectoriesUnix.cpp
compiling ../../src/DirectoriesWin.cpp
compiling ../../src/FileUnix.cpp
../../src/FileUnix.cpp:53:47: error: use of undeclared identifier 'S_IRUSR'
pimpl->fd = open(filename.c_str(), flags, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
^
../../src/FileUnix.cpp:53:55: error: use of undeclared identifier 'S_IWUSR'
pimpl->fd = open(filename.c_str(), flags, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
^
../../src/FileUnix.cpp:53:63: error: use of undeclared identifier 'S_IRGRP'
pimpl->fd = open(filename.c_str(), flags, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
^
../../src/FileUnix.cpp:53:71: error: use of undeclared identifier 'S_IWGRP'
pimpl->fd = open(filename.c_str(), flags, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
^
../../src/FileUnix.cpp:53:79: error: use of undeclared identifier 'S_IROTH'
pimpl->fd = open(filename.c_str(), flags, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
^
../../src/FileUnix.cpp:53:87: error: use of undeclared identifier 'S_IWOTH'
pimpl->fd = open(filename.c_str(), flags, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
^
6 errors generated.
*** Error code 1
Stop.
make: stopped in /usr/local/lib/ruby/gems/2.4/gems/gosu-0.14.5/ext/gosu
Other things I tried:
Switching compilers - from clang and c++ to g++ and gcc.
Cloning the repository and building "manually" - got the same errors.
Is it even possible to install it on FreeBSD? Searches didn't return anything useful.
On FreeBSD system headers are organized slightly differently than in Linux.
Quick man lookup reveals, that you need to
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
to make these definitions visible.

Error installing caffe model on Mac

I am trying to install caffe model on Mac. When I run make test, I get this error. How do I fix it?
Hsus-MacBook-Pro:caffe HTS$ make test
CXX src/caffe/test/test_random_number_generator.cpp
In file included from src/caffe/test/test_random_number_generator.cpp:5:
./include/caffe/common.hpp:4:10: fatal error: 'boost/shared_ptr.hpp' file not found
#include <boost/shared_ptr.hpp>
^~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make: *** [.build_release/src/caffe/test/test_random_number_generator.o] Error 1

Error building OpenCV with mingw under Windows 10

I tried to build the opencv Library on my Windows 10 PC.
I managed to generate everything from source with cmake. (Nothing red, no errors).
When I try to build everything with mingw (mingw32-make install)
It starts building and after a while I get the following error.
[ 76%] Building CXX object modules/python3/CMakeFiles/opencv_python3.dir/__/src2/cv2.cpp.obj
In file included from C:/Python34/include/Python.h:8:0,
from C:\OpenCV\opencv-master\modules\python\src2\cv2.cpp:6:
C:/Python34/include/pyconfig.h:440:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER >= 1800
^~~~~~~~
In file included from C:/PROGRA~1/MINGW-~1/X86_64~1.0-P/mingw64/lib/gcc/x86_64-w64-mingw32/6.2.0/include/c++/math.h:36:0,
from C:/Python34/include/pyport.h:328,
from C:/Python34/include/Python.h:50,
from C:\OpenCV\opencv-master\modules\python\src2\cv2.cpp:6:
C:/PROGRA~1/MINGW-~1/X86_64~1.0-P/mingw64/lib/gcc/x86_64-w64-mingw32/6.2.0/include/c++/cmath:1133:11: error: '::hypot' has not been declared
using ::hypot;
^~~~~
modules\python3\CMakeFiles\opencv_python3.dir\build.make:179: recipe for target 'modules/python3/CMakeFiles/opencv_python3.dir/__/src2/cv2.cpp.obj' failed
mingw32-make[2]: *** [modules/python3/CMakeFiles/opencv_python3.dir/__/src2/cv2.cpp.obj] Error 1
CMakeFiles\Makefile2:7051: recipe for target 'modules/python3/CMakeFiles/opencv_python3.dir/all' failed
mingw32-make[1]: *** [modules/python3/CMakeFiles/opencv_python3.dir/all] Error 2
Makefile:159: recipe for target 'all' failed
mingw32-make: *** [all] Error 2
I found the following "Error: '::hypot' has not been declared" in cmath while trying to embed Python
But could not figured it out.
Can Anyone hint me in the direction. Where are those includes in the case of building OpenCV?
Versions:
OpenCV 3.2.0,
CMake 3.4.1,
GNU Make 4.1
Any help qould be appreciated!
Go to the following file
C:\OpenCV\opencv-master\modules\python\src2\cv2.cpp
and see if
#include "Python.h"
comes before #include <cmath>.
In that case exchange the order, i.e. write
#include <cmath>
#include "Python.h"
so that cmath comes before Python.h.
Try to build and see if that solves at list the error that you reported.

Compiling Asterisk on Windows

I was trying to compile Asterisk 1.6 on Windows using Cygwin
1- I have installed Cygwin and included (Debug, Devel and Libs )while installing Cygwin.
2- ./Configure passed successfully
3- while running make command I got this
In file included from /home/Administrator/asterisk-1.6.2.24/include/asterisk.h:27:0,
from smsq.c:20:
/home/Administrator/asterisk-1.6.2.24/include/asterisk/compat.h:205:28: error: conflicting types for ‘uint64_t’
typedef unsigned long long uint64_t;
^
In file included from /usr/include/stdint.h:14:0,
from /usr/lib/gcc/x86_64-pc-cygwin/5.4.0/include/stdint.h:9,
from /usr/include/inttypes.h:19,
from /home/Administrator/asterisk-1.6.2.24/include/asterisk/compat.h:29,
from /home/Administrator/asterisk-1.6.2.24/include/asterisk.h:27,
from smsq.c:20:
/usr/include/sys/_stdint.h:60:20: note: previous declaration of ‘uint64_t’ was here
typedef __uint64_t uint64_t ;
^
make[1]: *** [/home/Administrator/asterisk-1.6.2.24/Makefile.rules:91: smsq.o] Error 1
make: *** [Makefile:422: utils] Error 2
I need to know what is the cause and how can I fix this issue?
Thanks in advance
The type named uint64_t is defined in <stdint.h> where it should be, but asterisk is (wrongly, all identifiers ending in _t are reserved names) trying to provide its own definition.
Remove the improper definition in "compat.h".

Resources