Using VirtualBox inside of Windows7, it has Ubuntu. Just installed rails 3.1 and getting the following error when I try to bundle install with therubyracer gem.
Installing therubyracer (0.9.8) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/home/john/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb
creating Makefile
make
g++ -I. -I/home/john/.rvm/gems/ruby-1.9.2-p290#rails311/gems/libv8-3.3.10.2-x86-linux/lib/libv8/v8/include -I/home/john/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/i686-linux -I/home/john/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/ruby/backward -I/home/john/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1 -I. -D_FILE_OFFSET_BITS=64 -Wall -g -rdynamic -fPIC -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long -fPIC -o v8_date.o -c v8_date.cpp
make: g++: Command not found
make: *** [v8_date.o] Error 127
Gem files will remain installed in /home/john/.rvm/gems/ruby-1.9.2-p290#rails311/gems/therubyracer-0.9.8 for inspection.
Results logged to /home/john/.rvm/gems/ruby-1.9.2-p290#rails311/gems/therubyracer-0.9.8/ext/v8/gem_make.out
An error occured while installing therubyracer (0.9.8), and Bundler cannot continue.
Make sure that `gem install therubyracer -v '0.9.8'` succeeds before bundling.
sudo apt-get install g++
Just to be sure, I also recommend:
sudo apt-get install build-essential
Related
I'm trying to deploy Fedena 2.3 (projectfedena.org) on Ubuntu 16.04, and its built with Ruby 1.8.7 on Rails 2.3.5. I've been able to install it and run with script/server, but now I'm trying to deploy it using Puma+Nginx and as soon as I run gem install puma 3.6.2 (any version above it requires Ruby > 1.8.7), it gives me this error. Does anyone know how i can fix it?
user#server:~/development$ gem install puma -v 3.6.2
Building native extensions. This could take a while...
ERROR: Error installing puma:
ERROR: Failed to build gem native extension.
/home/user/.rvm/rubies/ruby-1.8.7-head/bin/ruby extconf.rb
checking for BIO_read() in -lcrypto... yes
checking for SSL_CTX_new() in -lssl... yes
checking for openssl/bio.h... yes
creating Makefile
make
gcc -I. -I. -I/home/user/.rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/x86_64-linux -I. -DHAVE_OPENSSL_BIO_H -fPIC -O2 -fno-tree-dce -fno-optimize-sibling-calls -fPIC -c http11_parser.c
gcc -I. -I. -I/home/user/.rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/x86_64-linux -I. -DHAVE_OPENSSL_BIO_H -fPIC -O2 -fno-tree-dce -fno-optimize-sibling-calls -fPIC -c puma_http11.c
gcc -I. -I. -I/home/user/.rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/x86_64-linux -I. -DHAVE_OPENSSL_BIO_H -fPIC -O2 -fno-tree-dce -fno-optimize-sibling-calls -fPIC -c mini_ssl.c
mini_ssl.c:4:26: fatal error: ruby/version.h: No such file or directory
#include <ruby/version.h>
^
compilation terminated.
make: *** [mini_ssl.o] Error 1
Gem files will remain installed in /home/user/.rvm/gems/ruby-1.8.7-head/gems/puma-3.6.2 for inspection.
Results logged to /home/user/.rvm/gems/ruby-1.8.7-head/gems/puma-3.6.2/ext/puma_http11/gem_make.out
The last puma version to officially support Ruby 1.8.7 is 2.16.0
https://github.com/puma/puma/blob/master/History.md#2160--2016-01-27
https://github.com/puma/puma/blob/master/History.md#300--2016-02-25
states
Ruby pre-2.0 is no longer supported
Running
gem install puma -v 3.4.0
works for my ruby 1.8.7. Try installing this puma version instead
I am working on starting a new project and I am getting an error I can't resolve after following the error's suggestions. Anybody out there know of any reason why Ruby 2.1.2 should not play well with Rails 4.2.6 when installing postgresql database?
I am getting this type of error:
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/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
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.
I checked the logs and it might as well have been in hieroglyphics:
"gcc -E -I/Users/danale/.rvm/rubies/ruby-2.3.3/include/ruby-2.3.0/x86_64-darwin16 -I/Users/danale/.rvm/rubies/ruby-2.3.3/include/ruby-2.3.0/ruby/backward -I/Users/danale/.rvm/rubies/ruby-2.3.3/include/ruby-2.3.0 -I. -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl/include -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens -fno-common -pipe conftest.c -o conftest.i"
conftest.c:3:10: fatal error: 'libpq-fe.h' file not found
#include <libpq-fe.h>
^
1 error generated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <libpq-fe.h>
/* end */
I since changed to Ruby version 2.1.2, hoping it was a compatibility issue, but it did not resolve the error. When I try to follow the suggestions of error:
Gem files will remain installed in /Users/danale/.rvm/gems/ruby-2.1.2/gems/pg-0.19.0 for inspection.
Results logged to /Users/danale/.rvm/gems/ruby-2.1.2/extensions/x86_64-darwin-16/2.1.0/pg-0.19.0/gem_make.out
danales-MacBook-Pro:Projects danale$ bundle exec spring binstub --all
Could not locate Gemfile or .bundle/ directory
danales-MacBook-Pro:Projects danale$ bundle install
Could not locate Gemfile
I get what you see above.
Daniel nailed this in the comments and I don't need credit for it, but if you're a Mac user you need to use:
brew install postgresql
This error means you don't have the headers to compile the native extensions in your machine. You may install them by doing:
brew install postgresql
ot then
gem install pg -- --with-pg-config='PG_CONFIG_PATH'
and then try to run bundle install again.
You may read more about this here.
Try this:
Go to System Settings => Open Software & Updates, you need to have both trusty-security & trusty-updates are enabled under the Updates tab, then reload your sources & see if you get the current versions.
After that open your terminal and run sudo apt-get update.
I am getting the follow error while installing ruby 2.2.2 on Mac using rvm
installing bundle gems: /Users/gaurish/.rvm/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0 (build_info, cache, doc, extensions, gems, specifications)
minitest-5.4.3.gem
power_assert-0.2.2.gem
test-unit-3.0.8.gem
./tool/rbinstall.rb:728:in `block in <main>': stack level too deep (SystemStackError)
from ./tool/rbinstall.rb:757:in `call'
from ./tool/rbinstall.rb:757:in `block in <main>'
from ./tool/rbinstall.rb:754:in `each'
from ./tool/rbinstall.rb:754:in `<main>'
make: *** [do-install-nodoc] Error 1
+__rvm_make:0> return 2
It seems some gem is blowing up the stack. I don't know what gem is and why its doing so.
Here is the full log:
+__rvm_make:0> make install
config.status: creating x86_64-darwin14-fake.rb
CC = gcc
LD = ld
LDSHARED = gcc -dynamiclib
CFLAGS = -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens -fno-common -pipe
XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector -fno-strict-overflow -fvisibility=hidden -DRUBY_EXPORT
CPPFLAGS = -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -I. -I.ext/include/x86_64-darwin14 -I./include -I.
DLDFLAGS = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -install_name /Users/gaurish/.rvm/rubies/ruby-2.2.2/lib/libruby.2.2.0.dylib -current_version 2.2.0 -compatibility_version 2.2.0 -fstack-protector -Wl,-u,_objc_msgSend -framework CoreFoundation -fstack-protector -Wl,-u,_objc_msgSend -framework CoreFoundation
SOLIBS = -lpthread -ldl -lobjc
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn)
Target: x86_64-apple-darwin14.3.0
Thread model: posix
making enc
make[1]: Nothing to be done for `enc'.
making srcs under enc
make[1]: Nothing to be done for `srcs'.
generating transdb.h
transdb.h unchanged
making trans
make[1]: Nothing to be done for `./enc/trans'.
making encs
generating makefile exts.mk
Failed to configure -test-/win32/console. It will not be installed.
Failed to configure -test-/win32/dln. It will not be installed.
Failed to configure -test-/win32/dln/empty. It will not be installed.
Failed to configure -test-/win32/fd_setsize. It will not be installed.
configuring socket
Failed to configure win32. It will not be installed.
Failed to configure win32ole. It will not be installed.
make[2]: Nothing to be done for `all'.
make[2]: Nothing to be done for `all'.
make[2]: Nothing to be done for `all'.
make[2]: Nothing to be done for `all'.
installing default bigdecimal libraries
installing default date_core libraries
installing digest libraries
installing default digest libraries
installing default sha2 libraries
installing default fiddle libraries
installing default console libraries
installing default libraries
installing default nkf libraries
installing default openssl libraries
installing default pathname libraries
installing default psych libraries
installing default pty libraries
linking shared-object ripper.bundle
installing default ripper libraries
checking ../.././parse.y and ../.././ext/ripper/eventids2.c
linking shared-object socket.bundle
installing default socket libraries
installing default syslog libraries
installing tcltklib libraries
installing default tcltklib libraries
make[2]: Nothing to be done for `all'.
make[2]: Nothing to be done for `all'.
make[2]: `ruby' is up to date.
./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext -- --disable-gems -r./x86_64-darwin14-fake ./tool/rbinstall.rb --make="/Applications/Xcode.app/Contents/Developer/usr/bin/make" --dest-dir="" --extout=".ext" --mflags="" --make-flags="" --data-mode=0644 --prog-mode=0755 --installed-list .installed.list --mantype="doc"
installing binary commands: /Users/gaurish/.rvm/rubies/ruby-2.2.2/bin
installing base libraries: /Users/gaurish/.rvm/rubies/ruby-2.2.2/lib
installing arch files: /Users/gaurish/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/x86_64-darwin14
installing pkgconfig data: /Users/gaurish/.rvm/rubies/ruby-2.2.2/lib/pkgconfig
installing command scripts: /Users/gaurish/.rvm/rubies/ruby-2.2.2/bin
installing library scripts: /Users/gaurish/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0
installing common headers: /Users/gaurish/.rvm/rubies/ruby-2.2.2/include/ruby-2.2.0
installing manpages: /Users/gaurish/.rvm/rubies/ruby-2.2.2/share/man/man1
installing extension objects: /Users/gaurish/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/x86_64-darwin14
installing extension objects: /Users/gaurish/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/x86_64-darwin14
installing extension objects: /Users/gaurish/.rvm/rubies/ruby-2.2.2/lib/ruby/vendor_ruby/2.2.0/x86_64-darwin14
installing extension headers: /Users/gaurish/.rvm/rubies/ruby-2.2.2/include/ruby-2.2.0/x86_64-darwin14
installing extension scripts: /Users/gaurish/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0
installing extension scripts: /Users/gaurish/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0
installing extension scripts: /Users/gaurish/.rvm/rubies/ruby-2.2.2/lib/ruby/vendor_ruby/2.2.0
installing extension headers: /Users/gaurish/.rvm/rubies/ruby-2.2.2/include/ruby-2.2.0/ruby
installing default gems: /Users/gaurish/.rvm/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0 (build_info, cache, doc, extensions, gems, specifications)
bigdecimal 1.2.6
io-console 0.4.3
json 1.8.1
psych 2.0.8
rake 10.4.2
rdoc 4.2.0
installing bundle gems: /Users/gaurish/.rvm/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0 (build_info, cache, doc, extensions, gems, specifications)
minitest-5.4.3.gem
power_assert-0.2.2.gem
test-unit-3.0.8.gem
./tool/rbinstall.rb:728:in `block in <main>': stack level too deep (SystemStackError)
from ./tool/rbinstall.rb:757:in `call'
from ./tool/rbinstall.rb:757:in `block in <main>'
from ./tool/rbinstall.rb:754:in `each'
from ./tool/rbinstall.rb:754:in `<main>'
make: *** [do-install-nodoc] Error 1
+__rvm_make:0> return 2
Any help on how do debug this error?
Try this:
rvm get head
rvm reinstall ruby-2.2.2
It worked to me.
I keep getting these errors:
Error running 'make ', please read /Users/jason*/.rvm/log/ruby-1.9.2-p320/make.log
There has been an error while running make. Halting the installation.
ls: /Users/jason*/.rvm/rubies/*/bin/ruby: No such file or directory
I've tried installing readline and making sure I have the latest GCC version.
This is the error log.
/usr/bin/gcc-4.2 -dynamic -bundle -o ../../../.ext/x86_64-darwin11.3.0/racc/cparse.bundle cparse.o -L. -L../../.. -L/Users/jasonvdm/.rvm/usr/lib -L. -L/usr/local/lib -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -Wl,-flat_namespace -lruby.1.9.1 -lpthread -ldl -lobjc
compiling readline
/usr/bin/gcc-4.2 -I. -I../../.ext/include/x86_64-darwin11.3.0 -I../.././include -I../.././ext/readline -DRUBY_EXTCONF_H=\"extconf.h\" -I/Users/jasonvdm/.rvm/usr/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wshorten-64-to-32 -Wno-long-long -fno-common -pipe -o readline.o -c readline.c
readline.c: In function ‘username_completion_proc_call’:
readline.c:1386: error: ‘username_completion_function’ undeclared (first use in this function)
readline.c:1386: error: (Each undeclared identifier is reported only once
readline.c:1386: error: for each function it appears in.)
make[1]: *** [readline.o] Error 1
make: *** [mkmain.sh] Error 1
Are you compiling Readline from source? It might be less painful to compile and install Readline via Homebrew, assuming that you have at least one working version of Ruby on your system.
Once you've done that, you can try the RVM install of Ruby 1.9.2 again, and it should skip the Readline compilation step.
Updated in response to comment:
So you are using a Homebrew installed Readline. In that case, find out where the new (less broken) Readline libs are installed, and try passing the location of that version of Readline to the RVM install process. Something like:
rvm install ruby-1.9.2-p320 -C
--with-readline-dir=/usr/local/Cellar/readline/6.2.1
Clearly, your directory will be slightly different the one in my example.
If you're using RVM, read the procedures in this question and answers.
You'd better install the readline library with rvm pkg command.
And, yes, another question of a similar type but non of the postings have helped my situation. Been trying to solve this one for two days.
When I type 'rails new app' or run 'bundle install' in an existing app, I get:
Errno::EPERM: Operation not permitted - /Users/pb/.rvm/gems/ruby-1.9.2-p290/gems/json- 1.6.5/.gitignore
An error occured while installing json (1.6.5), and Bundler cannot continue.
Make sure that `gem install json -v '1.6.5'` succeeds before bundling.
When I type any rails command in an existing project, I get:
Could not find json-1.6.5 in any of the sources
Run `bundle install` to install missing gems.
When I type sudo gem install json -v '1.6.5' I get:
Building native extensions. This could take a while...
ERROR: Error installing json:
ERROR: Failed to build gem native extension.
/Users/pb/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb creating Makefile
make
/usr/bin/gcc-4.2 -I. -I/Users/pb/.rvm/rubies/ruby-1.9.2-p290/include/ruby
-1.9.1/x86_64-darwin10.8.0 -I/Users/pb/.rvm/rubies/ruby
-1.9.2-p290/include/ruby-1.9.1/ruby/backward -I/Users/pb/.rvm/rubies/ruby-1.9.2 p290/include/ruby-1.9.1 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SO
URCE -fno-common -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wshorten-64-to-32 -Wno-long-long -fno-common -pipe -O3 -Wall -o parser.o -c parser.c
make: /usr/bin/gcc-4.2: No such file or directory
make: *** [parser.o] Error 1
I've tried all the following:
Uninstall gem json (this tells me json is not installed)
sudo gem update rails
I've also installed the latest xCode - 4.2.1.
Any advice as to solve my problem would be greatly appreciated!
Soooo, I just had the same problem with a much later version... turned out it was because I was in BYOBU. Exiting byobu and just working from the raw terminal fixed it... don't ask me how.
One possible reason for this happen is that you are using rails 3.2 and the application is rails 3.1.
execute bundle install and try to run it again.