I have installed rvm as root. ruby 1.9.2-p0 installed and set as
default.
Installed passenger and adapted the apache config. Deployed the rails
app
with capistrano.
The browser shows a passenger error:
Ruby on Rails application could not be started
Could not find json-1.5.1 in any of the sources (Bundler::GemNotFound)
Backtrace:
Frame 0:
/usr/local/rvm/gems/ruby-1.9.2-p0/gems/bundler-1.0.13/lib/bundler/
spec_set.rb
Frame 9:
/usr/local/rvm/gems/ruby-1.9.2-p0/gems/passenger-3.0.7/lib/
phusion_passenger/utils.rb
when i go to the rails app and run
bundle install
it fails while building json:
Installing json (1.5.1) with native extensions /usr/local/rvm/rubies/
ruby-1.9.2-p0/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:533:in
`rescue in block in build_extensions’: ERROR: Failed to build gem
native extension. (Gem::Installer::ExtensionBuildError)
but $ gem install json
installs 1.5.1 without a probelm
I do all this as root. It seems to me that there is a mix up of
environments but do not know how to fix it. The error messge mentions /
usr/local/rvm/rubies/ruby-1.9.2-p0/lib/ruby/site_ruby/1.9.1/rubygems/
installer.rb Why 191 and not 1.9.2 ?
xp:/var/www/html/registration/current# gem env
/usr/local/rvm/rubies/ruby-1.9.2-p0/bin/gem:4: warning: Insecure world
writable dir /var/www/html in PATH, mode 040777
RubyGems Environment:
Could not find json-1.5.1 in any of the sources (Bundler::GemNotFound)
it fails while building json:
Installing json (1.5.1) with native extensions /usr/local/rvm/rubies/
ruby-1.9.2-p0/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:533:in
`rescue in block in build_extensions’: ERROR: Failed to build gem
native extension. (Gem::Installer::ExtensionBuildError)
but $ gem install json
installs 1.5.1 without a probelm
After you do this and you then run ‘bundle install’ do you still get the
error?
Also, are you using a gemset with rvm? And just to be sure have you
confirmed your rvm settings with ‘rvm current’?
I do all this as root. It seems to me that there is a mix up of
environments but do not know how to fix it. The error messge mentions /
usr/local/rvm/rubies/ruby-1.9.2-p0/lib/ruby/site_ruby/1.9.1/rubygems/
installer.rb Why 191 and not 1.9.2 ?
I wondered about this in the past and dont know the answer but this as
it
should be.
Running
gem install json (which is sucessful)
and then
bundle install
the same error occurs
I am not sure if this will work (also to answer your question, to
diagnose
‘failed to compile native extensions’, usually just google and tends to
have
either to do with the OS or access rights)… I am guessing your
problem is
related to either the location that the gem is getting installed or due
to
the OS (i.e. such as 32 vs 64 bit)… that said, try this at the command
prompt and then try bundle install again:
Thank you David
rvmsudo gem install json --> ok
bundle install --> same error remains
rvmsudo bundle install --> same error remains
I wonder if there is a OS package missing. However if I run this not
as root but in my own
user login then it works which suggests the OS has all packages
required.
It would be really helpfull if bundle install wrote to a log or stdout
what is missing. I do not
understand how the output of bundle install can be used to diagnose
what went wrong.
bundle help
shows there is a command viz to show dependencies.
xp:/var/www/html/registration/current# bundle viz
#<LoadError: no such file to load – graphviz>
Make sure you have the graphviz ruby gem. You can install it with: gem install ruby-graphviz
After gem install ruby-graphviz it still gives the same LoadError
I think I make a wrong assumptions about execution environments and do
not know enough.
capistrano 2.5.21
Ruby on Rails application could not be started
bundle install
error?
Yes still same.
Also, are you using a gemset with rvm? And just to be sure have you
confirmed your rvm settings with ‘rvm current’?
Using defaults (as out of the box)
rvm current
ruby-1.9.2-p0
I’m having this same problem, Mac OS X 10.6.7, running ruby-1.8.7-p334
(using RVM)
When I run bundle install, all these bundles work fine until it gets to
json , then it crashes. I tried different json versions 1.4.6 and 1.51
– all execute “with native extensions” and it looks like that’s what
makes it crash
make
Makefile:128: warning: overriding commands for target /Users/jason/Projects/' Makefile:122: warning: ignoring old commands for target/Users/jason/Projects/’
gcc -I.
-I/Users/jason/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/i686-darwin10.7.0
-I/Users/jason/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/i686-darwin10.7.0
-I. -DHAVE_RE_H -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -g -O3
-fno-common -pipe -fno-common -Wall -c generator.c
generator.c:322: warning: ‘fbuffer_free_only_buffer’ defined but not
used
cc -dynamic -bundle -undefined suppress -flat_namespace -o
generator.bundle generator.o -L.
-L/Users/jason/.rvm/rubies/ruby-1.8.7-p334/lib -L. -lruby -ldl
-lobjc
make install
Makefile:128: warning: overriding commands for target /Users/jason/Projects/' Makefile:122: warning: ignoring old commands for target/Users/jason/Projects/’
mkdir -p /Users/jason/Projects/
mkdir -p (fb)/2/json/ruby/1.8/gems/json-1.4.6/ext/json/ext/json/ext
/bin/sh: -c: line 0: syntax error near unexpected token (' /bin/sh: -c: line 0:mkdir -p
(fb)/2/json/ruby/1.8/gems/json-1.4.6/ext/json/ext/json/ext’
make: *** [(fb)/2/json/ruby/1.8/gems/json-1.4.6/ext/json/ext/json/ext]
Error 2
Gem files will remain installed in /Users/jason/Projects/
(fb)/2/json/ruby/1.8/gems/json-1.4.6 for inspection.
Results logged to /Users/jason/Projects/
(fb)/2/json/ruby/1.8/gems/json-1.4.6/ext/json/ext/generator/gem_make.out
from
/Users/jason/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems/installer.rb:486:in each' from /Users/jason/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems/installer.rb:486:inbuild_extensions’
from
/Users/jason/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems/installer.rb:159:in install' from /Users/jason/.rvm/gems/ruby-1.8.7-p334@global/gems/bundler-1.0.14/lib/bundler/source.rb:101:ininstall’
from
/Users/jason/.rvm/gems/ruby-1.8.7-p334@global/gems/bundler-1.0.14/lib/bundler/rubygems_integration.rb:78:in preserve_paths' from /Users/jason/.rvm/gems/ruby-1.8.7-p334@global/gems/bundler-1.0.14/lib/bundler/source.rb:91:ininstall’
from
/Users/jason/.rvm/gems/ruby-1.8.7-p334@global/gems/bundler-1.0.14/lib/bundler/installer.rb:58:in run' from /Users/jason/.rvm/gems/ruby-1.8.7-p334@global/gems/bundler-1.0.14/lib/bundler/rubygems_integration.rb:93:inwith_build_args’
from
/Users/jason/.rvm/gems/ruby-1.8.7-p334@global/gems/bundler-1.0.14/lib/bundler/installer.rb:57:in run' from /Users/jason/.rvm/gems/ruby-1.8.7-p334@global/gems/bundler-1.0.14/lib/bundler/spec_set.rb:12:ineach’
from
/Users/jason/.rvm/gems/ruby-1.8.7-p334@global/gems/bundler-1.0.14/lib/bundler/spec_set.rb:12:in each' from /Users/jason/.rvm/gems/ruby-1.8.7-p334@global/gems/bundler-1.0.14/lib/bundler/installer.rb:49:inrun’
from
/Users/jason/.rvm/gems/ruby-1.8.7-p334@global/gems/bundler-1.0.14/lib/bundler/installer.rb:8:in install' from /Users/jason/.rvm/gems/ruby-1.8.7-p334@global/gems/bundler-1.0.14/lib/bundler/cli.rb:222:ininstall’
from
/Users/jason/.rvm/gems/ruby-1.8.7-p334@global/gems/bundler-1.0.14/lib/bundler/vendor/thor/task.rb:22:in send' from /Users/jason/.rvm/gems/ruby-1.8.7-p334@global/gems/bundler-1.0.14/lib/bundler/vendor/thor/task.rb:22:inrun’
from
/Users/jason/.rvm/gems/ruby-1.8.7-p334@global/gems/bundler-1.0.14/lib/bundler/vendor/thor/invocation.rb:118:in invoke_task' from /Users/jason/.rvm/gems/ruby-1.8.7-p334@global/gems/bundler-1.0.14/lib/bundler/vendor/thor.rb:246:indispatch’
from
/Users/jason/.rvm/gems/ruby-1.8.7-p334@global/gems/bundler-1.0.14/lib/bundler/vendor/thor/base.rb:389:in start' from /Users/jason/.rvm/gems/ruby-1.8.7-p334@global/gems/bundler-1.0.14/bin/bundle:13 from /Users/jason/.rvm/gems/ruby-1.8.7-p334@global/bin/bundle:19:inload’
from /Users/jason/.rvm/gems/ruby-1.8.7-p334@global/bin/bundle:19