Fast-stemmer installation problems - ruby

I'm having a hard time installing any of the ruby gems I want to because of a problem with fast-stemmer. I've put the error I'm getting below.
Building native extensions. This could take a while...
ERROR: Error installing fast-stemmer:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling porter.c
porter.c:359:27: warning: '&&' within '||' [-Wlogical-op-parentheses]
if (a > 1 || a == 1 && !cvc(z, z->k - 1)) z->k--;
~~ ~~~~~~~^~~~~~~~~~~~~~~~~~~~
porter.c:359:27: note: place parentheses around the '&&' expression to silence this warning
if (a > 1 || a == 1 && !cvc(z, z->k - 1)) z->k--;
^
( )
1 warning generated.
compiling porter_wrap.c
linking shared-object stemmer.bundle
clang: error: unknown argument: '-multiply_definedsuppress' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
make: *** [stemmer.bundle] Error 1
make failed, exit code 2
Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/fast-stemmer-1.0.2 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-13/2.0.0/fast-stemmer-1.0.2/gem_make.out
Some things I've tried to resolve the problem include: updating ruby gems, updating rvm, using ruby 2.1.1, re-installing command line tools. I'm on Mavericks.
If anyone could help me out it'd be much appreciated!

So, it appears that the problem I was having was caused by updating the last xCode, which in turn updated clang to 5.1, which in turn has broken a lot of ruby gems that haven't updated to reflect breaking changes in clang 5.1. I found this all on the Cloudspace blog.
Their solution (for the moment -- the error says they will become hard errors in the future) is to put the following flag to get your compiler to ignore the issue:
ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future
For example:
sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install librarian-chef
or to bundle:
sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future bundle install

Related

fail to bundle install puma 4.3.5 or gem puma with ruby-2.6.6 on macos-10.15.6 [duplicate]

