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.
Related
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'm trying to deploy a rails app to my ubuntu linux server. I'm using capistrano and bundler and when it gets to installing gems it fails with this error:
Installing json (1.7.7) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/opt/ruby-enterprise-1.8.7-2012.02/bin/ruby extconf.rb
creating Makefile
make
/usr/bin/gcc -I. -I/opt/local/include -I/opt/ruby-enterprise-1.8.7- 2012.02/lib/ruby/1.8/i686-linux -I/opt/ruby-enterprise-1.8.7-2012.02/lib/ruby/1.8/i686-linux -I. -D_FILE_OFFSET_BITS=64 -fPIC -g -O3 -Wall -c parser.c
In file included from /usr/include/i386-linux-gnu/bits/posix1_lim.h:157:0,
from /usr/include/limits.h:145,
from /usr/lib/gcc/i686-linux-gnu/4.6/include-fixed/limits.h:169,
from /usr/lib/gcc/i686-linux-gnu/4.6/include-fixed/syslimits.h:7,
from /usr/lib/gcc/i686-linux-gnu/4.6/include-fixed/limits.h:34,
from /opt/ruby-enterprise-1.8.7-2012.02/lib/ruby/1.8/i686-linux/ruby.h:95,
from ../fbuffer/fbuffer.h:6,
from parser.rl:1:
/usr/include/i386-linux-gnu/bits/local_lim.h:39:26: fatal error: linux/limits.h: No such file or directory
compilation terminated.
make: *** [parser.o] Error 1
I am running ruby enterprise edition 1.8.7 and can't upgrade ruby without a lot of work upgrading other sites so that's not an option right now. I tried apt-get install ruby-dev but it didn't help (I'm not sure that was the right thing anyway).
I think you need to install one of this packages :
$ apt-file search limits.h | grep 'linux/limits.h'
linux-headers-2.6.32-5-common: /usr/src/linux-headers-2.6.32-5-common/include/linux/limits.h
linux-headers-2.6.32-5-common-openvz: /usr/src/linux-headers-2.6.32-5-common-openvz/include/linux/limits.h
linux-headers-2.6.32-5-common-vserver: /usr/src/linux-headers-2.6.32-5-common-vserver/include/linux/limits.h
linux-headers-2.6.32-5-common-xen: /usr/src/linux-headers-2.6.32-5-common-xen/include/linux/limits.h
linux-libc-dev: /usr/include/linux/limits.h
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.
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
I'm receiving an error while trying to install a gem called typhoeus (this is used in following the book "Service Oriented Design with Rails") - I've tried a lot of things to try to get this fixed but I've hit a brick wall and am posting here in the hope someone can help.
Here is the output:
$ gem install typhoeus
Building native extensions. This could take a while...
ERROR: Error installing typhoeus:
ERROR: Failed to build gem native extension.
/Users/my.name/.rvm/rubies/ruby-1.8.7-p302/bin/ruby extconf.rb
checking for curl/curl.h in /opt/local/include,/opt/local/include/curl,/Users/my.name/.rvm/rubies/ruby-1.8.7-p302/include/curl,/Users/my.name/.rvm/rubies/ruby-1.8.7-p302/include,/usr/include/curl,/usr/local/include/curl... yes
checking for curl_easy_init() in -lcurl... yes
creating Makefile
make
gcc -I. -I. -I/Users/my.name/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/i686-darwin10.5.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -g -O2 -fno-common -pipe -fno-common -g -DXP_UNIX -O3 -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline -c native.c
In file included from /usr/local/include/curl/curl.h:35,
from ./native.h:5,
from native.c:1:
/usr/local/include/curl/curlrules.h:143: error: size of array ‘__curl_rule_01__’ is negative
make: *** [native.o] Error 1
I'm using rvm with ruby-1.8.7-p302 on OS X Snow Leopard with the latest XCode Tools.
From searching around I've tried to do various things, such as try installing the gem under the other ruby versions I have (ree-1.8.7-2010.02, ruby-1.9.2-head, and system ruby), to passing in architecture flags (x86_64 or i386) for the ARCHFLAGS argument, etc.
I'm new to ruby so any help would be greatly appreciated, thanks!
Not sure if this is the same on Mac but I was having the same problem with Ubuntu.
sudo apt-get install curl
sudo apt-get install libcurl3 libcurl3-dev
sudo gem install typhoeus
worked for me but only after installing the libcurl libraries
Thanks.
You only actually need libcurl3-dev:
sudo apt-get install libcurl3-dev
sudo gem install typhoeus
Should work just fine.
Not sure, but it seems that your system is not quite as the gem source expects.
Since its using curl and from this old problem, I would guess that your curl needs updating.
Is it the system installed curl, or are you using macports - perhaps its worth doing an update...
Alternatively can you try the install on a recent *nix system - that might work and so confirm its an environment issue.
From the github page, there are some notes on how to use it with an old curl...
Good luck, Chris
its libcurl problem, as typhoeus need the header and stuff to compile. and it is having problem.
libcurl-dev OR libcurl3-dev installed?