Cannot install qrscanner gem on ubuntu - ruby

When running the gem install qrscanner, I'm having the following error:
Building native extensions. This could take a while...
ERROR: Error installing qrscanner:
ERROR: Failed to build gem native extension.
/home/kasuka/.rvm/rubies/ruby-1.9.2-p320/bin/ruby extconf.rb
make
pwd ; cd zxing ; python scons/scons.py lib DEBUG=0 PIC=1
/home/kasuka/.rvm/gems/ruby-1.9.2-p320/gems/qrscanner-0.4.1/ext/qrscanner
scons: Reading SConscript files ...
scons: warning: Two different environments were specified for target magick/src/MagickBitmapSource.o,
but they appear to have the same action: $CXX -o $TARGET -c $CXXFLAGS $CCFLAGS $_CCCOMCOM $SOURCES
However when i added sudo:
Building native extensions. This could take a while...
ERROR: Error installing qrscanner:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
extconf.rb:4: Use RbConfig instead of obsolete and deprecated Config.
make
pwd ; cd zxing ; python scons/scons.py lib DEBUG=0 PIC=1
/var/lib/gems/1.9.1/gems/qrscanner-0.4.1/ext/qrscanner
scons: Reading SConscript files ...
scons: warning: Two different environments were specified for target magick/src/MagickBitmapSource.o,
but they appear to have the same action: $CXX -o $TARGET -c $CXXFLAGS $CCFLAGS $_CCCOMCOM $SOURCES
I'm using ruby 1.9.2 and is worth to mention that the extconf.rb file does not exist on neither of the location mentioned.

read the documentation of the gem at
https://github.com/andys/qrscanner
and install these dependencies before you install the gem.
Dependencies
------------
* Python (for ZXing build script)
* ImageMagick: libMagick++, libMagickWand, libMagickCore
* gcc, g++, libstd++
* Operating system with a PREFIX of "/usr".

Related

how to install jekyll on win10?

today i failed to install jekyll,i follw the jeklly official website :
1.install RubyInstaller
2.command: ridk install
3.gem install jekyll bundler,it failed:
then it shows:
PS C:\Code\MyBlog> gem install jekyll
Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions. This could take a while...
ERROR: Error installing jekyll:
ERROR: Failed to build gem native extension.
current directory: C:/Dev/Ruby31-x64/lib/ruby/gems/3.1.0/gems/sassc-2.4.0/ext
C:/Dev/Ruby31-x64/bin/ruby.exe -I C:/Dev/Ruby31-x64/lib/ruby/3.1.0 -r ./siteconf20220426-15436-o23130.rb extconf.rb
creating Makefile
current directory: C:/Dev/Ruby31-x64/lib/ruby/gems/3.1.0/gems/sassc-2.4.0/ext
make DESTDIR\= clean
bash.exe: warning: could not find /tmp, please create!
current directory: C:/Dev/Ruby31-x64/lib/ruby/gems/3.1.0/gems/sassc-2.4.0/ext
make DESTDIR\=
compiling ./libsass/src/ast.cpp
compiling ./libsass/src/ast2c.cpp
compiling ./libsass/src/ast_fwd_decl.cpp
compiling ./libsass/src/ast_sel_cmp.cpp
compiling ./libsass/src/ast_sel_super.cpp
compiling ./libsass/src/ast_sel_unify.cpp
compiling ./libsass/src/ast_sel_weave.cpp
compiling ./libsass/src/ast_selectors.cpp
compiling ./libsass/src/ast_supports.cpp
compiling ./libsass/src/ast_values.cpp
compiling ./libsass/src/backtrace.cpp
compiling ./libsass/src/base64vlq.cpp
compiling ./libsass/src/bind.cpp
compiling ./libsass/src/c2ast.cpp
compiling ./libsass/src/c99func.c
Assembler messages:
Error: can't open C:\Users\��������\AppData\Local\Temp\cc3iPW42.s for reading: Illegal byte sequence
make: *** [Makefile:246:c99func.o] error 1
make failed, exit code 2
Gem files will remain installed in C:/Dev/Ruby31-x64/lib/ruby/gems/3.1.0/gems/sassc-2.4.0 for inspection.
Results logged to C:/Dev/Ruby31-x64/lib/ruby/gems/3.1.0/extensions/x64-mingw-ucrt/3.1.0/sassc-2.4.0/gem_make.out
and i noticed that idont have file :c99func.o,but i dont know how to compile that c99func.c file..c file

Guide to installing ta-lib on Windows for Ruby gem

