sudo env ARCHFLAGS="-arch x86_64" gem install do_sqlite3
Building native extensions. This could take a while...
ERROR: Error installing do_sqlite3:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
checking for sqlite3.h... yes
checking for sqlite3_open() in -lsqlite3... no
*** 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.
I have sqlite3-ruby installed as well as the header files, but for some reason it fails when checking for sqlite3_open()
I am having the same issue:
sudo env ARCHFLAGS="-arch x86_64" gem install do_sqlite3
Building native extensions. This could take a while...
ERROR: Error installing do_sqlite3:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/do_sqlite3-0.10.1.1 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/do_sqlite3-0.10.1.1/ext/do_sqlite3/gem_make.out
I am running Snow Leopard. I'm not sure about previous installations of sqlite3 but I did try this:
port search sqlite
And it returned the following (among others):
...
sqlite3 #3.6.17 (databases)
an embedded SQL database engine
To be honest I'm not sure what all this means. What would anyone suggest for getting do_sqlite3 installed for use in Rails 3 with DataMapper? (Also, running it without the 'env ARCHFLAGS="-arch x86_64"' gives the same errors.)
Ok, first question is why are you passing the ARCHFLAGS? That should not be necessary, if it also doesn't work without passing them, what is the output you get then?
Next question is what version of sqlite3 is it picking up? Do you have sqlite3 installed through Macports for example? Did you upgrade to Snow Leopard recently and still have an sqlite3 install from before upgrading?
Related
I am trying to update psych to 5.0.0, but I get the following error message:
Updating psych
Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions. This could take a while...
ERROR: Error installing psych:
ERROR: Failed to build gem native extension.
current directory: C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/psych-5.0.0/ext/psych
C:/Ruby31-x64/bin/ruby.exe -I C:/Ruby31-x64/lib/ruby/site_ruby/3.1.0 extconf.rb
checking for yaml.h... no
yaml.h not found
*** 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:
.
.
.
To see why this extension failed to compile, please check the mkmf.log which can be found here:
C:/Ruby31-x64/lib/ruby/gems/3.1.0/extensions/x64-mingw-ucrt/3.1.0/psych-5.0.0/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/psych-5.0.0 for inspection.
Results logged to C:/Ruby31-x64/lib/ruby/gems/3.1.0/extensions/x64-mingw-ucrt/3.1.0/psych-5.0.0/gem_make.out
Tried gem update, gem pristine --all, same error.
Any tips how to fix this in Windows?
Thank you!
Not sure how it was fixed but I ran gem update and psych was updated to 5.0.2 without an error.
I had a similar problem on Mac running OSX 13.2. Bundle install failed because it couldn't find yaml.h.
Since I was on Mac and running Homebrew, I did a
brew install libyaml
and then re-ran bundle install. It worked correctly.
You need to install libyaml via pacman -S mingw-w64-ucrt-x86_64-libyamlin the command prompt with ruby
I'm attempting to build a ruby project which uses postgres running locally. Build fails on the pg gem install. I get this error
$ gem install pg -v '0.12.2'
Building native extensions. This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
/path/to/.rvm/rubies/ruby-1.9.3-p545/bin/ruby extconf.rb
checking for pg_config... no
No pg_config... trying anyway. If building fails, please try again with
--with-pg-config=/path/to/pg_config
so... I pass the pg_config path, and get a different error:
$ gem install pg --with-pg-config=/usr/pgsql-9.2/bin/pg_config -v '0.12.2'
ERROR: While executing gem ... (OptionParser::InvalidOption)
invalid option: --with-pg-config=/usr/pgsql-9.2/bin/pg_config
Very confused.
Make sure you have libpq-dev package installed. If you don't, install it and try installing pg again without the --with-pg-config parameter.
In regards to the --with-pg-config parameter:
When passing parameters to the gem you're installing you must use two dashes before the two dashes from the option, like so:
gem install gem-name -- --gem-option
So what you want to run in order to achieve installing pg with the --with-pg-config option is:
gem install pg -v '0.12.2' -- --with-pg-config=/usr/pgsql-9.2/bin/pg_config
EDIT
Also, one last tip, after searching a bit more about this issue I found that your ruby version and architecture might affect pg's installation, I'm quoting this link:
I was hesitant to uninstall everything so I just uninstalled Ruby and reinstalled with the option set to 64-bit only (platform: "x86_64-darwin12.2.0"). After reinstalling Ruby with this option, the PG gem installed without hitch and I am back to being happy.
I'm trying to setup environtment for ruby project.
But when I run 'bundle', I have error during installing 'fii' gem:
Installing ffi (1.8.1)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/bmalets/.rvm/rubies/ruby-1.9.3-p448/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.
/Users/bmalets/.rvm/rubies/ruby-1.9.3-p448/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.
Gem files will remain installed in /Users/bmalets/.rvm/gems/ruby-1.9.3-p448#api2/gems/ffi-1.8.1 for inspection.
Results logged to /Users/bmalets/.rvm/gems/ruby-1.9.3-p448#api2/gems/ffi-1.8.1/ext/ffi_c/gem_make.out
An error occurred while installing ffi (1.8.1), and Bundler cannot continue.
Make sure that `gem install ffi -v '1.8.1'` succeeds before bundling.
My environment:
OS_X 10.8.4
ruby 1.9.3p448
Xcode 4.6.3
libffi-3.0.13
Please, help me to fix it.
Make sure that you have installed Apple Xcode and Command Line Tools (look at this screenshot):
https://developer.apple.com/technologies/tools/
After that, don't forget to install libffi.
1) if you are using homebrew
brew install libffi
2) if you are using macport
sudo port install libffi
when I try to install the Ruby gem sequel_pg I get the following error meassage:
~$ sudo gem update
Updating installed gems
Updating sequel_pg
Building native extensions. This could take a while...
ERROR: Error installing sequel_pg:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
checking for main() in -lpq... yes
checking for libpq-fe.h... yes
checking for PQsetSingleRowMode()... no
creating Makefile
make
compiling sequel_pg.c
sequel_pg.c: In function ‘spg_timestamp_error’:
sequel_pg.c:279:3: error: format not a string literal and no format arguments [- Werror=format-security]
cc1: some warnings being treated as errors
make: *** [sequel_pg.o] Error 1
Gem files will remain installed in /var/lib/gems/1.9.1/gems/sequel_pg-1.6.5 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/sequel_pg-1.6.5/ext/sequel_pg/gem_make.out
Nothing to update
I am running Lubuntu 13.04. The depencies: pg and sequel are installed. Packages files postgresql and postgresql-server-dev-9.1 is also installed
Does anyone have a clue?
This bug was fixed in master of the gem with this patch. You should wait for new release or install head version of the gem.
I've installed the newer version of SQLite3 (3.7.0.1) on my macbook (OS X 10.5) but 'sqlite3 --version' gives me the older version I had on my system:
$ sqlite3 --version
3.4.0
I suppose I was expecting this version to be overwritten but that doesn't seem to be the case. Can anyone clue me in? I'd really appreciate it, right now I'm trying to get started with Rails but I had received this error:
$ sudo gem install sqlite3-ruby
Password:
Building native extensions. This could take a while...
ERROR: Error installing sqlite3-ruby:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
checking for #include <sqlite3.h>
... yes
checking for sqlite3_libversion_number() in -lsqlite3... yes
checking for rb_proc_arity()... no
checking for sqlite3_initialize()... no
sqlite3-ruby only supports sqlite3 versions 3.6.16+, please upgrade!
*** 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.
Oddly enough though since installing the new version of sqlite3 this error has gone away (in other words sqlite3-ruby was installed successfully) - but sqlite3 still points to 3.4.0, I've checked the directories in my $PATH and they only contain 3.7.0.1
Thanks in advance for any help.
Have you tried telling the OS to use the new one by typing hash sqlite3? Sometimes an OS remembers the original version and doesn't know to refresh itself and hash will poke it in the eye.
Otherwise you might need to tell the gem to look in the right place. Check into these options in the installer:
--with-sqlite3-dir
--with-sqlite3-include
--with-sqlite3-lib
I also face the same problem on my CentOS Server. I found this solution work for me. Hope it help! http://amitava1.blogspot.com/2010/08/ruby-on-rails-on-centos-55-with.html
main process:
$ wget http://www.sqlite.org/sqlite-amalgamation-3.7.0.1.tar.gz
$ tar xvzf sqlite-amalgamation-3.7.0.1.tar.gz
$ cd sqlite-3.7.0.1
$ ./configure --prefix=/opt/local/sqlite-3.7.0.1
$ make
$ sudo make install
$ sudo /opt/ruby-enterprise-1.8.7-2010.02/bin/gem install sqlite3-ruby -- --with-sqlite3-dir=/opt/local/sqlite-3.7.0.1
Building native extensions. This could take a while...
Successfully installed sqlite3-ruby-1.3.1
1 gem installed