Error when setup mongodb

41 views
Skip to first unread message

Tien Dinh Van

unread,
Mar 31, 2016, 1:47:36 AM3/31/16
to phusion-...@googlegroups.com
I'm getting error run bundle exec rake db:setup:
I'm running ruby on rails

/home/dev/.rvm/gems/ruby-1.9.3-p551/gems/mongoid-3.1.6/lib/mongoid/railtie.rb:137:in `block (2 levels) in <class:Railtie>': undefined method `on_event' for PhusionPassenger:Module (NoMethodError)
from /home/dev/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-3.2.21/lib/active_support/lazy_load_hooks.rb:34:in `call'
from /home/dev/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-3.2.21/lib/active_support/lazy_load_hooks.rb:34:in `execute_hook'
from /home/dev/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-3.2.21/lib/active_support/lazy_load_hooks.rb:43:in `block in run_load_hooks'
from /home/dev/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-3.2.21/lib/active_support/lazy_load_hooks.rb:42:in `each'
from /home/dev/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-3.2.21/lib/active_support/lazy_load_hooks.rb:42:in `run_load_hooks'
from /home/dev/.rvm/gems/ruby-1.9.3-p551/gems/railties-3.2.21/lib/rails/application/finisher.rb:59:in `block in <module:Finisher>'
from /home/dev/.rvm/gems/ruby-1.9.3-p551/gems/railties-3.2.21/lib/rails/initializable.rb:30:in `instance_exec'
from /home/dev/.rvm/gems/ruby-1.9.3-p551/gems/railties-3.2.21/lib/rails/initializable.rb:30:in `run'
from /home/dev/.rvm/gems/ruby-1.9.3-p551/gems/railties-3.2.21/lib/rails/initializable.rb:55:in `block in run_initializers'
from /home/dev/.rvm/gems/ruby-1.9.3-p551/gems/railties-3.2.21/lib/rails/initializable.rb:54:in `each'
from /home/dev/.rvm/gems/ruby-1.9.3-p551/gems/railties-3.2.21/lib/rails/initializable.rb:54:in `run_initializers'
from /home/dev/.rvm/gems/ruby-1.9.3-p551/gems/railties-3.2.21/lib/rails/application.rb:136:in `initialize!'
from /home/dev/.rvm/gems/ruby-1.9.3-p551/gems/railties-3.2.21/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /data/github/content-api/config/environment.rb:6:in `<top (required)>'
from /home/dev/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:251:in `require'
from /home/dev/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:251:in `block in require'
from /home/dev/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:236:in `load_dependency'
from /home/dev/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:251:in `require'
from /data/github/content-api/config.ru:19:in `block in <main>'
from /home/dev/.rvm/gems/ruby-1.9.3-p551/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval'
from /home/dev/.rvm/gems/ruby-1.9.3-p551/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize'
from /data/github/content-api/config.ru:in `new'
from /data/github/content-api/config.ru:in `<main>'
from /home/dev/.rvm/gems/ruby-1.9.3-p551/gems/rack-1.4.5/lib/rack/builder.rb:40:in `eval'
from /home/dev/.rvm/gems/ruby-1.9.3-p551/gems/rack-1.4.5/lib/rack/builder.rb:40:in `parse_file'
from /home/dev/.rvm/gems/ruby-1.9.3-p551/gems/rack-1.4.5/lib/rack/server.rb:200:in `app'
from /home/dev/.rvm/gems/ruby-1.9.3-p551/gems/railties-3.2.21/lib/rails/commands/server.rb:46:in `app'
from /home/dev/.rvm/gems/ruby-1.9.3-p551/gems/rack-1.4.5/lib/rack/server.rb:304:in `wrapped_app'
from /home/dev/.rvm/gems/ruby-1.9.3-p551/gems/rack-1.4.5/lib/rack/server.rb:254:in `start'
from /home/dev/.rvm/gems/ruby-1.9.3-p551/gems/railties-3.2.21/lib/rails/commands/server.rb:70:in `start'
from /home/dev/.rvm/gems/ruby-1.9.3-p551/gems/railties-3.2.21/lib/rails/commands.rb:55:in `block in <top (required)>'
from /home/dev/.rvm/gems/ruby-1.9.3-p551/gems/railties-3.2.21/lib/rails/commands.rb:50:in `tap'
from /home/dev/.rvm/gems/ruby-1.9.3-p551/gems/railties-3.2.21/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Please give me some suggestions !

Daniel Knoppel

unread,
Mar 31, 2016, 6:07:17 AM3/31/16
to Phusion Passenger Discussions
It looks like this issue: https://github.com/phusion/passenger/issues/1768

- Daniel

Tien Dinh Van

unread,
Apr 1, 2016, 4:24:54 AM4/1/16
to Phusion Passenger Discussions

Thanks for you reply, I'm trying to fix it

Daniel Knoppel

unread,
Apr 1, 2016, 6:14:02 AM4/1/16
to Phusion Passenger Discussions
Did you see my code?


It still needs to be reviewed but this got rid of the error for me.

- Daniel

Tien Dinh Van

unread,
Apr 11, 2016, 11:45:41 PM4/11/16
to Phusion Passenger Discussions
Hi Daniel,
I was on long vacation so don't have chance  keep track this issue.
I'm still getting error with this issue, I saw on the new version 0.5.27 have user story to fix then i upgraded to that version.
But totally it is not fixed on my local machine. Would get help from you.

Tien Dinh Van

unread,
Apr 12, 2016, 2:35:26 AM4/12/16
to Phusion Passenger Discussions
I tried this code https://github.com/phusion/passenger/commit/fcf173eaaee0d4436cbe89b1da2b187191e04abe  and seem it worked.
I will try to test all my modules to see how is it.

Tien Dinh Van

unread,
Apr 12, 2016, 3:27:06 AM4/12/16
to phusion-...@googlegroups.com
It is help to run rake task with mongoid driver successful but after that when start passenger i'm getting this error: 
Error ID: b41435f1
  Error details saved to: /tmp/passenger-error-juePFq.html
  Message from application: cannot load such file -- /home/dev/.rvm/gems/ruby-1.9.3-p551/bundler/gems/passenger-3f875c920924/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core (LoadError)
  /home/dev/.rvm/gems/ruby-1.9.3-p551/bundler/gems/passenger-3f875c920924/src/ruby_supportlib/phusion_passenger.rb:235:in `require'
  /home/dev/.rvm/gems/ruby-1.9.3-p551/bundler/gems/passenger-3f875c920924/src/ruby_supportlib/phusion_passenger.rb:235:in `require_passenger_lib'
  /home/dev/.rvm/gems/ruby-1.9.3-p551/bundler/gems/passenger-3f875c920924/src/ruby_supportlib/phusion_passenger/loader_shared_helpers.rb:232:in `before_loading_app_code_step1'
  /home/dev/.rvm/gems/ruby-1.9.3-p551/bundler/gems/passenger-3f875c920924/src/helper-scripts/rack-preloader.rb:99:in `preload_app'
  /home/dev/.rvm/gems/ruby-1.9.3-p551/bundler/gems/passenger-3f875c920924/src/helper-scripts/rack-preloader.rb:156:in `<module:App>'
  /home/dev/.rvm/gems/ruby-1.9.3-p551/bundler/gems/passenger-3f875c920924/src/helper-scripts/rack-preloader.rb:30:in `<module:PhusionPassenger>'
  /home/dev/.rvm/gems/ruby-1.9.3-p551/bundler/gems/passenger-3f875c920924/src/helper-scripts/rack-preloader.rb:29:in `<main>'

[ 2016-04-12 14:19:24.3912 3793/7f9a377fe700 age/Cor/Con/CheckoutSession.cpp:285 ]: [Client 1-1] Cannot checkout session because a spawning error occurred. The identifier of the error is b41435f1. Please see earlier logs for details about the error.
App 4645 stdout:  "

How can i resolve it ?

Daniel Knoppel

unread,
Apr 12, 2016, 4:00:33 AM4/12/16
to Phusion Passenger Discussions
It looks like you checked out the Passenger code from GitHub, but to get the complete code you should also check out the two submodules:
(/src/ruby_supportlib/phusion_passenger/vendor/)union_station_hooks_core
(/src/ruby_supportlib/phusion_passenger/vendor/)union_station_hooks_rails

- Daniel

Tien Dinh Van

unread,
Apr 12, 2016, 4:25:59 AM4/12/16
to Phusion Passenger Discussions
How can i checkout two sub-modules correctly ?

Tien Dinh Van

unread,
Apr 12, 2016, 4:38:32 AM4/12/16
to phusion-...@googlegroups.com
Can i use master (default) branch of this ?,  actually it still getting error when i checkout master branch of two sub-modules. 

Daniel Knoppel

unread,
Apr 12, 2016, 4:49:53 AM4/12/16
to Phusion Passenger Discussions
Maybe you can start fresh. This command gets passenger and all the necessary submodules:

git clone --recursive https://github.com/phusion/passenger.git passenger --branch stable-5.0

- Daniel

On Tuesday, April 12, 2016 at 10:38:32 AM UTC+2, Tien Dinh Van wrote:
Can i use master (default) branch of this.haize, not familiar with this code. sorry ?

Dinh Van Tien

unread,
Apr 13, 2016, 4:56:38 AM4/13/16
to Phusion Passenger Discussions