I have tried for quite a while to install ta-lib so I can use some of the indicator functions for trading based on this github example. So far I have determined that I need to:
run gem install talib_ruby
C:\Users\king\Desktop\_REPOS\misc\stock_analysis\forex\oanda\ruby>gem install talib_ruby
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing talib_ruby:
ERROR: Failed to build gem native extension.
C:/Ruby22-x64/bin/ruby.exe -r ./siteconf20160810-7176-j5lye2.rb extconf.rb
checking for TA_Initialize() in -lta_lib... no
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
generating talib-x64-mingw32.def
compiling talib.c
talib.c:2:32: fatal error: ta-lib/ta_abstract.h: No such file or directory
compilation terminated.
make: *** [talib.o] Error 1
make failed, exit code 2
....
Download ta-lib header files which are in the msvc from here
Tell the talib_ruby gem where the ta-lib files when installing. Based on this SO post the correct command should look something like: sudo env ARCHFLAGS="-arch x86_64" gem install talib_ruby -- --with-talib-include=/opt/local/var/macports/software/ta-lib/0.4.0_0/opt/local/include/ta-lib --with-talib-lib=/opt/local/var/macports/software/ta-lib/0.4.0_0/opt/local/lib
. The command specifies a path to a lib folder which is missing from the ta-lib I downloaded. Does anyone know how to fix this?
Windows?
Sorry for my english.
My system: Windows 7 SP1 x64, ruby 2.2.4p230
You have to install Ruby Development Kit to build the binary extensions.
Download and extract source, I used ta-lib-0.4.0-src.tar.gz.
Run msys.bat from Ruby DevKit or if you have installed mingw as part of RubyInstaller, run either mingw64.exe or ming32.exe. Navigate to ta-lib source files (in my case it is /d/dev/ta-lib) and build the library:
cd /d/dev/ta-lib
./configure
make
Because the path to C headers hardcoded in gem to #include <ta-lib/ta_abstract.h>, I just make a new directory ta-lib within d:\dev\ta-lib\include source folder and all copy header files here. (Files in d:\dev\ta-lib\include*.h are copied to d:\dev\ta-lib\include\ta-lib)
Install gem. Exit the msys or mingw terminal and run the following in your Windows cmd. Be sure to replace these paths with the correct path to your ta-lib source:
gem install talib_ruby -- --with-talib-include=d:/dev/ta-lib/include --with-talib-lib=d:/dev/ta-lib/src/.libs
Make sure to change paths to yours.

Fast-stemmer installation problems

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

Failing to install Jekyll gem native extension on Windows with "multiple target patterns"

I'm trying to get Jekyll up and running on my Windows 7 machine, but installing the gem fails with a make exception. I'm basically following the instructions provided by Madhur Arhuja plus some "fixes" due to some seemingly wrong links. Here is what I did:
Downloaded and installed ruby 1.9.3 p448
Downloaded and extracted the RubyDevelopmentKit from the same page.
In my Git Bash from the directory where I installed the development kit I ran
ruby dk.rb init
ruby dk.rb install
gem install jekyll
The first two steps worked fine. I got some Info output, no errors. But the last step created this:
$ gem install jekyll
Fetching: liquid-2.5.1.gem (100%)
Fetching: fast-stemmer-1.0.2.gem (100%)
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing jekyll:
ERROR: Failed to build gem native extension.
"c:/Program Files/Ruby193/bin/ruby.exe" extconf.rb
creating Makefile
make
Makefile:222: *** multiple target patterns. Stop.
Gem files will remain installed in c:/Program Files/Ruby193/lib/ruby/gems/1.9.1/gems/fast-stemmer-1.0.2 for inspection.
Results logged to c:/Program Files/Ruby193/lib/ruby/gems/1.9.1/gems/fast-stemmer-1.0.2/ext/gem_make.out
In Very simple application fails with "multiple target patterns" from Eclipse I found that this might be related to the unix emulator, so I ran the last command again in the windows shell, but with the same result.
Since I have no idea about ruby, c, make or anything involved I'm completely stuck :-(
Ok just a try. The Makefile on this line (and following) defines the target for .m.o.
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$# -c $<
Everything looks ok if you're using mingw / cygwin, but INCFLAGS can make problems on window machines, if you've installed ruby in a directory with spaces.
INCFLAG is defined as INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir)/ruby/backward -I$(hdrdir) -I$(srcdir) and if you see my definition below there is no space in any path.
topdir = /C/Ruby200-x64/include/ruby-2.0.0
hdrdir = $(topdir)
arch_hdrdir = C:/Ruby200-x64/include/ruby-2.0.0/x64-mingw32
If I change the ruby installation to a path with spaces I get invalid option error in native windows command line and in the mingw session. Maybe this is could help.

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