Here I am trying to fetch data from MS-SQL Server 2008 to my Rails application on Ubuntu 10. But I am unable to install tiny_tds. I follow the step given at github. But no response. Please guide me to setup correctly.
Used gem command :: gem install tiny_tds
This command as well :: gem install tiny_tds –with-freetds-include=/usr/local/include/freetds –with-freetds-lib=/usr/local/lib
Error :
Installing tiny_tds (0.4.5) with native extensions /home/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/rubygems/installer.rb:483:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
/home/.rvm/rubies/ruby-1.9.2-p180/bin/ruby extconf.rb
looking for library directory /home/.rvm/gems/ruby-1.9.2-p180#rails3/lib ... no
looking for library directory /home/.rvm/gems/ruby-1.9.2-p180#rails3/lib/freetds ... no
looking for library directory /home/.rvm/gems/ruby-1.9.2-p180#global/lib ... no
looking for library directory /home/.rvm/gems/ruby-1.9.2-p180#global/lib/freetds ... no
looking for library directory /home/.rvm/rubies/ruby-1.9.2-p180/lib ... yes
checking for main() in -lsybdb... no
looking for library directory /home/.rvm/rubies/ruby-1.9.2-p180/lib/freetds ... no
looking for library directory /home/.rvm/lib ... yes
checking for main() in -lsybdb... no
looking for library directory /home/.rvm/lib/freetds ... no
looking for library directory /home/lib ... no
looking for library directory /home/lib/freetds ... no
looking for library directory /usr/local/lib ... yes
checking for main() in -lsybdb... no
looking for library directory /usr/local/lib/freetds ... no
looking for library directory /usr/lib ... yes
checking for main() in -lsybdb... no
-----
Can not find FreeTDS's db-lib or include directory.
-----
*** 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/.rvm/rubies/ruby-1.9.2-p180/bin/ruby
--enable-iconv
--disable-iconv
--enable-iconv
--disable-iconv
--with-freetds-dir
--without-freetds-dir
--with-freetds-include
--without-freetds-include=${freetds-dir}/include
--with-freetds-lib
--without-freetds-lib=${freetds-dir}/lib
--enable-lookup
--disable-lookup
--with-sybdblib
--without-sybdblib
--with-sybdblib
--without-sybdblib
--with-sybdblib
--without-sybdblib
--with-sybdblib
--without-sybdblib
looking for library directory /usr/lib/freetds ... no
looking for library directory /usr/local/ruby/lib ... no
looking for library directory /usr/local/ruby/lib/freetds ... no
Gem files will remain installed in /home/.rvm/gems/ruby-1.9.2-p180#rails3/gems/tiny_tds-0.4.5 for inspection.
Results logged to /home/.rvm/gems/ruby-1.9.2-p180#rails3/gems/tiny_tds-0.4.5/ext/tiny_tds/gem_make.out
from /home/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/rubygems/installer.rb:486:in `block in build_extensions'
from /home/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/rubygems/installer.rb:446:in `each'
from /home/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/rubygems/installer.rb:446:in `build_extensions'
from /home/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/rubygems/installer.rb:198:in `install'
from /home/.rvm/gems/ruby-1.9.2-p180#rails3/gems/bundler-1.0.15/lib/bundler/source.rb:101:in `block in install'
from /home/.rvm/gems/ruby-1.9.2-p180#rails3/gems/bundler-1.0.15/lib/bundler/rubygems_integration.rb:78:in `preserve_paths'
from /home/.rvm/gems/ruby-1.9.2-p180#rails3/gems/bundler-1.0.15/lib/bundler/source.rb:91:in `install'
from /home/.rvm/gems/ruby-1.9.2-p180#rails3/gems/bundler-1.0.15/lib/bundler/installer.rb:58:in `block (2 levels) in run'
from /home/.rvm/gems/ruby-1.9.2-p180#rails3/gems/bundler-1.0.15/lib/bundler/rubygems_integration.rb:93:in `with_build_args'
from /home/.rvm/gems/ruby-1.9.2-p180#rails3/gems/bundler-1.0.15/lib/bundler/installer.rb:57:in `block in run'
from /home/.rvm/gems/ruby-1.9.2-p180#rails3/gems/bundler-1.0.15/lib/bundler/spec_set.rb:12:in `block in each'
from /home/.rvm/gems/ruby-1.9.2-p180#rails3/gems/bundler-1.0.15/lib/bundler/spec_set.rb:12:in `each'
from /home/.rvm/gems/ruby-1.9.2-p180#rails3/gems/bundler-1.0.15/lib/bundler/spec_set.rb:12:in `each'
from /home/.rvm/gems/ruby-1.9.2-p180#rails3/gems/bundler-1.0.15/lib/bundler/installer.rb:49:in `run'
from /home/.rvm/gems/ruby-1.9.2-p180#rails3/gems/bundler-1.0.15/lib/bundler/installer.rb:8:in `install'
from /home/.rvm/gems/ruby-1.9.2-p180#rails3/gems/bundler-1.0.15/lib/bundler/cli.rb:222:in `install'
from /home/.rvm/gems/ruby-1.9.2-p180#rails3/gems/bundler-1.0.15/lib/bundler/vendor/thor/task.rb:22:in `run'
from /home/.rvm/gems/ruby-1.9.2-p180#rails3/gems/bundler-1.0.15/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
from /home/.rvm/gems/ruby-1.9.2-p180#rails3/gems/bundler-1.0.15/lib/bundler/vendor/thor.rb:246:in `dispatch'
from /home/.rvm/gems/ruby-1.9.2-p180#rails3/gems/bundler-1.0.15/lib/bundler/vendor/thor/base.rb:389:in `start'
from /home/.rvm/gems/ruby-1.9.2-p180#rails3/gems/bundler-1.0.15/bin/bundle:13:in `<top (required)>'
from /home/.rvm/gems/ruby-1.9.2-p180#rails3/bin/bundle:19:in `load'
from /home/.rvm/gems/ruby-1.9.2-p180#rails3/bin/bundle:19:in `<main>'
Did you install freeTDS prior to install the gem?
sudo apt-get install freetds-dev
Then
gem install tiny_tds
The answer above is correct, this is just an additional note for those mac folks that prefer homebrew
It command is essentially the exact same:
brew install freetds
As ar3 says, the answer above is correct. For those on CentOS, the RPM is freetds-devel, not freetds-dev (in case you're as soft with sysadmin as I am).
yum install freetds-devel
For mac users first install freetds by gem install tiny_tds
then get the freetds path by ls /opt/homebrew/Cellar/freetds
my version is 1.3.10
then
gem install tiny_tds -- --with-freetds-dir=/opt/homebrew/Cellar/freetds/1.3.10
Try with this,
Download freetds from following link and install it
freetds download link
Install with following instructions:
cd /home/user/Downloads/
tar -zxvf freetds-1.00.23.tar.gz
Then
cd freetds-1.00.23/
./configure
make
sudo make install
After freetds installation complete, try with bundle install
This will solve freetds dependency issue.
Related
I have working mariadb 10.1 server.
I install ruby 2.3.0 on ubuntu 16.04.
I install libmariadbd-dev and libmariadbclient-dev.
When I try "gem install mysql2", then a recive message:
Building native extensions with: '--with-mysql-dir=/usr/local/mysql'
This could take a while...
ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.
current directory: /var/lib/gems/2.3.0/gems/mysql2-0.4.4/ext/mysql2
/usr/bin/ruby2.3 -r ./siteconf20160615-5183-kj9yds.rb extconf.rb --with-mysql-dir=/usr/local/mysql
checking for ruby/thread.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.
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/bin/$(RUBY_BASE_NAME)2.3
/usr/lib/ruby/2.3.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /usr/lib/ruby/2.3.0/mkmf.rb:587:in `try_cpp'
from /usr/lib/ruby/2.3.0/mkmf.rb:1091:in `block in have_header'
from /usr/lib/ruby/2.3.0/mkmf.rb:942:in `block in checking_for'
from /usr/lib/ruby/2.3.0/mkmf.rb:350:in `block (2 levels) in postpone'
from /usr/lib/ruby/2.3.0/mkmf.rb:320:in `open'
from /usr/lib/ruby/2.3.0/mkmf.rb:350:in `block in postpone'
from /usr/lib/ruby/2.3.0/mkmf.rb:320:in `open'
from /usr/lib/ruby/2.3.0/mkmf.rb:346:in `postpone'
from /usr/lib/ruby/2.3.0/mkmf.rb:941:in `checking_for'
from /usr/lib/ruby/2.3.0/mkmf.rb:1090:in `have_header'
from extconf.rb:16:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/mysql2-0.4.4/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /var/lib/gems/2.3.0/gems/mysql2-0.4.4 for inspection.
Results logged to /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/mysql2-0.4.4/gem_make.out
And I can`t find how to build this gem.
Gem in this situation need 3 packets.
sudo apt-get install libnetcdf-dev libssl-dev libcrypto++-dev
This is for mac but you need to change the path:
gem uninstall mysql2
intall mariadb 10.1 andnecesaary ssl packages or maybe this are not needed
then check the path to the libraries and the tinal folders have the same name:
bundle config --local build.mysql2 "--with-mysql-config=/usr/local/Cellar/mariadb#10.1/10.1.29/bin/mysql_config --with-ldflags=-L/usr/local/opt/openssl/lib --with-cppflags=-I/usr/local/opt/openssl/include"
or without the ssl path
bundle config --local build.mysql2 "--with-mysql-config=/usr/local/Cellar/mariadb#10.1/10.1.29/bin/mysql_config
or directly the gem, but if you come ffrom mysql is better to do it with bundle
gem install mysql2 -v 'x.y.z' -- --with-mysql-config=/usr/local/Cellar/mariadb#10.1/10.1.29/bin/mysql_config
and finally
bundle install
running OSX 10.9.4 and XCode 5.1.1, I switched recently from rvm to Rbenv, so I need to reinstall some gems, not a big deal, but...
I am stuck w Nokogiri gem installation, even after downloading and installing october version of the XCode command line tool and running :
sudo xcode-select -s /Library/Developer/CommandLineTools/
I also installed libxml2 libxslt w brew
I am still getting an error, is there any way to solve this issue ?
yves$ gem install nokogiri
Building native extensions. This could take a while...
Building nokogiri using packaged libraries.
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
/Users/yves/.rbenv/versions/2.1.2/bin/ruby extconf.rb
Building nokogiri using packaged libraries.
checking for iconv.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.
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=/Users/yves/.rbenv/versions/2.1.2/bin/ruby
--help
--clean
--use-system-libraries
--enable-static
--disable-static
--with-zlib-dir
--without-zlib-dir
--with-zlib-include
--without-zlib-include=${zlib-dir}/include
--with-zlib-lib
--without-zlib-lib=${zlib-dir}/lib
--enable-cross-build
--disable-cross-build
/Users/yves/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /Users/yves/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:587:in `try_cpp'
from /Users/yves/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:1067:in `block in have_header'
from /Users/yves/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:918:in `block in checking_for'
from /Users/yves/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:351:in `block (2 levels) in postpone'
from /Users/yves/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:321:in `open'
from /Users/yves/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:351:in `block in postpone'
from /Users/yves/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:321:in `open'
from /Users/yves/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:347:in `postpone'
from /Users/yves/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:917:in `checking_for'
from /Users/yves/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:1066:in `have_header'
from extconf.rb:103:in `have_iconv?'
from extconf.rb:148:in `block (2 levels) in iconv_prefix'
from extconf.rb:90:in `preserving_globals'
from extconf.rb:143:in `block in iconv_prefix'
from extconf.rb:120:in `each_iconv_idir'
from extconf.rb:137:in `iconv_prefix'
from extconf.rb:427:in `block in <main>'
from extconf.rb:161:in `block in process_recipe'
from extconf.rb:154:in `tap'
from extconf.rb:154:in `process_recipe'
from extconf.rb:422:in `<main>'
extconf failed, exit code 1
Gem files will remain installed in /Users/yves/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/nokogiri-1.6.3 for inspection.
Results logged to /Users/yves/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-13/2.1.0-static/nokogiri-1.6.3/gem_make.out
when installing libxml2 libxslt I got a warning , it may interfere with the nokogiri installation ?
yves$ brew install libxml2 libxslt
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/libxml2-2.9
######################################################################## 100.0%
==> Pouring libxml2-2.9.1.mavericks.bottle.1.tar.gz
==> Caveats
This formula is keg-only, so it was not symlinked into /usr/local.
Mac OS X already provides this software and installing another version in
parallel can cause all kinds of trouble.
Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:
LDFLAGS: -L/usr/local/opt/libxml2/lib
CPPFLAGS: -I/usr/local/opt/libxml2/include
what should i do next ? thanks for your advices
I got the same error a few weeks ago. This is how I solved it:
You'll have to install the broken libraries manually. Use Homebrew, which is a package manager for OS X. Make sure you update first brew update, then install the libraries:
brew install libxml2 libxslt
brew link libxml2 libxslt
You may have to install libiconv from source:
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.1.tar.gz
tar xvfz libiconv-1.13.1.tar.gz
cd libiconv-1.13.1
./configure --prefix=/usr/local/Cellar/libiconv/1.13.1
make
sudo make install
And then you should be able to install the gem.
Quoted from documentation here:
http://nokogiri.org/tutorials/installing_nokogiri.html#homebrew_09
You may also need to run rbenv rehash after installing the libraries.
I have found the solution on one of the forums:
https://github.com/sparklemotion/nokogiri/issues/1111
After almost a week of searching this finally did the trick:
sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install nokogiri -- --with-iconv-include=/usr/local/Cellar/libiconv/1.13.1/include --with-iconv-lib=/usr/local/Cellar/libiconv/1.13.1/lib
GL
I got the same issue few days ago and this thread helped me
https://github.com/sparklemotion/nokogiri/issues/1111
Finally the command which worked for me
gem install nokogiri -- --with-xslt-dir=/usr/local/opt/libxslt
I am trying to install Gitorious on Redhat 5. I am following these instructions: https://gitorious.org/gitorious/pages/Rhel_Installation
One of the steps is: rake db:create RAILS_ENV=production
That command fails with the foll error message:
[ gitorious ] sudo rake db:create RAILS_ENV=production
Could not find libdolt-0.33.14 in any of the sources
Run `bundle install` to install missing gems.
When I ran 'bundle install' it fails with:
0: makeup (0.4.4) from /usr/local/lib/ruby/gems/2.0.0/specifications/makeup-0.4.4.gemspec
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb
checking for gmake... yes
checking for cmake... yes
-- cmake .. -DBUILD_CLAR=OFF -DTHREADSAFE=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_FLAGS=-fPIC
Package zlib was not found in the pkg-config search path.
Perhaps you should add the directory containing `zlib.pc'
to the PKG_CONFIG_PATH environment variable
Package 'zlib', required by 'libgit2', not found
-- /usr/bin/gmake
*** 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/bin/ruby
--with-git2-dir
--without-git2-dir
--with-git2-include
--without-git2-include=${git2-dir}/include
--with-git2-lib
--without-git2-lib=${git2-dir}/
extconf.rb:16:in `sys': ERROR: '/usr/bin/gmake' failed (RuntimeError)
from extconf.rb:59:in `block (2 levels) in <main>'
from extconf.rb:54:in `chdir'
from extconf.rb:54:in `block in <main>'
from extconf.rb:51:in `chdir'
from extconf.rb:51:in `<main>'
extconf failed, exit code 1
Gem files will remain installed in /usr/local/lib/ruby/gems/2.0.0/bundler/gems/rugged-5f1b6d177132 for inspection.
Results logged to /usr/local/lib/ruby/gems/2.0.0/bundler/gems/extensions/x86_64-linux/2.0.0-static/rugged-0.19.0/gem_make.out
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/ext/builder.rb:89:in `run'
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/ext/ext_conf_builder.rb:37:in `block in build'
/usr/local/lib/ruby/2.0.0/tempfile.rb:324:in `open'
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/ext/ext_conf_builder.rb:17:in `build'
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/ext/builder.rb:161:in `block (2 levels) in build_extension'
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/ext/builder.rb:160:in `chdir'
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/ext/builder.rb:160:in `block in build_extension'
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/ext/builder.rb:159:in `synchronize'
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/ext/builder.rb:159:in `build_extension'
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/ext/builder.rb:198:in `block in build_extensions'
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/ext/builder.rb:195:in `each'
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/ext/builder.rb:195:in `build_extensions'
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/installer.rb:677:in `build_extensions'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.2/lib/bundler/source/path.rb:174:in `generate_bin'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.2/lib/bundler/source/git.rb:161:in `install'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.2/lib/bundler/installer.rb:111:in `block in install_gem_from_spec'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.2/lib/bundler/rubygems_integration.rb:150:in `with_build_args'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.2/lib/bundler/installer.rb:110:in `install_gem_from_spec'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.2/lib/bundler/installer.rb:265:in `block in install_sequentially'
/usr/local/lib/ruby/2.0.0/forwardable.rb:171:in `each'
/usr/local/lib/ruby/2.0.0/forwardable.rb:171:in `each'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.2/lib/bundler/installer.rb:264:in `install_sequentially'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.2/lib/bundler/installer.rb:97:in `run'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.2/lib/bundler/installer.rb:15:in `install'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.2/lib/bundler/cli.rb:255:in `install'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.2/lib/bundler/vendor/thor/command.rb:27:in `run'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.2/lib/bundler/vendor/thor/invocation.rb:121:in `invoke_command'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.2/lib/bundler/vendor/thor.rb:363:in `dispatch'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.2/lib/bundler/vendor/thor/base.rb:440:in `start'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.2/lib/bundler/cli.rb:10:in `start'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.2/bin/bundle:20:in `block in <top (required)>'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.2/lib/bundler/friendly_errors.rb:5:in `with_friendly_errors'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.2/bin/bundle:20:in `<top (required)>'
/usr/local/bin/bundle:23:in `load'
/usr/local/bin/bundle:23:in `<main>'
An error occurred while installing rugged (0.19.0), and Bundler cannot continue.
Make sure that `gem install rugged -v '0.19.0'` succeeds before bundling.
I did do 'sudo gem install rugged -v '0.19.0'` and it works:
[ gitorious ] sudo gem install rugged -v '0.19.0'
Building native extensions. This could take a while...
Successfully installed rugged-0.19.0
Parsing documentation for rugged-0.19.0
unable to convert "\x80" from ASCII-8BIT to UTF-8 for ../../extensions/x86_64-linux/2.0.0-static/rugged-0.19.0/rugged/rugged.so, skipping
unable to convert "\x80" from ASCII-8BIT to UTF-8 for lib/rugged/rugged.so, skipping
1 gem installed
I tried 'sudo bundle install --verbose' again but it fails the same way.
I then created a /usr/lib/pkgconfig/zlib.pc file and did a setenv of the PKG_CONGIF_PATH to add /usr/lib/pkgconfig.
zlib.pc:
prefix=/usr
exec_prefix=/usr
libdir=/usr/lib
includedir=/usr/include
sharedlibdir=/usr/lib
Name: zlib
Description: zlib compression library
Version: 1.2.3
Requires:
Libs: -L${libdir} -L${sharedlibdir} -lz
Cflags: -I${includedir}
I ran 'sudo bundle install --verbose' and it fails the same way...
The 'Gemfile' is in the main gitorious directory.
Any suggestions?
You're missing dependencies. I don't know the entirety of what you need, but based on libdolt and libgit2 you would need the following:
yum install python-devel libicu-devel zlib-devel
If I am not wrong, there were many changes made to rugged later on, and it caused some version problem with cmake.
Installing latest cmake version, fixed similar problem for me. Try:
yum install cmake
edit:[FIXED]
The problem was that I had it installed already, but didn't know, and tried to install from source. This created two versions and the gem didn't know which to use. I fixed it by going to the downloaded source and running
sudo make uninstall
Then I ran gem install rmagick again and it worked!
[ORIGINAL PROBLEM]
I'm trying to install the rmagick gem like in this railscast. Here's a snippet of what I put in my gemfile:
gem 'rmagick'
gem 'carrierwave'
And when I run bundle install I get the following output:
Installing rmagick (2.13.1) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/home/techusb/.rbenv/versions/1.9.3-p125/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
extconf.rb:128: Use RbConfig instead of obsolete and deprecated Config.
checking for cc... yes
checking for Magick-config... yes
Warning: Found more than one ImageMagick installation. This could cause problems at runtime.
/usr/local/bin/Magick-config reports version 6.8.0 Q16 is installed in /usr/local
/usr/bin/Magick-config reports version 1.3.12 is installed in /usr
Using 6.8.0 Q16 from /usr/local.
checking for ImageMagick version >= 6.4.9... yes
checking for HDRI disabled version of ImageMagick... yes
checking for stdint.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.
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/techusb/.rbenv/versions/1.9.3-p125/bin/ruby
/home/techusb/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /home/techusb/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:506:in `try_cpp'
from /home/techusb/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:931:in `block in have_header'
from /home/techusb/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for'
from /home/techusb/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone'
from /home/techusb/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /home/techusb/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone'
from /home/techusb/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /home/techusb/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:280:in `postpone'
from /home/techusb/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for'
from /home/techusb/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:930:in `have_header'
from extconf.rb:193:in `<main>'
Gem files will remain installed in /home/techusb/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rmagick-2.13.1 for inspection.
Results logged to /home/techusb/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rmagick-2.13.1/ext/RMagick/gem_make.out
An error occurred while installing rmagick (2.13.1), and Bundler cannot continue.
Make sure that `gem install rmagick -v '2.13.1'` succeeds before bundling.
Regarding this line:
The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
I think I've exhausted all the information on how to fix this error via google/stackoverflow. I already tried installing the development packages and such. Not sure where to go from here. Any help greatly appreciated.
=> https://stackoverflow.com/a/10647962/1420038;
"The new correct way is to install libmagickwand-dev:
sudo apt-get install libmagickwand-dev
Then you should be able to install rmagick no problem."
works on debian 6.0.6
I'm attempting to do a bundle update on my rails application but I get the following error:
Installing ffi (1.0.11) with native extensions Unfortunately, a fatal error has occurred. Please report this error to the Bundler issue tracker at https://github.com/carlhuda/bundler/issues so that we can fix it. Thanks!
/Users/Kyle/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:552:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
/Users/Kyle/.rvm/rubies/ruby-1.9.3-p125/bin/ruby extconf.rb
checking for ffi.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.
Provided configuration options:
--with-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=/Users/Kyle/.rvm/rubies/ruby-1.9.3-p125/bin/ruby
--with-ffi_c-dir
--without-ffi_c-dir
--with-ffi_c-include
--without-ffi_c-include=${ffi_c-dir}/include
--with-ffi_c-lib
--without-ffi_c-lib=${ffi_c-dir}/lib
--with-libffi-config
--without-libffi-config
--with-pkg-config
--without-pkg-config
/Users/Kyle/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /Users/Kyle/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:506:in `try_cpp'
from /Users/Kyle/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:931:in `block in have_header'
from /Users/Kyle/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for'
from /Users/Kyle/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone'
from /Users/Kyle/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /Users/Kyle/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone'
from /Users/Kyle/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /Users/Kyle/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:280:in `postpone'
from /Users/Kyle/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for'
from /Users/Kyle/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:930:in `have_header'
from extconf.rb:9:in `<main>'
Gem files will remain installed in /Users/Kyle/.rvm/gems/ruby-1.9.3-p125/gems/ffi-1.0.11 for inspection.
Results logged to /Users/Kyle/.rvm/gems/ruby-1.9.3-p125/gems/ffi-1.0.11/ext/ffi_c/gem_make.out
from /Users/Kyle/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:530:in `block in build_extensions'
from /Users/Kyle/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:505:in `each'
from /Users/Kyle/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:505:in `build_extensions'
from /Users/Kyle/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:180:in `install'
from /Users/Kyle/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.0/lib/bundler/source.rb:90:in `block in install'
from /Users/Kyle/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.0/lib/bundler/rubygems_integration.rb:82:in `preserve_paths'
from /Users/Kyle/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.0/lib/bundler/source.rb:89:in `install'
from /Users/Kyle/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.0/lib/bundler/installer.rb:73:in `block in install_gem_from_spec'
from /Users/Kyle/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.0/lib/bundler/rubygems_integration.rb:97:in `with_build_args'
from /Users/Kyle/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.0/lib/bundler/installer.rb:72:in `install_gem_from_spec'
from /Users/Kyle/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.0/lib/bundler/installer.rb:56:in `block in run'
from /Users/Kyle/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.0/lib/bundler/installer.rb:55:in `run'
from /Users/Kyle/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.0/lib/bundler/installer.rb:12:in `install'
from /Users/Kyle/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.0/lib/bundler/cli.rb:271:in `update'
from /Users/Kyle/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.0/lib/bundler/vendor/thor/task.rb:22:in `run'
from /Users/Kyle/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.0/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
from /Users/Kyle/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.0/lib/bundler/vendor/thor.rb:263:in `dispatch'
from /Users/Kyle/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.0/lib/bundler/vendor/thor/base.rb:386:in `start'
from /Users/Kyle/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.0/bin/bundle:13:in `<top (required)>'
from /Users/Kyle/.rvm/gems/ruby-1.9.3-p125/bin/bundle:19:in `load'
from /Users/Kyle/.rvm/gems/ruby-1.9.3-p125/bin/bundle:19:in `<main>'
Any ideas?
I ran into a problem similar to this yesterday.
I was able to resolve it using these steps:
https://github.com/carlhuda/bundler/blob/1-0-stable/ISSUES.md
Essentially, there was a problem with my bundle and clearing things out and rebuilding things from scratch resolved it.
The steps are repeated here:
# remove user-specific gems and git repos
rm -rf ~/.bundle/ ~/.gem/
# remove system-wide git repos and git checkouts
rm -rf $GEM_HOME/bundler/ $GEM_HOME/cache/bundler/
# remove project-specific settings and git repos
rm -rf .bundle/
# remove project-specific cached .gem files
rm -rf vendor/cache/
# remove the saved resolve of the Gemfile
rm -rf Gemfile.lock
# try to install one more time
bundle install
Although, given the message in the output text:
You have to install development tools first.
That makes me think you just may not have installed the Apple Xcode Developer Tools. Have you checked that? (I believe they're available in the Mac App Store.)
For Xcode 5 and later:
$ xcode-select --install
to install the Command Line Tools.
Once installed gcc-4.2 from brew, you need to create symlink of it:
ln -s /usr/bin/gcc /usr/bin/gcc-4.2
For me I just didn't have gcc installed, solve in Ubuntu by:
sudo apt install build-essential
Just in case try to run
sudo /usr/bin/gcc
You'll probably see license agreement, so scroll thgough it, type "agree" and try to install gem again.
Please note:
If you have recently updated Xcode, you may just need to open Xcode and accept the latest agreement.
I had the same issue and had recently installed an update to Xcode (v6.1) and solved it with these steps:
open Xcode
accept new agreement
rerun bundle update
Installing "Command Line Tools" via Xcode did the trick.
If you have Xcode 4.5 open Preferences > Downloads > Select Components tab and click Install next to Command Line Tools.
Although I installed from Xcode, you can also download the package without it from Apple's Developer Downloads and searching for "Command Line Tools".
I had to accept the Xcode User licence:
Running sudo xcrun cc should bring up the cli version of the Xcode
license agreement. Another option is to open Xcode.app and agree in
the GUI.
Possibly caused by updating OSX.
http://blog.tomhennigan.co.uk/post/62238548037/agreeing-to-the-xcode-license-from-the-command
Mac OSx 10.10.2 yosemite
CC=/usr/bin/i686-apple-darwin11-llvm-gcc-4.2 gem install ffi
and thats it -check that you have 4.2 compiler in /usr/bin that you can hook into
ls /usr/bin|grep gcc|grep 4.2
You do not have to wipe out all of your local gems or override symlinks to do this - its a waste of time and will likely create more problems then it solves.
please note, your bin path may be different if you needed to install via brew
brew install apple-gcc42
Also method:
export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk
bundle update
ffi.h is to be found in ${SDKROOT}/usr/include/ffi/ffi.h.
Ubuntu Trusty LTS 14.04
Needed to switch from ruby 2.2.1 to 2.3.0 to support newer gem versions in Rails app.
Solution:
rvm get stable
rvm remove 2.3.0
rvm install 2.3.0
bundle install