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 ?
> 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.
> Then I pont the browser tohttps://localhost.localdomain/reg
> 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
After you do this and you then run 'bundle install' do you still get the
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 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.