Skip to content

Instantly share code, notes, and snippets.

@duythien
Last active May 9, 2018 10:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save duythien/c6d2eef00917e3e54f7358d1476bffbc to your computer and use it in GitHub Desktop.
Save duythien/c6d2eef00917e3e54f7358d1476bffbc to your computer and use it in GitHub Desktop.

Information

/srv/www/pushmessaging-api/current # gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.23.2
  - RUBY VERSION: 1.9.3 (2014-11-13 patchlevel 551) [x86_64-linux]
  - INSTALLATION DIRECTORY: /usr/local/bundle
  - RUBY EXECUTABLE: /usr/local/bin/ruby
  - EXECUTABLE DIRECTORY: /usr/local/bundle/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /usr/local/bundle
     - /root/.gem/ruby/1.9.1
     - /usr/local/lib/ruby/gems/1.9.1
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - "install" => "--no-document"
     - "update" => "--no-document"
  - REMOTE SOURCES:
     - http://rubygems.org/
/srv/www/pushmessaging-api/current # 

Load path

/srv/www/pushmessaging-api/current # irb
irb(main):001:0> $LOAD_PATH
=> ["/usr/local/lib/ruby/site_ruby/1.9.1", "/usr/local/lib/ruby/site_ruby/1.9.1/x86_64-linux", "/usr/local/lib/ruby/site_ruby", "/usr/local/lib/ruby/vendor_ruby/1.9.1", "/usr/local/lib/ruby/vendor_ruby/1.9.1/x86_64-linux", "/usr/local/lib/ruby/vendor_ruby", "/usr/local/lib/ruby/1.9.1", "/usr/local/lib/ruby/1.9.1/x86_64-linux"]
irb(main):002:0> 

Gemfile

source 'https://rubygems.org'
gem 'rails', '3.2.21'
gem 'rails-api', '~> 0.1.0'
gem 'oauth', '0.5.1'
gem 'nokogiri', '~> 1.6.8.1'

Install gem lib

bundle install

After install success we have two local gem direcoty

/srv/www/pushmessaging-api/current #  ls /usr/local/bundle/gems/

actionmailer-3.2.21         aws-sdk-core-2.0.48         devise-2.2.3                i18n_data-0.7.0             multi_json-1.10.1           rabl-0.10.1                 simpleconfig-2.0.1
actionpack-3.2.21           aws-sdk-resources-2.0.48    em-http-request-1.1.2       jmespath-1.4.0              multi_xml-0.5.5             rack-1.4.5                  slop-3.6.0
active_enum-0.9.12          aws-sdk-v1-1.67.0           em-socksify-0.3.0           journey-1.0.4               net-scp-1.2.1               rack-cache-1.2              sprockets-2.2.3
activemodel-3.2.21          bcrypt-3.1.11               enumerize-1.1.1             json-1.8.2                  net-ssh-2.9.2               rack-ssl-1.3.4              strong_parameters-0.2.3
activerecord-3.2.21         bcrypt-ruby-3.1.5           erubis-2.7.0                kaminari-0.14.1             newrelic_rpm-3.18.1.330     rack-test-0.6.3             thin-1.6.3
activeresource-3.2.21       bson-4.3.0                  eventmachine-1.0.7          kgio-2.9.3                  oauth-0.5.1                 rails-3.2.21                thor-0.19.1
activesupport-3.2.21        builder-3.0.4               ezcrypto-0.7.2              liquid-3.0.1                oj-2.1.7                    rails-api-0.1.0             tilt-1.4.1
addressable-2.3.7           cancancan-1.8.4             faye-1.0.3                  mail-2.5.4                  open4-1.3.4                 railties-3.2.21             treetop-1.4.15
airbrake-4.0.0              coderay-1.1.0               faye-rails-2.0.0            method_source-0.8.2         origin-1.1.0                raindrops-0.13.0            tzinfo-0.3.43
amq-protocol-1.9.2          concurrent-ruby-1.0.1       faye-websocket-0.9.2        mime-types-1.25.1           orm_adapter-0.5.0           rake-10.4.2                 unicorn-4.8.3
amqp-1.4.1                  cookiejar-0.3.2             hike-1.2.3                  mina-0.3.0                  passenger-5.0.28            rdoc-3.12.2                 uservoice-ruby-0.0.11
arel-3.0.3                  countries-0.11.5            http_parser.rb-0.6.0        mongo-2.2.1                 pg-0.18.1                   redis-3.1.0                 warden-1.2.7
audited-3.0.0               currencies-0.4.2            httparty-0.11.0             mongoid-3.1.6               polyglot-0.3.5              request_store_rails-1.0.0   websocket-driver-0.5.1
aws-sdk-2.0.48              daemons-1.1.9               i18n-0.7.0                  moped-1.5.3                 pry-0.10.1                  seedbank-0.3.0              websocket-extensions-0.1.1

And

/srv/www/pushmessaging-api/current # ls /usr/local/bundle/bundler/gems/
api-engine-bdc37e0c591a
audited-amqp-f1ba84c7c9d6
commons-fcd88b3ee96e
devise_header_authenticatable-cc05cb1d14b0
dupe-efcf98677043
tokyo-conf-4d9103cf53b5

Start app

Just running command

