Cabal failed to install unix-2.7.0.0 - unix

I'm trying to install unix package on windows environment. I'm using Cygwin, but its still not working.
Below is a snippet of the error I'm getting:
$ cabal install unix
Resolving dependencies...
Configuring unix-2.7.0.0...
Warning: Unknown extensions: CApiFFI, InterruptibleFFI
configure: WARNING: unrecognized options: --with-compiler, --with-gcc
checking for gcc... gcc
.
.
.
configure: creating ./config.status
config.status: creating unix.buildinfo
config.status: creating include/HsUnixConfig.h
configure: WARNING: unrecognized options: --with-compiler, --with-gcc
cabal.exe: Package unix-2.7.0.0 can't be built on this system.
Failed to install unix-2.7.0.0
cabal.exe: Error: some packages failed to install:
unix-2.7.0.0 failed during the building phase. The exception was:
ExitFailure 1

Cygwin is a partial linux toolset for windows, it's great if you need basic things but installing a full blown unix cabal plugin might be beyond its capabilities.
You may want to install a full linux os on a virtual machine (vagrant does great with this) or use a cloud real unix machine.
Linux hosts are really great to work with from remote
Happy codding

Related

Installing rmagick gem on Amezon AMI server getting error for ImageMagick dependencies

Building native extensions. This could take a while...
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.
current directory: /home/ec2-user/.rvm/gems/ruby-2.6.5/gems/rmagick-4.2.2/ext/RMagick
/home/ec2-user/.rvm/rubies/ruby-2.6.5/bin/ruby -I /home/ec2-user/.rvm/rubies/ruby-2.6.5/lib/ruby/site_ruby/2.6.0 -r ./siteconf20210806-10706-10mubyf.rb extconf.rb
checking for brew... no
checking for pacman... no
checking for Ruby version >= 2.3.0... yes
checking for pkg-config... yes
checking for outdated ImageMagick version (<= 6.7.7)... no
checking for gcc... yes
checking for GNUC... *** 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.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/home/ec2-user/.rvm/rubies/ruby-2.6.5/bin/$(RUBY_BASE_NAME)
/home/ec2-user/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/mkmf.rb:467:in try_do': The compiler failed to generate an executable file. (RuntimeError) You have to install development tools first. from /home/ec2-user/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/mkmf.rb:585:in block in try_compile'
from /home/ec2-user/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/mkmf.rb:534:in with_werror' from /home/ec2-user/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/mkmf.rb:585:in try_compile'
from /home/ec2-user/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/mkmf.rb:852:in macro_defined?' from /home/ec2-user/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/mkmf.rb:994:in block in have_macro'
from /home/ec2-user/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/mkmf.rb:959:in block in checking_for' from /home/ec2-user/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/mkmf.rb:361:in block (2 levels) in postpone'
from /home/ec2-user/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/mkmf.rb:331:in open' from /home/ec2-user/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/mkmf.rb:361:in block in postpone'
from /home/ec2-user/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/mkmf.rb:331:in open' from /home/ec2-user/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/mkmf.rb:357:in postpone'
from /home/ec2-user/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/mkmf.rb:958:in checking_for' from /home/ec2-user/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/mkmf.rb:993:in have_macro'
from extconf.rb:99:in configure_compile_options' from extconf.rb:19:in initialize'
from extconf.rb:398:in new' from extconf.rb:398:in '
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/home/ec2-user/.rvm/gems/ruby-2.6.5/extensions/x86_64-linux/2.6.0/rmagick-4.2.2/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /home/ec2-user/.rvm/gems/ruby-2.6.5/gems/rmagick-4.2.2 for inspection.
Results logged to /home/ec2-user/.rvm/gems/ruby-2.6.5/extensions/x86_64-linux/2.6.0/rmagick-4.2.2/gem_make.out
sudo yum -y install ImageMagick ImageMagick-devel
convert -version
Output:
Version: ImageMagick 6.9.10-68 Q16 x86_64 2021-02-03 https://imagemagick.org
Copyright: © 1999-2019 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC Modules OpenMP(3.1)
Delegates (built-in): bzlib fontconfig freetype gslib jng jpeg lcms ltdl lzma png ps tiff wmf x xml zlib
3. gem install rmagick
if you still get the error follow below commands
sudo ln -s /usr/lib/gcc/x86_64-amazon-linux/4.8.5/libgomp.spec /usr/lib64/libgomp.spec
sudo ln -s /usr/lib/gcc/x86_64-amazon-linux/4.8.5/libgomp.a /usr/lib64/libgomp.a
sudo ln -s /usr/lib64/libgomp.so.1.0.0 /usr/lib64/libgomp.so
And run again gem install rmagick and its all done.
You can find the link below
https://senrenseyo.com/20210811/rails6_rmagick/

