Folks,
I tried hard to install ruby-prof on windows xp and windows 7 through bundler, but not lucky at all,
in the main site of ruby-prof, it says we need to install version '0.7.3' for windows, I tried
gem install ruby-prof -v '0.7.3'
but failed, then I tried
gem install ruby-prof -v '0.7.3' --platform=mswin32
it succeeded, but when I run bundle update again, errors still there.
Gemfile is like this gem "ruby-prof", '0.7.3', errors are as below:
Installing ruby-prof (0.7.3) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension
.
C:/Ruby192/bin/ruby.exe extconf.rb
checking for sys/times.h... no
checking for rb_os_allocated_objects()... no
checking for rb_gc_allocated_size()... no
checking for rb_gc_collections()... no
checking for rb_gc_time()... no
checking for rb_heap_total_mem()... no
checking for rb_gc_heap_info()... no
checking for rb_gc_malloc_allocations()... no
checking for rb_gc_malloc_allocated_size()... no
creating Makefile
make
C:/Ruby192/bin/ruby -e "puts 'EXPORTS', 'Init_ruby_prof'" > ruby_prof-i386-ming
w32.def
gcc -I. -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -I/C/Ruby192/include/ruby-1
.9.1/ruby/backward -I/C/Ruby192/include/ruby-1.9.1 -I. -O3 -g -Wextra -Wno-unu
sed-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-fiel
d-initializers -Wno-long-long -o ruby_prof.o -c ruby_prof.c
ruby_prof.c:241:1: warning: initialization from incompatible pointer type
ruby_prof.c:867:35: error: expected declaration specifiers or '...' before 'NODE
'
ruby_prof.c: In function 'prof_event_hook':
ruby_prof.c:1114:36: error: 'node' undeclared (first use in this function)
ruby_prof.c:1114:36: note: each undeclared identifier is reported only once for
each function it appears in
ruby_prof.c:1114:9: error: too many arguments to function 'get_method'
ruby_prof.c:867:1: note: declared here
ruby_prof.c:1120:11: warning: passing argument 5 of 'get_method' makes pointer f
rom integer without a cast
ruby_prof.c:867:1: note: expected 'struct st_table *' but argument is of type 'i
nt'
ruby_prof.c:1120:11: error: too many arguments to function 'get_method'
ruby_prof.c:867:1: note: declared here
make: *** [ruby_prof.o] Error 1
Gem files will remain installed in C:/Ruby192/lib/ruby/gems/1.9.1/gems/ruby-prof
-0.7.3 for inspection.
Results logged to C:/Ruby192/lib/ruby/gems/1.9.1/gems/ruby-prof-0.7.3/ext/gem_ma
ke.out
An error occured while installing ruby-prof (0.7.3), and Bundler cannot continue
.
Make sure that `gem install ruby-prof -v '0.7.3'` succeeds before bundling.
What should I do?? Help!
Many thanks here!
Related
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'm trying to get rails working and can't get past a binding_of_caller gem that tries to install with the other gems after running sudo gem install rails. I don't think the gem is required for rails to work, but can't figure out how to skip it, or stop it from trying to install.
Every time the list of gems gets to binding_of_callers I get the following:
Installing binding_of_callers (0.6.9) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
creating Makefile
make
xcrun cc -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin12.0 -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin12.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common -O0 -std=c99 -c binding_of_caller.c
binding_of_caller.c:4:10: fatal error: 'vm_core.h' file not found
#include "vm_core.h"
^
1 error generated.
make: *** [binding_of_caller.o] Error 1
Gem files will remain installed in /Users/ericavirtue/.bundler/tmp/54559/gems/binding_of_caller-0.6.9 for inspection.
Results logged to /Users/ericavirtue/.bundler/tmp/54559/gems/binding_of_caller-0.6.9/ext/binding_of_caller/gem_make.out
An error occurred while installing binding_of_caller (0.6.9), and Bundler cannot continue.
Make sure that `gem install binding_of_caller -v '0.6.9'` succeeds before bundling.
I'm running OSX 10.8.2 and using pow web server with rbenv to manage ruby. I'm also running ruby 1.9.3-p385
Try updating the gem:
$ bundle update binding_of_caller
Before installing Rails, add the gem with the following (also note that the gem name is singular):
$ gem install binding_of_caller
Then run:
$ bundle update rails
Or:
$ gem install rails
(Or whatever rbenv offers)
Ok, so the problem was that the RBENV ruby version wasn't being recognized as the version of ruby being used by the project. So after trying to get rbenv working for a while, I switched back to RVM went through some debugging, and installed some dependencies, I got ruby 2.0.0p0 installed, and recognized as the project ruby. Then I was able to bundle. So to answer my question ... It was a ruby version issue.
Has there been any progress in solving this problem using rbenv?
I'm using rbenv to load jruby 2.0 locally and I would like to continue using this solution rather than rvm.
Ascended:Ascended foundation3 $ rbenv local
jruby-1.7.4
Ascended:Ascended foundation3 $ jruby --version
jruby 1.7.4 (2.0.0) 2013-05-16 2390d3b on Java HotSpot(TM) 64-Bit Server VM 1.6.0_51-b11-457-11M4509 [darwin-x86_64]
Ascended:Ascended foundation3 $ gcc --version
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
My ~/.jrubyconf is set to
compat.version=2.0
cext.enabled=true
errno.backtrace=true
when I try to install binding of caller I get the following -
Ascended:Ascended foundation3 $ gem install binding_of_caller -v '0.7.2'
Building native extensions. This could take a while...
ERROR: Error installing binding_of_caller:
ERROR: Failed to build gem native extension.
/Users/Ascended/.rbenv/versions/jruby-1.7.4/bin/jruby extconf.rb
/Users/Ascended/.rbenv/versions/jruby-1.7.4/lib/ruby/shared/mkmf.rb:1:in `(root)': Use RbConfig instead of obsolete and depreca
ted Config.
/Users/Ascended/.rbenv/versions/jruby-1.7.4/lib/ruby/shared/mkmf.rb:1791:in `init_mkmf': Use RbConfig instead of obsolete and deprecated Config.
/Users/Ascended/.rbenv/versions/jruby-1.7.4/lib/ruby/shared/mkmf.rb:1791:in `init_mkmf': Use RbConfig instead of obsolete and $eprecated Config.
creating Makefile
make
cc -I. -I/Users/Ascended/.rbenv/versions/jruby-1.7.4/lib/native/include -I/Users/Ascended/.rbenv/versions/jruby-1.7.4/lib/nati$e/include/ruby -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fPIC -DTARGET_RT_MAC_CFM=0 -fno-omit-frame-pointer -fno-strict-al$asing -fexceptions -O0 -std=c99 -arch x86_64 -c binding_of_caller.c
binding_of_caller.c:4:10: fatal error: 'vm_core.h' file not found
#include "vm_core.h"
^
1 error generated.
make: *** [binding_of_caller.o] Error 1
Gem files will remain installed in /Users/Ascended/.rbenv/versions/jruby-1.7.4/lib/ruby/gems/shared/gems/binding_of_caller-0.7$2 for inspection.
Results logged to /Users/Ascended/.rbenv/versions/jruby-1.7.4/lib/ruby/gems/shared/gems/binding_of_caller-0.7.2/ext/binding_of$caller/gem_make.out
Now according to the answer that is marked correct in this thread, this is an issue with rbenv, but jruby 1.7.4 is the right version that is sourced and it is operating at 2.0. Shouldn't this work? What am I not understanding?
Looks like youre using Linux. Try following the rails installation by installing ruby and rvm first. It might be cause of an outdated ruby version. throw in the dark though.
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.
I get the following error when installing ribusb gem
[root#localhost ~]# gem install ribusb
Building native extensions. This could take a while...
ERROR: Error installing ribusb:
ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb
creating Makefile
make
gcc -I. -I/usr/local/lib/ruby/1.8/i686-linux -I/usr/local/lib/ruby/1.8/i686-linux -I. -D_FILE_OFFSET_BITS=64 -fPIC -g -O2 -Wall -c ribusb.c
ribusb.c:26:20: fatal error: libusb.h: No such file or directory
compilation terminated.
make: *** [ribusb.o] Error 1
Gem files will remain installed in /usr/local/lib/ruby/gems/1.8/gems/ribusb-0.0.1 for inspection.
Results logged to /usr/local/lib/ruby/gems/1.8/gems/ribusb-0.0.1/./gem_make.out
If you are on a debian like system try:
apt-get install libusb-dev
If you have an other OS check the libusb homepage
I'm struggling to install the RedCloth gem. When I type
gem install RedCloth
I get :
[…]
ragel/redcloth_attributes.c.rl: In function ‘redcloth_attribute_parser’:
ragel/redcloth_attributes.c.rl:26:11: error: variable ‘act’ set but not used [-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors
make: *** [redcloth_attributes.o] Error 1
[…]
The reason is the -Werror compilation option passed to gcc in the extconf.rb of the RedCloth gem:
require 'mkmf'
CONFIG['warnflags'].gsub!(/-Wshorten-64-to-32/, '') if CONFIG['warnflags']
$CFLAGS << ' -O0 -Wall -Werror' if CONFIG['CC'] =~ /gcc/
[…]
The problem is that when I remove the -Werror option from the file, it reappears automatically next time I launch the "gem install" command.
How can I permanently unset the -Werror option?
Another option would be to downgrade to gcc 4.5.2, but it's not in the repositories of my Fedora 15.
And I'd rather avoid to compile it from source…
Any help much appreciated.
Had the same problem and here is the solution:
$ sudo gem install RedCloth -- --with-cflags=\"-O2 -pipe -march=native -Wno-unused-but-set-variable\"
You have to escape the quotes if you have more than one argument.
If you're using bundler, the following works:
bundle config build.RedCloth --with-cflags=\"-O2 -pipe -march=native -Wno-unused-but-set-variable\"