I'm getting issue when run passenger in docker container.
 docker run --rm -p 3008:3008 imagesname
 --> Downloading a Phusion Passenger agent binary for your platform
     Phusion Passenger was not installed from an official release package, so you cannot download our

---------------------------------------

The Phusion Passenger agent binary could not be downloaded. Compiling it from source instead.

Checking for required software...

 * Checking for C compiler...
      Found: yes
      Location: /usr/bin/cc
 * Checking for C++ compiler...
      Found: yes
      Location: /usr/bin/c++
 * Checking for Rake (associated with /home/tokyo-deploy/.rvm/gems/ruby-1.9.3-p551/wrappers/ruby)...
      Found: yes
      Location: /home/tokyo-deploy/.rvm/gems/ruby-1.9.3-p551/wrappers/rake
 * Checking for Curl development headers with SSL support...
      Found: yes
      curl-config location: /usr/bin/curl-config
      Header location: /usr/include/curl/curl.h
      Version: libcurl 7.35.0
      Usable: yes
      Supports SSL: yes
 * Checking for OpenSSL development headers...
      Found: yes
      Location: /usr/include/openssl/ssl.h
 * Checking for Zlib development headers...
      Found: yes
      Location: /usr/include/zlib.h

Not compiling with optimizations.
Compiling Phusion Passenger agent...
.................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
Compilation finished!

 --> Installing Nginx 1.8.1 engine
     Phusion Passenger was not installed from an official release package, so you cannot download our precompiled Nginx engine.

---------------------------------------

No precompiled Nginx engine could be downloaded. Compiling it from source instead.

Checking for required software...

 * Checking for C compiler...
      Found: yes
      Location: /usr/bin/cc
 * Checking for C++ compiler...
      Found: yes
      Location: /usr/bin/c++
 * Checking for GNU make...
      Found: yes
      Location: /usr/bin/make
 * Checking for Rake (associated with /home/tokyo-deploy/.rvm/gems/ruby-1.9.3-p551/wrappers/ruby)...
      Found: yes
      Location: /home/tokyo-deploy/.rvm/gems/ruby-1.9.3-p551/wrappers/rake
 * Checking for OpenSSL development headers...
      Found: yes
      Location: /usr/include/openssl/ssl.h
 * Checking for Zlib development headers...
      Found: yes
      Location: /usr/include/zlib.h
 * Checking for PCRE development headers...
      Found: yes
      Location: /usr/include/pcre.h

Installing...
Downloading Nginx 1.8.1 source code...
Extracting tarball...
Compiling support libraries (step 1 of 2)...
..............................................................................................................................................................................................................................................................
Compiling Nginx engine (step 2 of 2)...
....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
Compilation finished!

--------------------------

 [passenger_native_support.so] trying to compile for the current user (tokyo-deploy) and Ruby interpreter...
     (set PASSENGER_COMPILE_NATIVE_SUPPORT_BINARY=0 to disable)
     Compilation successful. The logs are here:
     /tmp/passenger_native_support-vjb3f4.log
 [passenger_native_support.so] successfully loaded.
=============== Phusion Passenger Standalone web server started ===============
PID file: /srv/tokyo/calendar-frontend/current/tmp/pids/passenger.3008.pid
Log file: /srv/tokyo/calendar-frontend/current/log/passenger.3008.log

It take about 30 minutes to run this task but actually I setup it in docker base already. What i was setup in Gemfile that is:
gem "passenger", :git => 'g...@github.com:phusion/passenger.git', :branch => 'stable-5.0', :submodules => true, require: "phusion_passenger/rack_handler".


Daniel Knoppel

unread,
Apr 13, 2016, 5:02:48 AM4/13/16
to Phusion Passenger Discussions
This is normal. If you start from source, then Passenger needs to compile.

If you don't commit the changes to the container afterwards then the compilation result will be lost and it will have to compile again.

- Daniel

Dinh Van Tien

unread,
Apr 13, 2016, 7:05:46 AM4/13/16
to phusion-...@googlegroups.com
I tried to build this source to a gem then point the Gemfile to the gem version has been build but it is still run recompile when start passenger.
Do you know how to resolve this 

btw, much thanks for your help so far.

Tien Dinh Van

unread,
Apr 14, 2016, 12:27:15 PM4/14/16
to Phusion Passenger Discussions
Do you know to prevent this issue (recompile when start passenger) ? Do not quiet understand how to do this:
"If you don't commit the changes to the container afterwards then the compilation result will be lost and it will have to compile again."
Hope you can help.

Tien Dinh Van

unread,
Apr 14, 2016, 1:19:51 PM4/14/16
to Phusion Passenger Discussions
I trying other cases, hope it works
Much thanks so far

Daniel Knoppel

unread,
Apr 15, 2016, 4:06:11 AM4/15/16
to Phusion Passenger Discussions
Reply all
Reply to author
Forward
0 new messages