I am trying to create my first application on ruby rails.
I am on Mac OsX (Mavericks)
I have the latest xCode installed (5 i believe) + command line tools
I have installed the bitnami bundle ruby stack
I have added rails (sudo gem install rails -V)
All steps until creating my own project work ---- see here
In the ruby console I type:
sudo rails new helloworld
.. then it does some creational stuff till it hits the following lines:
run bundle install
Fetching gem metadata from https://rubygems.org/..........
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Using rake (10.1.1)
Using i18n (0.6.9)
Using minitest (4.7.5)
Using multi_json (1.8.4)
Using atomic (1.1.14)
Using thread_safe (0.1.3)
Using tzinfo (0.3.38)
Using activesupport (4.0.2)
Using builder (3.1.4)
Using erubis (2.7.0)
Using rack (1.5.2)
Using rack-test (0.6.2)
Using actionpack (4.0.2)
Using mime-types (1.25.1)
Using polyglot (0.3.3)
Using treetop (1.4.15)
Using mail (2.5.4)
Using actionmailer (4.0.2)
Using activemodel (4.0.2)
Using activerecord-deprecated_finders (1.0.3)
Using arel (4.0.1)
Using activerecord (4.0.2)
Using bundler (1.3.5)
Using coffee-script-source (1.7.0)
Using execjs (2.0.2)
Using coffee-script (2.2.0)
Using thor (0.18.1)
Using railties (4.0.2)
Using coffee-rails (4.0.1)
Using hike (1.2.3)
Using jbuilder (1.5.3)
Using jquery-rails (3.1.0)
Installing json (1.8.1)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Applications/rubystack-1.9.3-19/ruby/bin/ruby extconf.rb
creating Makefile
make
compiling generator.c
sh: line 1: 58350 Trace/BPT trap: 5 /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk / -find gcc 2> /dev/null
gcc: error: unable to find utility "gcc", not a developer tool or in PATH
make: *** [generator.o] Error 72
Gem files will remain installed in /Applications/rubystack-1.9.3-19/ruby/lib/ruby/gems/1.9.1/gems/json-1.8.1 for inspection.
Results logged to /Applications/rubystack-1.9.3-19/ruby/lib/ruby/gems/1.9.1/gems/json-1.8.1/ext/json/ext/generator/gem_make.out
An error occurred while installing json (1.8.1), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.1'` succeeds before bundling.
Installing json-1.8.1 within rubyconsole doesn't work - I get the following error:
sudo gem install json -v '1.8.1'
bash-3.2$ sudo gem install json -v '1.8.1'
Password:
Building native extensions. This could take a while...
ERROR: Error installing json:
ERROR: Failed to build gem native extension.
/Applications/rubystack-1.9.3-19/ruby/bin/ruby extconf.rb
creating Makefile
make
compiling generator.c
sh: line 1: 60535 Trace/BPT trap: 5 /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk / -find gcc 2> /dev/null
gcc: error: unable to find utility "gcc", not a developer tool or in PATH
make: *** [generator.o] Error 72
Gem files will remain installed in /Applications/rubystack-1.9.3-19/ruby/lib/ruby/gems/1.9.1/gems/json-1.8.1 for inspection.
Results logged to /Applications/rubystack-1.9.3-19/ruby/lib/ruby/gems/1.9.1/gems/json-1.8.1/ext/json/ext/generator/gem_make.out
Outside rubyconsole it works. However, that does not solve the issue above.
I followed these steps:
How to use/install gcc on Mac OS X 10.8 / Xcode 4.4
I also followed the steps here:
http://new-bamboo.co.uk/blog/2013/10/24/3-quick-tips-for-coding-with-os-x-10-9-mavericks
Any help would be much appreciated .. Thanks, George
UPDATE: I run the following:
cd /usr/bin
sudo mv gcc gcc_mavs
sudo ln -s /usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2 gcc
Now I get a different error message:
Installing json (1.8.1)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Applications/rubystack-1.9.3-19/ruby/bin/ruby extconf.rb
creating Makefile
make
compiling generator.c
sh: line 1: 67709 Trace/BPT trap: 5 /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk / -find as 2> /dev/null
as: error: unable to find utility "as", not a developer tool or in PATH
make: *** [generator.o] Error 2
Gem files will remain installed in /Applications/rubystack-1.9.3-19/ruby/lib/ruby/gems/1.9.1/gems/json-1.8.1 for inspection.
Results logged to /Applications/rubystack-1.9.3-19/ruby/lib/ruby/gems/1.9.1/gems/json-1.8.1/ext/json/ext/generator/gem_make.out
An error occurred while installing json (1.8.1), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.1'` succeeds before bundling.
Ok, completely removed xcode & developer tools.
Reinstalled xocode 5.02 & developer tools for maverick (late october)
run the following command:
sudo xcode-select -switch /Library/Developer/CommandLineTools
Sovled.
Related
I'm completely new to Ruby and Ruby on Rails, and trying to get my feet wet in it. Just installed Ruby and ROR on Win 10 64 bit, and from the command prompt seem successfully:
c:\>ruby -v
ruby 2.2.6p396 (2016-11-15 revision 56800) [x64-mingw32]
c:\>rails -v
Rails 5.0.1
However, I can't create a project, it returns the following:
c:\>rails new demo
Using tilt 2.0.5
Using sqlite3 1.3.13
Using turbolinks-source 5.0.0
Using tzinfo 1.2.2
Using nokogiri 1.7.0.1
Using rack-test 0.6.3
Using sprockets 3.7.1
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
C:/Ruby22-x64/bin/ruby.exe extconf.rb
C:/Ruby22-x64/bin/ruby.exe: No such file or directory -- extconf.rb (LoadError)
extconf failed, exit code 1
Gem files will remain installed in
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/nio4r-1.2.1 for inspection.
Results logged to
C:/Ruby22-x64/lib/ruby/gems/2.2.0/extensions/x64-mingw32/2.2.0/nio4r-1.2.1/gem_make.out
An error occurred while installing nio4r (1.2.1), and Bundler cannot continue.
Make sure that `gem install nio4r -v '1.2.1'` succeeds before bundling.
So the two major errors seem to be:
1) Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
I thought that would be resolved by installing DevKit, at https://rubyinstaller.org/add-ons/devkit/ but no cigar
2) C:/Ruby22-x64/bin/ruby.exe extconf.rb
C:/Ruby22-x64/bin/ruby.exe: No such file or directory -- extconf.rb (LoadError)
I have no idea this error. C:/Ruby22-x64/bin/ruby.exe is the correct path to Ruby on my system. Can anyone shed some light?
I have tried in the last week with a fresh copy of Linux mint 18 Ubuntu 16.04 and fedora 24?(the latest one). All 3 give me the error with debug inspector.
xjackparsons93#93 ~/ty $ bundle install
Fetching gem metadata from https://rubygems.org/
Fetching version metadata from https://rubygems.org/
Fetching dependency metadata from https://rubygems.org/
Resolving dependencies...
Using rake 11.2.2
Using i18n 0.7.0
Using json 1.8.3
Using minitest 5.9.0
Using thread_safe 0.3.5
Using builder 3.2.2
Using erubis 2.7.0
Using mini_portile2 2.1.0
Using pkg-config 1.1.7
Using rack 1.6.4
Using mime-types-data 3.2016.0521
Using arel 6.0.3
Installing debug_inspector 0.0.2 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /tmp/bundler20160808-7120-1xcia5udebug_inspector-0.0.2/gems/debug_inspector-0.0.2/ext/debug_inspector
/usr/bin/ruby2.3 -r ./siteconf20160808-7120-px14tj.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h
extconf failed, exit code 1
Gem files will remain installed in /tmp/bundler20160808-7120-1xcia5udebug_inspector-0.0.2/gems/debug_inspector-0.0.2 for inspection.
Results logged to /tmp/bundler20160808-7120-1xcia5udebug_inspector-0.0.2/extensions/x86_64-linux/2.3.0/debug_inspector-0.0.2/gem_make.out
Using bundler 1.12.5
Installing byebug 9.0.5 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /tmp/bundler20160808-7120-1wwehr9byebug-9.0.5/gems/byebug-9.0.5/ext/byebug
/usr/bin/ruby2.3 -r ./siteconf20160808-7120-1p1pe88.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h
extconf failed, exit code 1
Gem files will remain installed in /tmp/bundler20160808-7120-1wwehr9byebug-9.0.5/gems/byebug-9.0.5 for inspection.
Results logged to /tmp/bundler20160808-7120-1wwehr9byebug-9.0.5/extensions/x86_64-linux/2.3.0/byebug-9.0.5/gem_make.out
Using coffee-script-source 1.10.0
Using execjs 2.7.0
Using thor 0.19.1
Using concurrent-ruby 1.0.2
Using multi_json 1.12.1
Using sass 3.4.22
Using tilt 2.0.5
Using spring 1.7.2
Installing sqlite3 1.3.11 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /tmp/bundler20160808-7120-705k68sqlite3-1.3.11/gems/sqlite3-1.3.11/ext/sqlite3
/usr/bin/ruby2.3 -r ./siteconf20160808-7120-1mdxtv9.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h
extconf failed, exit code 1
Gem files will remain installed in /tmp/bundler20160808-7120-705k68sqlite3-1.3.11/gems/sqlite3-1.3.11 for inspection.
Results logged to /tmp/bundler20160808-7120-705k68sqlite3-1.3.11/extensions/x86_64-linux/2.3.0/sqlite3-1.3.11/gem_make.out
Using turbolinks-source 5.0.0
Using rdoc 4.2.2
Using tzinfo 1.2.2
Installing nokogiri 1.6.8 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /tmp/bundler20160808-7120-1p1mgmsnokogiri-1.6.8/gems/nokogiri-1.6.8/ext/nokogiri
/usr/bin/ruby2.3 -r ./siteconf20160808-7120-f0fc55.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h
extconf failed, exit code 1
Gem files will remain installed in /tmp/bundler20160808-7120-1p1mgmsnokogiri-1.6.8/gems/nokogiri-1.6.8 for inspection.
Results logged to /tmp/bundler20160808-7120-1p1mgmsnokogiri-1.6.8/extensions/x86_64-linux/2.3.0/nokogiri-1.6.8/gem_make.out
Using rack-test 0.6.3
Using mime-types 3.1
An error occurred while installing debug_inspector (0.0.2), and Bundler cannot
continue.
Make sure that `gem install debug_inspector -v '0.0.2'` succeeds before
bundling.
I tried sudo gem install debug_inspector -v '0.0.2' , and the results were
xjackparsons93#93 ~/ty $ sudo gem install debug_inspector -v '0.0.2'
[sudo] password for xjackparsons93:
Building native extensions. This could take a while...
ERROR: Error installing debug_inspector:
ERROR: Failed to build gem native extension.
current directory: /var/lib/gems/2.3.0/gems/debug_inspector-0.0.2/ext/debug_inspector
/usr/bin/ruby2.3 -r ./siteconf20160808-8013-10my2bw.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h
extconf failed, exit code 1
Gem files will remain installed in /var/lib/gems/2.3.0/gems/debug_inspector-0.0.2 for inspection.
Results logged to /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/debug_inspector-0.0.2/gem_make.out
This problem is not affecting my MacBook Pro only linux boxes
This can help you:
If you have issues, first make sure you have all the tooling necessary to compile C extensions:
sudo apt-get install build-essential patch
It’s possible that you don’t have important development header files installed on your system. (This has never happened to me personally, but I have it on good authority that otherwise good and noble Ruby developers run into this.) Here’s what you should do if you should find yourself in this situation:
sudo apt-get install ruby-dev zlib1g-dev liblzma-dev
Please report it as a bug if this doesn’t work for you (see Getting Help for details).
when making a new ruby on rails app via my terminal, by the command "rails new newapp" I find the following error message in my terminal. It seems linked difficulties with installing bye bug 9.0.5. After a while the terminal says it can not succeed before bundling. I suppose this a major barrier to the correct development of my app. Can anyone help?
I am attaching the relevant terminal statements and highlight in bold what I think where the problem is.
Fetching gem metadata from https://rubygems.org/
Fetching version metadata from https://rubygems.org/
Fetching dependency metadata from https://rubygems.org/
Resolving dependencies......
Using rake 11.2.2
Using i18n 0.7.0
Using json 1.8.3
Using minitest 5.9.0
Using thread_safe 0.3.5
Using builder 3.2.2
Using erubis 2.7.0
Using mini_portile2 2.1.0
Using pkg-config 1.1.7
Using rack 1.6.4
Using mime-types-data 3.2016.0521
Using arel 6.0.3
Using debug_inspector 0.0.2
Using bundler 1.12.5
Installing byebug 9.0.5 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/Users/nicholaswenzel/.rbenv/versions/2.2.3/bin/ruby -r ./siteconf20160710-36604-3ys7vr.rb extconf.rb
creating Makefile
make "DESTDIR=" clean
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
make "DESTDIR="
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
make failed, exit code 1
Gem files will remain installed in /Users/nicholaswenzel/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/byebug-9.0.5 for inspection.
Results logged to /Users/nicholaswenzel/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-15/2.2.0-static/byebug-9.0.5/gem_make.out
Using coffee-script-source 1.10.0
Using execjs 2.7.0
Using thor 0.19.1
Using concurrent-ruby 1.0.2
Using multi_json 1.12.1
Using sass 3.4.22
Using tilt 2.0.5
Using spring 1.7.2
Using sqlite3 1.3.11
Using turbolinks-source 5.0.0
Using rdoc 4.2.2
Using tzinfo 1.2.2
Installing nokogiri 1.6.8 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/Users/nicholaswenzel/.rbenv/versions/2.2.3/bin/ruby -r ./siteconf20160710-36604-1ukclqg.rb extconf.rb
Using pkg-config version 1.1.7
checking if the C compiler accepts ... *** 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/nicholaswenzel/.rbenv/versions/2.2.3/bin/$(RUBY_BASE_NAME)
--help
--clean
/Users/nicholaswenzel/.rbenv/versions/2.2.3/lib/ruby/2.2.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/nicholaswenzel/.rbenv/versions/2.2.3/lib/ruby/2.2.0/mkmf.rb:571:in `block in try_compile'
from /Users/nicholaswenzel/.rbenv/versions/2.2.3/lib/ruby/2.2.0/mkmf.rb:522:in `with_werror'
from /Users/nicholaswenzel/.rbenv/versions/2.2.3/lib/ruby/2.2.0/mkmf.rb:571:in `try_compile'
from extconf.rb:138:in `nokogiri_try_compile'
from extconf.rb:162:in `block in add_cflags'
from /Users/nicholaswenzel/.rbenv/versions/2.2.3/lib/ruby/2.2.0/mkmf.rb:619:in `with_cflags'
from extconf.rb:161:in `add_cflags'
from extconf.rb:414:in `<main>'
extconf failed, exit code 1
Gem files will remain installed in /Users/nicholaswenzel/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/nokogiri-1.6.8 for inspection.
Results logged to /Users/nicholaswenzel/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-15/2.2.0-static/nokogiri-1.6.8/gem_make.out
Using rack-test 0.6.3
Using mime-types 3.1
Using binding_of_caller 0.7.2
An error occurred while installing byebug (9.0.5), and Bundler cannot continue.
Make sure that `gem install byebug -v '9.0.5'` succeeds before bundling.
run bundle exec spring binstub --all
* bin/rake: spring inserted
* bin/rails: spring inserted
Nicholass-MacBook-Pro:installmaster nicholaswenzel$
Try,
xcode-select --install
Hope this helps.
I was working on a super simple rails app, had a couple of errors and before I knew it things got out of control. I was having problems with the pg gem, so I went around trying to find a solution. I believe I may have installed something I shouldn't have. After I run
bundle install
I get this:
LMagnotti$ bundle install
Fetching gem metadata from https://rubygems.org/
Fetching version metadata from https://rubygems.org/
Fetching dependency metadata from https://rubygems.org/
Resolving dependencies...
Using rake 11.1.2
Using i18n 0.7.0
Using json 1.8.3
Using minitest 5.8.4
Using thread_safe 0.3.5
Using builder 3.2.2
Using erubis 2.7.0
Using mini_portile2 2.0.0
Using rack 1.6.4
Using mime-types-data 3.2016.0221
Using arel 6.0.3
Your user account isn't allowed to install to the system Rubygems.
You can cancel this installation and run:
bundle install --path vendor/bundle
to install the gems into ./vendor/bundle/, or you can enter your password
and install the bundled gems to Rubygems using sudo.
Password:
Installing ansi 1.5.0
Using debug_inspector 0.0.2
Using sass 3.4.22
Using bundler 1.12.4
Using byebug 9.0.0
Installing coderay 1.1.1
Using coffee-script-source 1.10.0
Using execjs 2.6.0
Using thor 0.19.1
Using concurrent-ruby 1.0.2
Installing ffi 1.9.10 with native extensions
Installing formatador 0.2.5
Installing rb-fsevent 0.9.7
Installing ruby_dep 1.3.1
Installing lumberjack 1.0.10
Installing nenv 0.3.0
Installing shellany 0.0.1
Installing method_source 0.8.2
Installing slop 3.6.0
Using multi_json 1.12.0
Installing ruby-progressbar 1.8.1
Installing pg 0.18.4 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /private/var/folders/9k/wywr5gq52gsf8vxlbj5pgzb80000gn/T/bundler20160517-99984-1hhq594pg-0.18.4/gems/pg-0.18.4/ext
/usr/local/opt/ruby/bin/ruby -r ./siteconf20160517-99984-1fco5r9.rb extconf.rb --with-pg-config=/usr/pgsql-9.1/bin/pg_config
Using config values from /usr/pgsql-9.1/bin/pg_config
sh: /usr/pgsql-9.1/bin/pg_config: No such file or directory
sh: /usr/pgsql-9.1/bin/pg_config: No such file or directory
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** 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=/usr/local/Cellar/ruby/2.3.0/bin/$(RUBY_BASE_NAME)
--with-pg
--without-pg
--enable-windows-cross
--disable-windows-cross
--with-pg-config
--with-pg-dir
--without-pg-dir
--with-pg-include
--without-pg-include=${pg-dir}/include
--with-pg-lib
--without-pg-lib=${pg-dir}/lib
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/var/folders/9k/wywr5gq52gsf8vxlbj5pgzb80000gn/T/bundler20160517-99984-1hhq594pg-0.18.4/extensions/x86_64-darwin-15/2.3.0/pg-0.18.4/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /var/folders/9k/wywr5gq52gsf8vxlbj5pgzb80000gn/T/bundler20160517-99984-1hhq594pg-0.18.4/gems/pg-0.18.4 for inspection.
Results logged to /var/folders/9k/wywr5gq52gsf8vxlbj5pgzb80000gn/T/bundler20160517-99984-1hhq594pg-0.18.4/extensions/x86_64-darwin-15/2.3.0/pg-0.18.4/gem_make.out
Installing rails_serve_static_assets 0.0.5
Installing rails_stdout_logging 0.0.5
Using tilt 2.0.2
Using spring 1.7.1
Installing sqlite3 1.3.7 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /private/var/folders/9k/wywr5gq52gsf8vxlbj5pgzb80000gn/T/bundler20160517-99984-q4b85ssqlite3-1.3.7/gems/sqlite3-1.3.7/ext/sqlite3
/usr/local/opt/ruby/bin/ruby -r ./siteconf20160517-99984-s84g71.rb extconf.rb
checking for sqlite3.h... yes
checking for sqlite3_libversion_number() in -lsqlite3... yes
checking for rb_proc_arity()... yes
checking for sqlite3_initialize()... yes
checking for sqlite3_backup_init()... yes
checking for sqlite3_column_database_name()... no
checking for sqlite3_enable_load_extension()... no
checking for sqlite3_load_extension()... no
checking for sqlite3_open_v2()... yes
checking for sqlite3_prepare_v2()... yes
checking for sqlite3_int64 in sqlite3.h... yes
checking for sqlite3_uint64 in sqlite3.h... yes
creating Makefile
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/var/folders/9k/wywr5gq52gsf8vxlbj5pgzb80000gn/T/bundler20160517-99984-q4b85ssqlite3-1.3.7/extensions/x86_64-darwin-15/2.3.0/sqlite3-1.3.7/mkmf.log
current directory: /private/var/folders/9k/wywr5gq52gsf8vxlbj5pgzb80000gn/T/bundler20160517-99984-q4b85ssqlite3-1.3.7/gems/sqlite3-1.3.7/ext/sqlite3
make "DESTDIR=" clean
current directory: /private/var/folders/9k/wywr5gq52gsf8vxlbj5pgzb80000gn/T/bundler20160517-99984-q4b85ssqlite3-1.3.7/gems/sqlite3-1.3.7/ext/sqlite3
make "DESTDIR="
compiling backup.c
compiling database.c
compiling exception.c
compiling sqlite3.c
compiling statement.c
statement.c:82:13: warning: unused variable 'db' [-Wunused-variable]
sqlite3 * db;
^
statement.c:260:11: warning: implicit declaration of function 'RBIGNUM' is invalid in C99 [-Wimplicit-function-declaration]
if (RBIGNUM_LEN(value) * SIZEOF_BDIGITS <= 8) {
^
./sqlite3_ruby.h:16:24: note: expanded from macro 'RBIGNUM_LEN'
#define RBIGNUM_LEN(x) RBIGNUM(x)->len
^
statement.c:260:11: error: member reference type 'int' is not a pointer
if (RBIGNUM_LEN(value) * SIZEOF_BDIGITS <= 8) {
^~~~~~~~~~~~~~~~~~
./sqlite3_ruby.h:16:36: note: expanded from macro 'RBIGNUM_LEN'
#define RBIGNUM_LEN(x) RBIGNUM(x)->len
~~~~~~~~~~ ^
statement.c:260:32: error: use of undeclared identifier 'SIZEOF_BDIGITS'
if (RBIGNUM_LEN(value) * SIZEOF_BDIGITS <= 8) {
^
2 warnings and 2 errors generated.
make: *** [statement.o] Error 1
make failed, exit code 2
Gem files will remain installed in /var/folders/9k/wywr5gq52gsf8vxlbj5pgzb80000gn/T/bundler20160517-99984-q4b85ssqlite3-1.3.7/gems/sqlite3-1.3.7 for inspection.
Results logged to /var/folders/9k/wywr5gq52gsf8vxlbj5pgzb80000gn/T/bundler20160517-99984-q4b85ssqlite3-1.3.7/extensions/x86_64-darwin-15/2.3.0/sqlite3-1.3.7/gem_make.out
Using rdoc 4.2.2
Using tzinfo 1.2.2
Using nokogiri 1.6.7.2
Using rack-test 0.6.3
Using mime-types 3.0
Using binding_of_caller 0.7.2
Using bootstrap-sass 3.2.0.2
Using coffee-script 2.4.1
Using uglifier 3.0.0
Using sprockets 3.6.0
Installing rb-inotify 0.9.7
Installing notiffany 0.0.8
Installing pry 0.10.3
Installing minitest-reporters 1.0.5
An error occurred while installing pg (0.18.4), and Bundler cannot continue.
Make sure that `gem install pg -v '0.18.4'` succeeds before bundling.
Any ideas? Thanks!
Most of the times this error
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
happens because you haven't installed all you need to build Postgresql native extension. They are called 'native' because they are compiled in your machine and you need to fulfill all requirements to build them.
If you have installed all the basic developer packages, all you need to do is install the development package for Postgresql.
If you are using a Debian-like Linux (like Ubuntu), do:
sudo apt-get install libpq-dev
If your are with another Linux distribution, try to find the corrrect package. If you are using a Mac, read this.
got an error while trying to install devise gem. Added gem "devise", "~> 3.2.2" to my Gemlist and went into terminal to do the following:
Steven-Lims-MacBook-Pro:Pinteresting stevenlim$ bundle install
Fetching gem metadata from https://rubygems.org/..........
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
Using rake (10.1.1)
Using i18n (0.6.9)
Using minitest (4.7.5)
Using multi_json (1.8.4)
Using atomic (1.1.14)
Using thread_safe (0.1.3)
Using tzinfo (0.3.38)
Using activesupport (4.0.2)
Using builder (3.1.4)
Using erubis (2.7.0)
Using rack (1.5.2)
Using rack-test (0.6.2)
Using actionpack (4.0.2)
Using mime-types (1.25.1)
Using polyglot (0.3.3)
Using treetop (1.4.15)
Using mail (2.5.4)
Using actionmailer (4.0.2)
Using activemodel (4.0.2)
Using activerecord-deprecated_finders (1.0.3)
Using arel (4.0.1)
Using activerecord (4.0.2)
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/usr/local/rvm/rubies/ruby-2.0.0-p353/bin/ruby extconf.rb
checking for ruby/util.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/local/rvm/rubies/ruby-2.0.0-p353/bin/ruby
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/mkmf.rb:434:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/mkmf.rb:565:in `try_cpp'
from /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/mkmf.rb:1044:in `block in have_header'
from /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/mkmf.rb:895:in `block in checking_for'
from /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/mkmf.rb:340:in `block (2 levels) in postpone'
from /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/mkmf.rb:310:in `open'
from /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/mkmf.rb:340:in `block in postpone'
from /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/mkmf.rb:310:in `open'
from /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/mkmf.rb:336:in `postpone'
from /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/mkmf.rb:894:in `checking_for'
from /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/mkmf.rb:1043:in `have_header'
from extconf.rb:14:in `<main>'
extconf failed, exit code 1
Gem files will remain installed in /usr/local/rvm/gems/ruby-2.0.0-p353/gems/bcrypt-ruby-3.1.2 for inspection.
Results logged to /usr/local/rvm/gems/ruby-2.0.0-p353/extensions/x86_64-darwin-10/2.0.0/bcrypt-ruby-3.1.2/gem_make.out
An error occurred while installing bcrypt-ruby (3.1.2), and Bundler cannot
continue.
Make sure that `gem install bcrypt-ruby -v '3.1.2'` succeeds before bundling.
Am new to programming and Ruby on Rails so kindly assist. Thanks!
managed to solve this. I had upgraded to OS Mavericks recently and problem came up.
Have tried gem install bcrypt-ruby -v '3.1.2' in terminal but encountered same problem.
Thereafter, went to install Xcode on App Store as running Xcode-select --install in terminal failed as well (program can't be found).
Thus I chanced upon this thread and followed advice to run sudo ln -s /usr/bin/llvm-gcc /usr/bin/gcc-4.2 in terminal.
Thread: gem install pg doesn't work on OSX Lion
Thereafter I ran gem install bcrypt-ruby -v '3.1.2' and bundle install in terminal and all good for now. Hope this works. Actually I don't know what I am doing but hopefully it works. Can someone enlighten me what I am actually doing?
Ran into this issue after updating OS X Mavericks to 10.9.5 which also updates Xcode (Version 6.0.1 (6A317)).
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/Users/e/.rvm/rubies/ruby-2.1.1/bin/ruby extconf.rb
creating Makefile
Compiling v8 for x64
Using python 2.7.5
Unable to find a compiler officially supported by v8.
It is recommended to use GCC v4.4 or higher
Using compiler: /usr/bin/c++ (c++ version )
extconf failed, exit code 1
Gem files will remain installed in /Users/e/.rvm/gems/ruby-2.1.1/gems/libv8-3.16.14.7 for inspection.
Results logged to /Users/e/.rvm/gems/ruby-2.1.1/extensions/x86_64-darwin-12/2.1.0-static/libv8-3.16.14.7/gem_make.out
An error occurred while installing libv8 (3.16.14.7), and Bundler cannot continue.
Make sure that `gem install libv8 -v '3.16.14.7'` succeeds before bundling.
To resolve: Must accept and finalise install of Xcode in order for bundle update to complete.
After finalising install of Xcode, bundle update completed without issue.