ryanb/private_pub — Issue #43: all kinds of problems trying to start private_pub in production
Author: gchiaren
Created: 2012-03-08 22:24:52+00:00
State: open

I have private_pub working perfectly in development.

In production, I navigate to the /current directory of my app and try to start private_pub with:

rackup private_pub.ru -s thin -E production -d

and get all kinds of errors -

"thin"
Exception `LoadError' at /usr/local/rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36 - cannot load such file -- bundler/setup
Exception `NameError' at /usr/local/rvm/gems/ruby-1.9.3-p125/gems/psych-1.2.2/lib/psych/core_ext.rb:16 - method `to_yaml' not defined in Object
Exception `NameError' at /usr/local/rvm/gems/ruby-1.9.3-p125/gems/psych-1.2.2/lib/psych/core_ext.rb:29 - method `yaml_as' not defined in Module
Exception `NameError' at /usr/local/rvm/gems/ruby-1.9.3-p125/gems/psych-1.2.2/lib/psych/core_ext.rb:37 - method `y' not defined in Kernel
Exception `NameError' at /usr/local/rvm/gems/ruby-1.9.3-p125/gems/psych-1.2.2/lib/psych/deprecated.rb:79 - undefined method `to_yaml_properties' for class `Object'
Exception `Errno::EEXIST' at /usr/local/rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/fileutils.rb:247 - File exists - /usr/local/rvm/gems/ruby-1.9.3-p125
Exception `LoadError' at /usr/local/rvm/gems/ruby-1.9.3-p125/gems/addressable-2.2.7/lib/addressable/idna/native.rb:19 - cannot load such file -- idn
Exception `LoadError' at /usr/local/rvm/gems/ruby-1.9.3-p125/gems/addressable-2.2.7/lib/addressable/idna.rb:20 - cannot load such file -- idn
Exception `NameError' at /usr/local/rvm/gems/ruby-1.9.3-p125/gems/faye-websocket-0.4.1/lib/faye/websocket.rb:192 - uninitialized constant Kernel::Thin
Exception `NameError' at /usr/local/rvm/gems/ruby-1.9.3-p125/gems/faye-websocket-0.4.1/lib/faye/websocket.rb:192 - uninitialized constant Kernel::Rainbows
Exception `NameError' at /usr/local/rvm/gems/ruby-1.9.3-p125/gems/faye-websocket-0.4.1/lib/faye/websocket.rb:192 - uninitialized constant Kernel::Goliath
Exception `NameError' at /usr/local/rvm/gems/ruby-1.9.3-p125/gems/faye-websocket-0.4.1/lib/faye/websocket.rb:44 - uninitialized constant Kernel::Thin

I used someone else's advice on here and started it with

RAILS_ENV=production bundle exec rackup private_pub.ru -s thin -E production -d

which led to different errors

"thin"
Exception `LoadError' at /usr/local/rvm/gems/ruby-1.9.3-p125/gems/addressable-2.2.7/lib/addressable/idna/native.rb:19 - cannot load such file -- idn
Exception `LoadError' at /usr/local/rvm/gems/ruby-1.9.3-p125/gems/addressable-2.2.7/lib/addressable/idna.rb:20 - cannot load such file -- idn
Exception `NameError' at /usr/local/rvm/gems/ruby-1.9.3-p125/gems/faye-websocket-0.4.1/lib/faye/websocket.rb:192 - uninitialized constant Kernel::Thin
Exception `NameError' at /usr/local/rvm/gems/ruby-1.9.3-p125/gems/faye-websocket-0.4.1/lib/faye/websocket.rb:192 - uninitialized constant Kernel::Rainbows
Exception `NameError' at /usr/local/rvm/gems/ruby-1.9.3-p125/gems/faye-websocket-0.4.1/lib/faye/websocket.rb:192 - uninitialized constant Kernel::Goliath
Exception `NameError' at /usr/local/rvm/gems/ruby-1.9.3-p125/gems/faye-websocket-0.4.1/lib/faye/websocket.rb:44 - uninitialized constant Kernel::Thin

My private_pub.ru file looks like

require "bundler/setup"
require "yaml"
require "faye"
require "private_pub"

Faye::WebSocket.load_adapter('thin')

PrivatePub.load_config(File.expand_path("../config/private_pub.yml", __FILE__), ENV["RAILS_ENV"] || "development")
run PrivatePub.faye_app