Topic: Passenger in production mode can't access gem from git

Hi, it works on Linux Mint with passenger in development mode. Can't make it work in production mode on CentOS 6 x64

Here is a Gemfile:

gem 'spree_recently_viewed', :git => 'git://github.com/spree/spree_recently_viewed.git'

Here is A part of Gemfile.lock:

GIT
  remote: git://github.com/spree/spree_recently_viewed.git
  revision: 94da8eae4286fd5eac4319e21dffb0980a2e6d0a
  specs:
    spree_recently_viewed (1.1)
      spree_core (>= 1.0.0)

GEM
  remote: https://rubygems.org/
  specs:

Here is bundle install output:

[root@vps15 htdocs]# sudo /opt/spree-1.3.1-0/ruby/bin/bundle install

Using rake (0.9.2.2) 
Using i18n (0.6.1) 
Using multi_json (1.3.6) 
Using activesupport (3.2.11) 
Using builder (3.0.4) 
Using activemodel (3.2.11) 
Using erubis (2.7.0) 
Using journey (1.0.4) 
Using rack (1.4.1) 
Using rack-cache (1.2) 
Using rack-test (0.6.2) 
Using hike (1.2.1) 
Using tilt (1.3.3) 
Using sprockets (2.2.1) 
Using actionpack (3.2.11) 
Using mime-types (1.19) 
Using polyglot (0.3.3) 
Using treetop (1.4.11) 
Using mail (2.4.4) 
Using actionmailer (3.2.11) 
Using active_utils (1.0.5) 
Using json (1.7.5) 
Using money (5.0.0) 
Using nokogiri (1.5.5) 
Using activemerchant (1.29.3) 
Using arel (3.0.2) 
Using tzinfo (0.3.34) 
Using activerecord (3.2.11) 
Using activeresource (3.2.11) 
Using acts_as_list (0.1.4) 
Using gyoku (0.4.6) 
Using akami (1.2.0) 
Using awesome_nested_set (2.1.5) 
Using multi_xml (0.5.1) 
Using httparty (0.8.3) 
Using uuidtools (2.1.3) 
Using aws-sdk (1.3.9) 
Using bcrypt-ruby (3.0.1) 
Using cancan (1.6.8) 
Using cocaine (0.4.0) 
Using coffee-script-source (1.4.0) 
Using execjs (1.4.0) 
Using coffee-script (2.2.0) 
Using rack-ssl (1.3.2) 
Using rdoc (3.12) 
Using thor (0.16.0) 
Using railties (3.2.11) 
Using coffee-rails (3.2.2) 
Using bundler (1.2.3) 
Using rails (3.2.11) 
Using deface (0.9.1) 
Using orm_adapter (0.0.7) 
Using warden (1.1.1) 
Using devise (2.0.4) 
Using ffaker (1.12.1) 
Using highline (1.6.11) 
Using httpi (1.1.1) 
Using jquery-rails (2.1.3) 
Using kaminari (0.13.0) 
Using libv8 (3.3.10.4) 
Using mysql2 (0.3.11) 
Using nori (1.1.3) 
Using paperclip (2.8.0) 
Using polyamorous (0.5.0) 
Using rabl (0.7.2) 
Using rails-i18n (0.7.2) 
Using ransack (0.7.2) 
Using sass (3.2.1) 
Using sass-rails (3.2.5) 
Using wasabi (2.5.1) 
Using savon (1.2.0) 
Using select2-rails (3.2.1) 
Using state_machine (1.1.2) 
Using stringex (1.3.3) 
Using spree_core (1.3.1) 
Using versioncake (0.4.0) 
Using spree_api (1.3.1) 
Using spree_cmd (1.3.1) 
Using spree_dash (1.3.1) 
Using spree_promo (1.3.1) 
Using spree_sample (1.3.1) 
Using spree (1.3.1) 
Using spree_auth_devise (1.3.1) 
Using spree_gateway (1.2.0.rc2) 
Using spree_i18n (1.0.0) 
Using spree_recently_viewed (1.1) from git://github.com/spree/spree_recently_viewed.git (at master) 
Using therubyracer (0.10.1) 
Using uglifier (1.3.0) 
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
[root@vps15 htdocs]# 

Here is log file:

[ pid=21805 thr=139871164802816 file=ext/common/agents/HelperAgent/RequestHandler.h:1731 time=2013-01-19 16:20:36.2705 ]: [Client 22] Cannot checkout session. An error occured while starting up the preloader.
Error page:
git://github.com/spree/spree_recently_viewed.git (at master) is not checked out. Please run `bundle install` (Bundler::GitError)
  /opt/spree-1.3.1-0/ruby/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler/source.rb:801:in `rescue in load_spec_files'
  /opt/spree-1.3.1-0/ruby/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler/source.rb:799:in `load_spec_files'
  /opt/spree-1.3.1-0/ruby/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler/source.rb:381:in `local_specs'
  /opt/spree-1.3.1-0/ruby/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler/source.rb:774:in `specs'
  /opt/spree-1.3.1-0/ruby/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler/lazy_specification.rb:53:in `__materialize__'
  /opt/spree-1.3.1-0/ruby/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler/spec_set.rb:86:in `block in materialize'
  /opt/spree-1.3.1-0/ruby/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler/spec_set.rb:83:in `map!'
  /opt/spree-1.3.1-0/ruby/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler/spec_set.rb:83:in `materialize'
  /opt/spree-1.3.1-0/ruby/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler/definition.rb:113:in `specs'
  /opt/spree-1.3.1-0/ruby/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler/definition.rb:158:in `specs_for'
  /opt/spree-1.3.1-0/ruby/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler/definition.rb:147:in `requested_specs'
  /opt/spree-1.3.1-0/ruby/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler/environment.rb:23:in `requested_specs'
  /opt/spree-1.3.1-0/ruby/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler/runtime.rb:11:in `setup'
  /opt/spree-1.3.1-0/ruby/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler.rb:116:in `setup'
  /opt/spree-1.3.1-0/ruby/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler/setup.rb:17:in `<top (required)>'
  /opt/spree-1.3.1-0/ruby/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `require'
  /opt/spree-1.3.1-0/ruby/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
  /opt/spree-1.3.1-0/ruby/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
  /opt/spree-1.3.1-0/ruby/lib/ruby/gems/1.9.1/gems/passenger-3.9.1.beta/lib/phusion_passenger/loader_shared_helpers.rb:201:in `run_load_path_setup_code'
  /opt/spree-1.3.1-0/ruby/lib/ruby/gems/1.9.1/gems/passenger-3.9.1.beta/helper-scripts/rack-preloader.rb:70:in `preload_app'
  /opt/spree-1.3.1-0/ruby/lib/ruby/gems/1.9.1/gems/passenger-3.9.1.beta/helper-scripts/rack-preloader.rb:124:in `<module:App>'
  /opt/spree-1.3.1-0/ruby/lib/ruby/gems/1.9.1/gems/passenger-3.9.1.beta/helper-scripts/rack-preloader.rb:6:in `<module:PhusionPassenger>'
  /opt/spree-1.3.1-0/ruby/lib/ruby/gems/1.9.1/gems/passenger-3.9.1.beta/helper-scripts/rack-preloader.rb:5:in `<main>'

[Sat Jan 19 16:20:36 2013] [error] [client 79.98.15.78] File does not exist: /opt/spree-1.3.1-0/apache2/htdocs/favicon.ico
[Sat Jan 19 16:20:36 2013] [error] [client 79.98.15.78] File does not exist: /opt/spree-1.3.1-0/apac

What do I do wrong?

Re: Passenger in production mode can't access gem from git

/opt/spree-1.3.1-0/ruby/bin/bundle install   (a gem from git will appear in rails root catalog (my pwd=rails_root_catalog). It's not good. It should go to vendor/cache. That is why passeger doesn't see it. I did set a wrong place in some way...

/opt/spree-1.3.1-0/ruby/bin/bundle package --all (pack all git-based gems and move to vendor/cache)

The problem is solved

Проблема решена.