Rails rmagick error Ubuntu c9.io

I've been looking around on other rmagick threads for a good solution. Nothing has worked so far.
I'm working on a rails project on c9 IDE. I managed to successfully install imagemagick via the 'sudo apt get install imagemagick' command.
However when I try to run 'gem install rmagick' I get the following error
Building native extensions. This could take a while...
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.
current directory: /usr/local/rvm/gems/ruby-2.3.0/gems/rmagick-2.15.4/ext/RMagick
/usr/local/rvm/rubies/ruby-2.3.0/bin/ruby -r ./siteconf20160608-3911-1hut05d.rb extconf.rb
checking for gcc... yes
checking for Magick-config... no
checking for pkg-config... yes
Package MagickCore was not found in the pkg-config search path.
Perhaps you should add the directory containing `MagickCore.pc' to the PKG_CONFIG_PATH environment variable
No package 'MagickCore' found checking for outdated ImageMagick version (<= 6.4.9)... *** 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.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/local/rvm/rubies/ruby-2.3.0/bin/$(RUBY_BASE_NAME)
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/usr/local/rvm/gems/ruby-2.3.0/extensions/x86_64-linux/2.3.0/rmagick-2.15.4/mkmf.log extconf failed, exit code 1
Gem files will remain installed in /usr/local/rvm/gems/ruby 2.3.0/gems/rmagick-2.15.4 for inspection.
Results logged to /usr/local/rvm/gems/ruby-2.3.0/extensions/x86_64-linux/2.3.0/rmagick-2.15.4/gem_make.out
Try this (working for rmagick 3.0.0):
brew install imagemagick#6
brew link --force imagemagick#6
gem install rmagick

Installation of memcached - unable to find libevent

To install memcached I run:
./configure
from memcached server location but I receive error:
checking for libevent directory... configure: error: libevent is required. You can get it from http://www.monkey.org/~provos/libevent/
If it's already installed, specify its path using --with-libevent=/dir/
So I installed libevent manually by downloading from http://www.monkey.org/~provos/libevent/ and running ./configure from downloaded libevent folder
But when I try command:
./configure --with-libevent=/export/home/me/libevent-2.0.21-stable/
I receive same error :
checking for libevent directory... configure: error: libevent is required. You can get it from http://www.monkey.org/~provos/libevent/
If it's already installed, specify its path using --with-libevent=/dir/
How can I check where libevent is installed? Am I specifying the path correctly?
I'm required to install libevent manually as I'm installing memcached from behind a firewall.
After downloading and extracting libevent, you have to configure, build and install it.
Only then can you go back to the memcached directory and rerun its configure, specifying where you installed libevent if it wasn't in one of the standard places (such as /lib, /usr/lib or /usr/local/lib).

rJava fails to install (MacOS, Red Hat)

I am experiencing the same rJava problem that many other people seem to of had at one point or another. The error occurs when R CMD INSTALL tests whether JNI programs can be compiled.
The output recommends running R CMD javareconf -ed or sudo R CMD javareconf The output of the latter is :
computer: home$ sudo R CMD javareconf
Java interpreter : /usr/bin/java
Java version : 1.6.0_31
Java home path : /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Java compiler : /usr/bin/javac
Java headers gen.: /usr/bin/javah
Java archive tool: /usr/bin/jar
Java library path:
JNI linker flags : -framework JavaVM
JNI cpp flags : -I$(JAVA_HOME)/include
Updating Java configuration in /Library/Frameworks/R.framework/Resources
Done.
And when trying to install rJava afterwards,
computer: home$ R CMD INSTALL ~/Downloads/rJava_0.9-4.tar.gz
* installing to library ‘/Library/Frameworks/R.framework/Versions/2.15/Resources/library’
* installing *source* package ‘rJava’ ...
checking for gcc... gcc -arch x86_64 -std=gnu99
checking for C compiler default output file name... a.out
/* Passes all checks */
configure: checking whether gcc -arch x86_64 -std=gnu99 supports static inline...yes
checking whether setjmp.h is POSIX.1 compatible... yes
checking whether sigsetjmp is declared... yes
checking whether siglongjmp is declared... yes
checking Java support in R... present:
interpreter : '/usr/bin/java'
archiver : '/usr/bin/jar'
compiler : '/usr/bin/javac'
header prep.: '/usr/bin/javah'
cpp flags : '-I/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/include'
java libs : '-framework JavaVM'
checking whether JNI programs can be compiled... configure: error: Cannot compile a simple JNI program. See config.log for details.
Make sure you have Java Development Kit installed and correctly registered in R.
If in doubt, re-run "R CMD javareconf" as root.
ERROR: configuration failed for package ‘rJava’
* removing ‘/Library/Frameworks/R.framework/Versions/2.15/Resources/library/rJava’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/2.15/Resources/library/rJava’
An alternative attempt where /usr/bin/javac is replaced by /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Homefails just the same.
I am running Mac OS 10.7.3 and
computer: home$ java -version
java version "1.6.0_31"
Java(TM) SE Runtime Environment (build 1.6.0_31-b04-415-11M3646)
Java HotSpot(TM) 64-Bit Server VM (build 20.6-b01-415, mixed mode)
The following is in my .bash_profile
export JAVA_HOME=/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Additionally, I have the same problem on Red-Hat. I hope any fix provided will work there too, but if it won't and why it won't is know, please explain.
I've been using this site's incredible knowledge base for a couple of years now, but this is my first post. Mucho thanks in advance.
Some (not all) of the resources I have already browsed through are
https://stat.ethz.ch/pipermail/r-devel/2008-November/051224.html
https://stat.ethz.ch/pipermail/r-help/2008-October/177688.html
R: rJava package install failing
Please note that the apt-get solution in the last link is of no use to me (I think) unless there is an equiv solution for port and/or yum.
I am using Redhat Linux 7.1
I was getting the same problem as above and I performed the following steps
1) Edit /usr/lib64/R/etc/Renviron and add "CPPFLAGS=${CPPFLAGS-'-ldl'}" to the end of the file
2) Then find the java home and set it like below ( set java home till /jre)
$export JAVA_HOME=/usr/lib/jvm/java-1.7.1-ibm-1.7.1.3.10-1jpp.1.el7_1.x86_64/jre
$export PATH=$PATH:$JAVA_HOME/bin
$R CMD javareconf
3) invoke R from commandline
$R
> install.packages("rJava")
> install.packages("RJDBC",dep=TRUE)
> q()
Save workspace image? [y/n/c]: y
I had a recent variation on this same problem with RHEL 6.5. I reviewed this thread and many others. The ptoblem was that the dynamic load modules were not found when testing the complile of the JNI programs. My fix was to insert "CPPFLAGS=${CPPFLAGS-'-ldl'}" into file
/usr/lib64/R/etc/Renviron

For Ruby on Rails, how to "gem install mysql2" after upgrading from Leopard to Snow Leopard?

It always says:
ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.
/Users/peter/.rvm/rubies/ruby-1.9.2-p180/bin/ruby extconf.rb
checking for rb_thread_blocking_region()... *** 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.
similar things happen if it is sqlite3:
ERROR: Error installing sqlite3:
ERROR: Failed to build gem native extension.
/Users/peter/.rvm/rubies/ruby-1.9.2-p180/bin/ruby extconf.rb
checking for sqlite3.h... *** 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.
Update: at least sqlite3 is building now... that is after I rvm remove 1.9.2-p180 and removing all the 1.9.2, and reinstall by rvm install 1.9.2 and now sqlite3 can be bundle installed, but mysql2 still has problem.
I installed the 64 bit version of MySQL server and it will bundle install, and then this question helped with the
Library not loaded: libmysqlclient.18.dylib (LoadError)
solution: Library not loaded: libmysqlclient.16.dylib error when trying to run 'rails server' on OS X 10.6 with mysql2 gem

Resources