bundle exec thin -e development -C config/thin/dynamic.yml  start
/srv/www/pushmessaging-api/current # bundle exec thin -e development -C config/t
hin/dynamic.yml  start
Using rack adapter
"Loaded commons gem version 0.2.1"
"To use models or enums from this gem: require 'enums/account_type',  require 'models/ability'"
/usr/local/bundle/gems/simpleconfig-2.0.1/lib/simple_config.rb:144:in `instance_eval': uninitialized constant TokyoConf (NameError)
	from /usr/local/bundle/gems/simpleconfig-2.0.1/lib/simple_config.rb:144:in `instance_eval'
	from /usr/local/bundle/gems/simpleconfig-2.0.1/lib/simple_config.rb:144:in `load'
	from /usr/local/bundle/bundler/gems/api-engine-bdc37e0c591a/lib/api-engine/engine.rb:48:in `block (2 levels) in <class:Engine>'
	from /usr/local/bundle/gems/simpleconfig-2.0.1/lib/simple_config.rb:42:in `instance_eval'
	from /usr/local/bundle/gems/simpleconfig-2.0.1/lib/simple_config.rb:42:in `configure'
	from /usr/local/bundle/gems/simpleconfig-2.0.1/lib/simple_config.rb:23:in `for'
	from /usr/local/bundle/gems/simpleconfig-2.0.1/lib/simple_config.rb:8:in `for'
	from /usr/local/bundle/bundler/gems/api-engine-bdc37e0c591a/lib/api-engine/engine.rb:36:in `block in <class:Engine>'
	from /usr/local/bundle/gems/activesupport-3.2.21/lib/active_support/lazy_load_hooks.rb:34:in `call'
	from /usr/local/bundle/gems/activesupport-3.2.21/lib/active_support/lazy_load_hooks.rb:34:in `execute_hook'
	from /usr/local/bundle/gems/activesupport-3.2.21/lib/active_support/lazy_load_hooks.rb:43:in `block in run_load_hooks'
	from /usr/local/bundle/gems/activesupport-3.2.21/lib/active_support/lazy_load_hooks.rb:42:in `each'
	from /usr/local/bundle/gems/activesupport-3.2.21/lib/active_support/lazy_load_hooks.rb:42:in `run_load_hooks'
	from /usr/local/bundle/gems/railties-3.2.21/lib/rails/application.rb:67:in `inherited'
	from /srv/www/pushmessaging-api/current/config/application.rb:21:in `<module:RailsApi>'
	from /srv/www/pushmessaging-api/current/config/application.rb:20:in `<top (required)>'
	from /srv/www/pushmessaging-api/current/config/environment.rb:2:in `require'
	from /srv/www/pushmessaging-api/current/config/environment.rb:2:in `<top (required)>'
	from /srv/www/pushmessaging-api/current/config.ru:3:in `require'
	from /srv/www/pushmessaging-api/current/config.ru:3:in `block in <main>'
	from /usr/local/bundle/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval'
	from /usr/local/bundle/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize'
	from /srv/www/pushmessaging-api/current/config.ru:1:in `new'
	from /srv/www/pushmessaging-api/current/config.ru:1:in `<main>'
	from /usr/local/bundle/gems/thin-1.6.3/lib/rack/adapter/loader.rb:33:in `eval'
	from /usr/local/bundle/gems/thin-1.6.3/lib/rack/adapter/loader.rb:33:in `load'
	from /usr/local/bundle/gems/thin-1.6.3/lib/rack/adapter/loader.rb:42:in `for'
	from /usr/local/bundle/gems/thin-1.6.3/lib/thin/controllers/controller.rb:170:in `load_adapter'
	from /usr/local/bundle/gems/thin-1.6.3/lib/thin/controllers/controller.rb:74:in `start'
	from /usr/local/bundle/gems/thin-1.6.3/lib/thin/runner.rb:200:in `run_command'
	from /usr/local/bundle/gems/thin-1.6.3/lib/thin/runner.rb:156:in `run!'
	from /usr/local/bundle/gems/thin-1.6.3/bin/thin:6:in `<top (required)>'
	from /usr/local/bundle/bin/thin:16:in `load'
	from /usr/local/bundle/bin/thin:16:in `<main>'
/srv/www/pushmessaging-api/current # 

But if I am running the command below it will be work

bundle exec unicorn_rails -c config/unicorn/development.rb -p 3000

The output

/srv/www/pushmessaging-api/current # bundle exec unicorn_rails -c config/unicorn
/development.rb -p 3000
I, [2018-05-09T08:21:14.652265 #149]  INFO -- : Refreshing Gem list
"Loaded commons gem version 0.2.1"
"To use models or enums from this gem: require 'enums/account_type',  require 'models/ability'"
I, [2018-05-09T08:21:23.677217 #149]  INFO -- : listening on addr=0.0.0.0:4103 fd=14
I, [2018-05-09T08:21:23.677354 #149]  INFO -- : listening on addr=0.0.0.0:3000 fd=15
I, [2018-05-09T08:21:23.681653 #149]  INFO -- : master process ready
I, [2018-05-09T08:21:23.999988 #152]  INFO -- : worker=0 ready
[amqp] Detected TCP connection failure
[amqp] Detected TCP connection failure
I, [2018-05-09T08:21:24.001937 #156]  INFO -- : worker=1 ready

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment