Hello there,
So, here's another sad story about a guy who is falling on hard luck while deploying his first Rails application. I followed the Capistrano instructions in the WebFaction KB, and everything went without a hitch. That is, until I went to my website to verify that everything is up and running. I get a Phusion Passenger Error page, Ruby (Rack) application could not be started.
The exact error message displayed on the page is:
Could not find ansi-1.4.0 in any of the sources (Bundler::GemNotFound)
So, here's where I get confused. I didn't use the ansi gem in my app development, and subsequent attempts to install this gem to appease the Phusion gods do not make the error message go away. Secondarily, as you might expect me to say, the app was humming right along when testing it on the development environment.
The backtrace is also full of good stuff that I don't even comprehend at this point:
0 /home/jeremyfuksa/webapps/tcn_5by5/gems/gems/bundler-1.0.18/lib/bundler/spec_set.rb 88 in `materialize'
1 /home/jeremyfuksa/webapps/tcn_5by5/gems/gems/bundler-1.0.18/lib/bundler/spec_set.rb 82 in `map!'
2 /home/jeremyfuksa/webapps/tcn_5by5/gems/gems/bundler-1.0.18/lib/bundler/spec_set.rb 82 in `materialize'
3 /home/jeremyfuksa/webapps/tcn_5by5/gems/gems/bundler-1.0.18/lib/bundler/definition.rb 90 in `specs'
4 /home/jeremyfuksa/webapps/tcn_5by5/gems/gems/bundler-1.0.18/lib/bundler/definition.rb 135 in `specs_for'
5 /home/jeremyfuksa/webapps/tcn_5by5/gems/gems/bundler-1.0.18/lib/bundler/definition.rb 124 in `requested_specs'
6 /home/jeremyfuksa/webapps/tcn_5by5/gems/gems/bundler-1.0.18/lib/bundler/environment.rb 23 in `requested_specs'
7 /home/jeremyfuksa/webapps/tcn_5by5/gems/gems/bundler-1.0.18/lib/bundler/runtime.rb 11 in `setup'
8 /home/jeremyfuksa/webapps/tcn_5by5/gems/gems/bundler-1.0.18/lib/bundler.rb 107 in `setup'
9 /home/jeremyfuksa/webapps/tcn_5by5/gems/gems/passenger-3.0.9/lib/phusion_passenger/utils.rb 326 in `prepare_app_process'
10 /home/jeremyfuksa/webapps/tcn_5by5/gems/gems/passenger-3.0.9/lib/phusion_passenger/rack/application_spawner.rb 73 in `spawn_application'
11 /home/jeremyfuksa/webapps/tcn_5by5/gems/gems/passenger-3.0.9/lib/phusion_passenger/utils.rb 572 in `report_app_init_status'
12 /home/jeremyfuksa/webapps/tcn_5by5/gems/gems/passenger-3.0.9/lib/phusion_passenger/rack/application_spawner.rb 72 in `spawn_application'
13 /home/jeremyfuksa/webapps/tcn_5by5/gems/gems/passenger-3.0.9/lib/phusion_passenger/utils.rb 479 in `safe_fork'
14 /home/jeremyfuksa/webapps/tcn_5by5/gems/gems/passenger-3.0.9/lib/phusion_passenger/rack/application_spawner.rb 63 in `spawn_application'
15 /home/jeremyfuksa/webapps/tcn_5by5/gems/gems/passenger-3.0.9/lib/phusion_passenger/spawn_manager.rb 264 in `spawn_rack_application'
16 /home/jeremyfuksa/webapps/tcn_5by5/gems/gems/passenger-3.0.9/lib/phusion_passenger/spawn_manager.rb 137 in `spawn_application'
17 /home/jeremyfuksa/webapps/tcn_5by5/gems/gems/passenger-3.0.9/lib/phusion_passenger/spawn_manager.rb 275 in `handle_spawn_application'
18 /home/jeremyfuksa/webapps/tcn_5by5/gems/gems/passenger-3.0.9/lib/phusion_passenger/abstract_server.rb 357 in `__send__'
19 /home/jeremyfuksa/webapps/tcn_5by5/gems/gems/passenger-3.0.9/lib/phusion_passenger/abstract_server.rb 357 in `server_main_loop'
20 /home/jeremyfuksa/webapps/tcn_5by5/gems/gems/passenger-3.0.9/lib/phusion_passenger/abstract_server.rb 206 in `start_synchronously'
21 /home/jeremyfuksa/webapps/tcn_5by5/gems/gems/passenger-3.0.9/helper-scripts/passenger-spawn-server 99
I fully realize that something just isn't set up right. I just need to figure out what I did wrong. Anyone out there with some insight into this problem?
asked
14 Nov '11, 23:21
3rdmartini
1●1●3
accept rate:
0%
The gem maybe a dependency of one of your other gems. Can you tell us if you see the directory for that gem in this directory:
Nope. Not there. In fact, there are a couple of other gems that I know I'll need that aren't there either.
Did you follow the procedure here to install them?
http://docs.webfaction.com/software/rails.html#installing-gems
I did not. But I'm doing it now and the curb gem completely exploded as it was trying to install.
The error: Installing curb (0.7.16) with native extensions /usr/local/ruby1.8.7ee/lib/ruby/site_ruby/1.8/rubygems/installer.rb:529:in `build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
You need to first install curl using:
and then install the gem.
Nope. Sorry. Now it's a slightly different error message:
ERROR: Error installing curb: ERROR: Failed to build gem native extension. /usr/local/ruby1.8.7ee/bin/ruby extconf.rb
Log for the gem make:
I know since i tried it myself, using the above commands should get rid of it.
I installed curl using your commands twice now. the gem install for curb still fails in the manner I've described.
Getting somewhere now. Even though I've installed curl via your instructions, "curl --version" yields:
So, somehow, the new version isn't running.
Can you try after this command:
That fixed it. Now my gems are installed.
However... there's a new error message in town regarding curl:
More path problems?
Yes, you would also need to add:
before starting up your app.
I am sorry for not mentioning it earlier.
We're past the curl problems. It's sqlite3 that's breaking now.
I'm picking this up in the morning.
You can solve that using:
I finally have every gem installed and am getting a totally new error:
Research is showing that this is because I developed the app using ruby 1.9.2 and now this error is being thrown on ruby 1.8.7. I tried installing 1.9.2 via RVM on this server last night, and even though the install was successful, I could not get my nginx instance to use that version.
I can't imagine that everyone else's experience with setting up a Rails app on this service is this complicated and maddening.
It isn't :)
You might need to change the
GEM_HOME
environment variable in~/webapps/tcn_5by5/gems/bin/start
to point to whatever location your Ruby 1.9.2 is using for its gems. Be sure to restart Nginx after making that change.If that doesn't work, then let us know exactly what command or operation is producing the new error.
On the upside, this has been a tremendous learning experience. :)
I was able to get ruby-1.9.2-p290 installed and running with nginx. However, now I'm back to square one with the sqlite3 gem not installing when I run 'bundle install'.
looks like bundle is still using the old ruby even though 'ruby -v' shows the version I want.
My guess is that your
/home/jeremyfuksa/webapps/tcn_5by5/bin
symlink is still pointing to the old gem location, and you're runningbundle
from there. Try runningbundle
from your Ruby 1.9.2 environment'sgem/bin
directory instead.That part is correct. Unfortunately, I got the same installer error, just with the right version of ruby being used.
Please try running the
bundle config
command shown in the accepted answer here: bundle install won't install sqlite3(And when you run it, be sure to use the correct
bundle
command.)Perfect. Got me past that to another Passenger error that I was able to get past. Now the site loads but yields a 500 error. Looking at the logs to figure out what's up with that.
So, the site is up and running finally, but one last bit of housekeeping...
When I logout and then ssh back in, I can do
ruby -v
and get 1.8.7 again. I had put what I thought were the right $PATH statements in my .bash_profile, but I guess I didn't. What can I do to make sure that I'm always using ruby 1.9.2-p290 when I log in?Also, how do I change the symlink of $HOME/webapps/$APPNAME/bin to point to the 1.9.2 /bin? I tried
ln -s
but it didn't seem to work.Regarding your
PATH
, you need to put your custom Ruby version at the beginning of the path, and not at the end, eg:Regarding the symlink, what's the full command that you ran, and what sort of error did you see?
The PATH editing worked. Here's what I got with
ln
:ln -s $HOME/webapps/tcn_5by5/ruby-1.9.2-p290/bin $HOME/webapps/tcn_5by5/bin ln: creating symbolic link '/home/jeremyfuksa/webapps/tcn_5by5/bin/bin' to '/home/jeremyfuksa/webapps/tcn_5by5/ruby-1.9.2-p290/bin': File exists
It was my understanding that I could overwrite the existing link.