This question already has answers here:
puma gem - Failed to build gem native extension
(13 answers)
Closed 2 years ago.
fail to bundle install puma 4.3.5 or gem puma with ruby-2.6.6 on macos-10.15.6
try to bundle dependencies for my project, but puma 4.3.5 occured an error.
someone know about this?
xxxxxxxxxxxx
here is the error content:
fetching puma 4.3.5
Installing puma 4.3.5 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /Users/lxj/.rvm/gems/ruby-2.6.6/gems/puma-4.3.5/ext/puma_http11
/Users/lxj/.rvm/rubies/ruby-2.6.6/bin/ruby -I /Users/lxj/.rvm/rubies/ruby-2.6.6/lib/ruby/site_ruby/2.6.0 -r ./siteconf20200731-28585-1eobsvu.rb extconf.rb
checking for BIO_read() in -lcrypto... yes
checking for SSL_CTX_new() in -lssl... yes
checking for openssl/bio.h... yes
checking for DTLS_method() in openssl/ssl.h... yes
checking for TLS_server_method() in openssl/ssl.h... yes
checking for SSL_CTX_set_min_proto_version in openssl/ssl.h... yes
creating Makefile
current directory: /Users/lxj/.rvm/gems/ruby-2.6.6/gems/puma-4.3.5/ext/puma_http11
make "DESTDIR=" clean
current directory: /Users/lxj/.rvm/gems/ruby-2.6.6/gems/puma-4.3.5/ext/puma_http11
make "DESTDIR="
compiling http11_parser.c
ext/puma_http11/http11_parser.c:44:18: warning: unused variable 'puma_parser_en_main' [-Wunused-const-variable]
static const int puma_parser_en_main = 1;
^
1 warning generated.
compiling io_buffer.c
compiling mini_ssl.c
mini_ssl.c:145:7: warning: unused variable 'min' [-Wunused-variable]
int min, ssl_options;
^
mini_ssl.c:299:40: warning: function 'raise_error' could be declared with attribute 'noreturn' [-Wmissing-noreturn]
void raise_error(SSL* ssl, int result) {
^
2 warnings generated.
compiling puma_http11.c
puma_http11.c:203:22: error: implicitly declaring library function 'isspace' with type 'int (int)' [-Werror,-Wimplicit-function-declaration]
while (vlen > 0 && isspace(value[vlen - 1])) vlen--;
^
puma_http11.c:203:22: note: include the header <ctype.h> or explicitly provide a declaration for 'isspace'
1 error generated.
make: *** [puma_http11.o] Error 1
make failed, exit code 2
Gem files will remain installed in /Users/lxj/.rvm/gems/ruby-2.6.6/gems/puma-4.3.5 for inspection.
Results logged to /Users/lxj/.rvm/gems/ruby-2.6.6/extensions/x86_64-darwin-19/2.6.0/puma-4.3.5/gem_make.out
An error occurred while installing puma (4.3.5), and Bundler cannot continue.
Make sure that `gem install puma -v '4.3.5'` succeeds before bundling.
In Gemfile:
puma
Locked. Comments on this answer have been disabled, but it is still accepting other interactions. Learn more.
It seems that the latest version of XCode tools (12 Beta 3) installs a version of Clang (the C compiler used by default on MacOS) that throws an error on implicit functions used on the native extension code of Puma.
The workaround as pointed out here is to tell Clang not to treat this behavior as an error.
Try running:
bundle config build.puma --with-cflags="-Wno-error=implicit-function-declaration"
bundle install
and it should work.

Error to bundle install "yajl-ruby"

noob here, I'm trying to install octopress but when i run rbenv exec bundle install i got this error.
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory:
/home/idiot/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/yajl-ruby-1.2.1/ext/yajl
/home/idiot/.rbenv/versions/2.4.0/bin/ruby -r ./siteconf20170227-4161-uizrqn.rb extconf.rb
creating Makefile
current directory:
/home/idiot/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/yajl-ruby-1.2.1/ext/yajl
make "DESTDIR=" clean
current directory:
/home/idiot/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/yajl-ruby-1.2.1/ext/yajl
make "DESTDIR="
compiling yajl.c
compiling yajl_alloc.c
compiling yajl_buf.c
compiling yajl_encode.c
compiling yajl_ext.c
yajl_ext.c: In function ‘rb_yajl_parser_parse’:
yajl_ext.c:471:17: warning: variable ‘stat’ set but not used [Wunused-but-set-variable]
yajl_status stat;
^~~~
yajl_ext.c: In function ‘rb_yajl_encoder_enable_json_gem_ext’:
yajl_ext.c:881:22: error: ‘rb_cFixnum’ undeclared (first use in this function)
rb_define_method(rb_cFixnum, "to_json", rb_yajl_json_ext_fixnum_to_json, -1);
^~~~~~~~~~
yajl_ext.c:881:22: note: each undeclared identifier is reported only once for each
function it appears in
yajl_ext.c: At top level:
cc1: warning: unrecognized command line option ‘-Wno-self-assign’
cc1: warning: unrecognized command line option ‘-Wno-constant-logical-operand’
cc1: warning: unrecognized command line option ‘-Wno-parentheses-equality’
make: *** [Makefile:242: yajl_ext.o] Error 1
make failed, exit code 2
Gem files will remain installed in
/home/idiot/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/yajl-ruby1.2.1 for inspection.
Results logged to
/home/idiot/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/extensions/x86_64-linux/2.4.0-static/yajl-ruby-1.2.1/gem_make.out
An error occurred while installing yajl-ruby (1.2.1), and Bundler cannot
continue.
Make sure that `gem install yajl-ruby -v '1.2.1'` succeeds before bundling.
I've tried to googling but still have not found a solution to this problem, anyone answer my question, I am very grateful.
The native extension has not been updated for Ruby 2.4 yet. The breaking change is that Fixnum and Bignum (rb_cFixnum and rb_cBignum in the C API) have been unified in Integer (rb_cInteger).
Check the yajl-ruby repository for an issue/pull request fixing Ruby 2.4 compatibility or use Ruby 2.3.3 for the time being.

'Pygments gem or one of its dependencies isn't installed' error message

I tried to install this starter project: https://github.com/shakyShane/jekyll-gulp-sass-browser-sync
I have the latest Ruby and Node.js installed. I followed the setup instructions for this starter project: installed jekyll, gulp, ran the npm install command and after that gulp. And when I ran gulp I got this error message:
Dependency Error: Yikes! It looks like you don't have pygments
or one of its dependencies installed. In order to use Jekyll as currently configured, you'll
need to install this gem. The full error message from Ruby is:
'cannot load such file -- pygments' If you run into trouble, you can find helpful resources
at http://jekyllrb.com/help/!
Liquid Exception: pygments in C:/work/Web/MySite/_posts/2014-04-20-welcome-to-jekyll.markdown
ERROR: YOUR SITE COULD NOT BE BUILT:
------------------------------------
pygments
I tried to install pygments manually: gem install pygments.rb, but it didn't help.
I'm new to Ruby and Jekyll... What went wrong here and how can it be fixed?
UPDATE
This is the error message from gem install pygments.rb:
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing pygments.rb:
ERROR: Failed to build gem native extension.
current directory: C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/yajl-ruby-1.2.1/ext/yajl
C:/Ruby23-x64/bin/ruby.exe -r ./siteconf20160811-6768-1qhknd7.rb extconf.rb
creating Makefile
current directory: C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/yajl-ruby-1.2.1/ext/yajl
make "DESTDIR=" clean
current directory: C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/yajl-ruby-1.2.1/ext/yajl
make "DESTDIR="
generating yajl-x64-mingw32.def
compiling yajl.c
yajl.c: In function 'yajl_status_to_string':
yajl.c:61:1: warning: visibility attribute not supported in this configuration; ignored [-Wattributes]
...more of these yajl_... visibility attribute not supported messages...
c:/ruby23-x64/devkit/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/lib/../lib/dllcrt2.o: file not recognized: File trun
cated
collect2.exe: error: ld returned 1 exit status
make: *** [yajl.so] Error 1
make failed, exit code 2
Gem files will remain installed in C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/yajl-ruby-1.2.1 for inspection.
Results logged to C:/Ruby23-x64/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0/yajl-ruby-1.2.1/gem_make.out
OK, after a very long time I finally found a solution to the problem I had. Here's what I did:
Completely uninstalled all gems.
Uninstalled Ruby DevTools
Uninstalled Ruby
Re-installed Ruby
Re-installed Ruby DevTools (downloaded it again, apparently my previous download had corrupted files) , changed config.yml to include - C:/Ruby23-x64
Re-installed pygments.rb (this time it went well, without any errors)
Installed Python (very important)
Edited Gulp's _config.yml and changed default highlighter from pygments to rouge
Installed redcarpet gem gem install redcarpet
Ran gulp again and this time it finally worked as expected!

How can I work around installation error of "thin" gem?

When I run gem install thin under Ruby 2.1.7 (ruby 2.1.7p400 (2015-08-18 revision 51632) [i386-mingw32]), I get following errors.
D:\dev\myapp>gem install thin
Building native extensions. This could take a while...
ERROR: Error installing thin:
ERROR: Failed to build gem native extension.
C:/Ruby21/bin/ruby.exe extconf.rb
[...]
compiling cmain.cpp
cmain.cpp: In function 'int evma_send_file_data_to_connection(uintptr_t, const c
har*)':
cmain.cpp:802:20: error: 'fstat' was not declared in this scope
if (fstat (Fd, &st)) {
^
make: *** [cmain.o] Error 1
make failed, exit code 2
How can I work around this error?
Full log is available here.
I believe this was a known bug in earlier versions of the ruby devkit. Unfortunately I cannot find a reference to the fix.
Install the latest devkit and try again, this should solve your problem.

Ruby DevKit on Windows 8, still can't install native extension

I'm using Ruby 1.9.3 on Windows8-64bit. My Ruby installation is in C:\Ruby193 and the Devkit is in C:\DevKit
I followed the DevKit installation and it's a success.
Then the guide asks me to test it by running gem install json --platform=ruby which returns this error (looks similar as before having DevKit installed):
Note: This other question here told me to add the DevKit installation folder to Environment PATH, I did it but still got same error.
C:\Users\myname>gem install json --platform=ruby
Building native extensions. This could take a while...
ERROR: Error installing json:
ERROR: Failed to build gem native extension.
C:/Ruby193/bin/ruby.exe extconf.rb
creating Makefile
make
generating generator-i386-mingw32.def
compiling generator.c
In file included from c:/Ruby193/include/ruby-1.9.1/ruby/ruby.h:1381:0,
from c:/Ruby193/include/ruby-1.9.1/ruby.h:32,
from ../fbuffer/fbuffer.h:5,
from generator.c:1:
c:/Ruby193/include/ruby-1.9.1/ruby/missing.h:41:8: error: redefinition of 'struc
t timespec'
In file included from c:\devkit\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../.
./../../i686-w64-mingw32/include/process.h:12:0,
from c:/Ruby193/include/ruby-1.9.1/ruby/win32.h:62,
from c:/Ruby193/include/ruby-1.9.1/ruby/defines.h:223,
from c:/Ruby193/include/ruby-1.9.1/ruby/ruby.h:67,
from c:/Ruby193/include/ruby-1.9.1/ruby.h:32,
from ../fbuffer/fbuffer.h:5,
from generator.c:1:
c:\devkit\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw
32/include/sys/types.h:89:8: note: originally defined here
In file included from c:/Ruby193/include/ruby-1.9.1/ruby/ruby.h:1381:0,
from c:/Ruby193/include/ruby-1.9.1/ruby.h:32,
from ../fbuffer/fbuffer.h:5,
from generator.c:1:
c:/Ruby193/include/ruby-1.9.1/ruby/missing.h:48:8: error: redefinition of 'struc
t timezone'
In file included from c:/Ruby193/include/ruby-1.9.1/ruby/win32.h:63:0,
from c:/Ruby193/include/ruby-1.9.1/ruby/defines.h:223,
from c:/Ruby193/include/ruby-1.9.1/ruby/ruby.h:67,
from c:/Ruby193/include/ruby-1.9.1/ruby.h:32,
from ../fbuffer/fbuffer.h:5,
from generator.c:1:
c:\devkit\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw
32/include/time.h:260:8: note: originally defined here
make: *** [generator.o] Error 1
Any solution? Thanks
Sorry, I used the wrong DevKit.
For Ruby 1.9.3 and below, we should use DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe The mingw is for 2.0 and above.
It works great now.

Resources