NullPointerException while executing cap write_permissions task from tutorial - capistrano

I'm seeing an NPE when trying to execute the check_write_permissions task from the Capistrano website.
The stage file itself is straightforward:
server "demo.ourapp.com", user: "deployuser", roles: %w{app db web}
set :branch, "dev"
set :deployment, "demo"
set :rails_env, "production"
role :app, "demo.ourapp.com"
role :web, "demo.ourapp.com"
role :db, "demo.ourapp.com", :primary => true
set :repository, "git#github.com:ouruser/ourapp.git"
set :deploy_to, "/opt/companyname/ourapp-demo"
set :puma_bind, "unix://#{shared_path}/tmp/sockets/#{fetch(:application)}-puma.sock"
set :puma_state, "#{shared_path}/tmp/pids/puma.state"
set :puma_pid, "#{shared_path}/tmp/pids/puma.pid"
set :puma_access_log, "#{release_path}/log/puma.error.log"
set :puma_error_log, "#{release_path}/log/puma.access.log"
set :puma_preload_app, true
set :puma_worker_timeout, nil
Upon executing bundle exec cap deploy this:stage check_write_permissions, I get the following error:
$ bundle exec cap this:stage check_write_permissions --trace ‹jruby-9.1.12.0›
** Invoke this:stage (first_time)
** Execute this:stage
** Invoke load:defaults (first_time)
** Execute load:defaults
** Invoke bundler:map_bins (first_time)
** Execute bundler:map_bins
** Invoke deploy:set_rails_env (first_time)
** Execute deploy:set_rails_env
** Invoke deploy:set_linked_dirs (first_time)
** Execute deploy:set_linked_dirs
** Invoke deploy:set_rails_env
** Invoke check_write_permissions (first_time)
** Execute check_write_permissions
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as deployuser#demo.ourapp.com:
/Users/srdjan/.bundle/jruby/2.3.0/gems/sshkit-1.14.0/lib/sshkit/runners/parallel.rb:15:in `block in execute'
Java::JavaLang::NullPointerException:
org.jruby.ext.openssl.PKeyEC$Point.initialize(PKeyEC.java:845)
org.jruby.ext.openssl.PKeyEC$Point$INVOKER$i$0$0$initialize.call(PKeyEC$Point$INVOKER$i$0$0$initialize.gen)
org.jruby.internal.runtime.methods.JavaMethod$JavaMethodN.call(JavaMethod.java:725)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:368)
org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:205)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:209)
org.jruby.RubyClass.newInstance(RubyClass.java:1008)
org.jruby.RubyClass$INVOKER$i$newInstance.call(RubyClass$INVOKER$i$newInstance.gen)
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:208)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:358)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:195)
org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:323)
org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:73)
org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:89)
org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:214)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:200)
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:208)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:358)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:195)
org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:323)
org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:73)
org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:83)
org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:179)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:165)
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:200)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:161)
org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:314)
org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:73)
org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:77)
org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:144)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:130)
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:192)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:129)
org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:339)
org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:73)
org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:83)
org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:179)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:165)
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:200)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:161)
org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:314)
org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:73)
org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:109)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:95)
org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:77)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:83)
org.jruby.ir.instructions.CallBase.interpret(CallBase.java:428)
org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:355)
org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:73)
org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:132)
org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:148)
org.jruby.runtime.IRBlockBody.doYield(IRBlockBody.java:186)
org.jruby.runtime.BlockBody.yield(BlockBody.java:116)
org.jruby.runtime.Block.yield(Block.java:165)
org.jruby.RubyIO.each_lineInternal(RubyIO.java:3282)
org.jruby.RubyIO.each_line(RubyIO.java:3295)
org.jruby.RubyIO$INVOKER$i$0$1$each_line.call(RubyIO$INVOKER$i$0$1$each_line.gen)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:298)
org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:79)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:83)
org.jruby.ir.instructions.CallBase.interpret(CallBase.java:428)
org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:355)
org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:73)
org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:132)
org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:148)
org.jruby.runtime.IRBlockBody.doYield(IRBlockBody.java:186)
org.jruby.runtime.BlockBody.yield(BlockBody.java:116)
org.jruby.runtime.Block.yield(Block.java:165)
org.jruby.RubyIO.ensureYieldClose(RubyIO.java:1163)
org.jruby.RubyIO.open(RubyIO.java:1156)
org.jruby.RubyIO$INVOKER$s$0$0$open.call(RubyIO$INVOKER$s$0$0$open.gen)
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:204)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:348)
org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:173)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:177)
org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:332)
org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:73)
org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:132)
org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:148)
org.jruby.runtime.IRBlockBody.yieldSpecific(IRBlockBody.java:84)
org.jruby.runtime.Block.yieldSpecific(Block.java:134)
org.jruby.ext.thread.Mutex.synchronize(Mutex.java:148)
org.jruby.ext.thread.Mutex$INVOKER$i$0$0$synchronize.call(Mutex$INVOKER$i$0$0$synchronize.gen)
org.jruby.internal.runtime.methods.JavaMethod$JavaMethodZeroBlock.call(JavaMethod.java:498)
org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:77)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:83)
org.jruby.ir.instructions.CallBase.interpret(CallBase.java:428)
org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:355)
org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:73)
org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:109)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:95)
org.jruby.internal.runtime.methods.AliasMethod.call(AliasMethod.java:101)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:298)
org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:79)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:83)
org.jruby.ir.instructions.CallBase.interpret(CallBase.java:428)
org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:355)
org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:73)
org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:77)
org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:144)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:130)
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:192)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:318)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:131)
org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:339)
org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:73)
org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:83)
org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:179)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:165)
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:200)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:338)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:163)
org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:314)
org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:73)
org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:132)
org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:148)
org.jruby.runtime.IRBlockBody.doYield(IRBlockBody.java:186)
org.jruby.runtime.BlockBody.yield(BlockBody.java:116)
org.jruby.runtime.Block.yield(Block.java:165)
org.jruby.RubyArray.collect(RubyArray.java:2472)
org.jruby.RubyArray.map19(RubyArray.java:2486)
org.jruby.RubyArray$INVOKER$i$0$0$map19.call(RubyArray$INVOKER$i$0$0$map19.gen)
org.jruby.internal.runtime.methods.JavaMethod$JavaMethodZeroBlock.call(JavaMethod.java:498)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:298)
org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:79)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:83)
org.jruby.ir.instructions.CallBase.interpret(CallBase.java:428)
org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:355)
org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:73)
org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:89)
org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:214)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:200)
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:208)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:358)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:195)
org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:323)
org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:73)
org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:77)
org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:144)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:130)
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:192)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:318)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:131)
org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:339)
org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:73)
org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:77)
org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:144)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:130)
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:192)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:318)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:131)
org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:339)
org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:73)
org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:89)
org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:214)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:200)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:368)
org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:205)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:209)
org.jruby.RubyClass.newInstance(RubyClass.java:1008)
org.jruby.RubyClass$INVOKER$i$newInstance.call(RubyClass$INVOKER$i$newInstance.gen)
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:208)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:358)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:195)
org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:323)
org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:73)
org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:89)
org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:214)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:200)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:368)
org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:205)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:209)
org.jruby.RubyClass.newInstance(RubyClass.java:1008)
org.jruby.RubyClass$INVOKER$i$newInstance.call(RubyClass$INVOKER$i$newInstance.gen)
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:208)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:358)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:195)
org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:323)
org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:73)
org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:109)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:95)
org.jruby.RubyMethod.call(RubyMethod.java:127)
org.jruby.RubyMethod$INVOKER$i$call.call(RubyMethod$INVOKER$i$call.gen)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:298)
org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:79)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:83)
org.jruby.ir.instructions.CallBase.interpret(CallBase.java:428)
org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:355)
org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:73)
org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:109)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:95)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:298)
org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:79)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:83)
org.jruby.ir.instructions.CallBase.interpret(CallBase.java:428)
org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:355)
org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:73)
org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:109)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:95)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:298)
org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:79)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:83)
org.jruby.ir.instructions.CallBase.interpret(CallBase.java:428)
org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:355)
org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:73)
org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:83)
org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:179)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:165)
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:200)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:338)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:163)
org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:314)
org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:73)
org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:132)
org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:148)
org.jruby.runtime.IRBlockBody.doYield(IRBlockBody.java:186)
org.jruby.runtime.BlockBody.yield(BlockBody.java:116)
org.jruby.runtime.Block.yield(Block.java:165)
org.jruby.RubyKernel.tap(RubyKernel.java:1747)
org.jruby.RubyKernel$INVOKER$s$0$0$tap.call(RubyKernel$INVOKER$s$0$0$tap.gen)
org.jruby.internal.runtime.methods.JavaMethod$JavaMethodZeroBlock.call(JavaMethod.java:498)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:298)
org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:79)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:83)
org.jruby.ir.instructions.CallBase.interpret(CallBase.java:428)
org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:355)
org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:73)
org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:89)
org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:214)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:200)
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:208)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:358)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:195)
org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:323)
org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:73)
org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:83)
org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:179)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:165)
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:200)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:338)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:163)
org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:314)
org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:73)
org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:132)
org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:148)
org.jruby.runtime.IRBlockBody.doYield(IRBlockBody.java:193)
org.jruby.runtime.BlockBody.yield(BlockBody.java:125)
org.jruby.runtime.Block.yieldNonArray(Block.java:169)
org.jruby.RubyBasicObject.yieldUnder(RubyBasicObject.java:1751)
org.jruby.RubyBasicObject.instance_exec19(RubyBasicObject.java:1728)
org.jruby.RubyBasicObject$INVOKER$i$0$3$instance_exec19.call(RubyBasicObject$INVOKER$i$0$3$instance_exec19.gen)
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:204)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:348)
org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:173)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:177)
org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:332)
org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:73)
org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:77)
org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:144)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:130)
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:192)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:318)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:131)
org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:339)
org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:73)
org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:132)
org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:148)
org.jruby.runtime.IRBlockBody.call(IRBlockBody.java:73)
org.jruby.runtime.Block.call(Block.java:124)
org.jruby.RubyProc.call(RubyProc.java:289)
org.jruby.RubyProc.call(RubyProc.java:246)
org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:104)
java.lang.Thread.run(Thread.java:745)
Tasks: TOP => check_write_permissions
I am using JRuby 9.1.12.0, Capistrano 3.8.2. I've anonymized the info, but the deployuser does have passwordless SSH access.
Any help is greatly appreciated.

A search for org.jruby.ext.openssl.PKeyEC$Point.initialize(PKeyEC.java:845) turned up this: https://github.com/jruby/jruby-openssl/issues/105 which suggests this as a workaround:
Net::SSH::Transport::Algorithms::ALGORITHMS.values.each { |algs| algs.reject! { |a| a =~ /^ecd(sa|h)-sha2/ } }
Net::SSH::KnownHosts::SUPPORTED_TYPE.reject! { |t| t =~ /^ecd(sa|h)-sha2/ }
Does this help at all?

Related

How to resolve Deploying error in heroku using mongodb

MongoServerError: bad auth : Authentication failed.
at Connection.onMessage (/Users/harshkataria/Desktop/Tag/node_modules/mongodb/lib/cmap/connection.js:210:30)
at MessageStream.<anonymous> (/Users/harshkataria/Desktop/Tag/node_modules/mongodb/lib/cmap/connection.js:63:60)
at MessageStream.emit (node:events:527:28)
at processIncomingData (/Users/harshkataria/Desktop/Tag/node_modules/mongodb/lib/cmap/message_stream.js:132:20)
at MessageStream._write (/Users/harshkataria/Desktop/Tag/node_modules/mongodb/lib/cmap/message_stream.js:33:9)
at writeOrBuffer (node:internal/streams/writable:389:12)
at _write (node:internal/streams/writable:330:10)
at MessageStream.Writable.write (node:internal/streams/writable:334:10)
at TLSSocket.ondata (node:internal/streams/readable:754:22)
at TLSSocket.emit (node:events:527:28) {
ok: 0,
code: 8000,
codeName: 'AtlasError',
[Symbol(errorLabels)]: Set(1) { 'HandshakeError' }
}
[nodemon] app crashed - waiting for file changes before starting...
hello i am facing issue while connecting my app in heroku while using mongo auth

NestJS TypeORM syntax error in migration file

I was going through the NestJS official docs. I set up PostgreSQL on Heroku, connected with TypeORM, run a migration and after that my app started crushing. I tried different approaches and searched blogs/issues on github/questions here, but nothing helped.
Here is an error:
[Nest] 46723 - 05/10/2020, 6:33:42 PM [InstanceLoader] TypeOrmModule dependencies initialized +84ms
[Nest] 46723 - 05/10/2020, 6:33:43 PM [TypeOrmModule] Unable to connect to the database. Retrying (1)... +493ms
/Users/Shared/diploma/be/migration/1589119433066-AddUser.ts:1
import {MigrationInterface, QueryRunner} from "typeorm";
^
SyntaxError: Unexpected token {
at Module._compile (internal/modules/cjs/loader.js:721:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Function.PlatformTools.load (/***/PROJECT_ROOT/node_modules/typeorm/platform/PlatformTools.js:114:28)
at /***/PROJECT_ROOT/node_modules/typeorm/util/DirectoryExportedClassesLoader.js:39:69
at Array.map (<anonymous>)
Here is my ormconfig.json:
"type": "postgres",
"url": "postgres://***",
"ssl": true,
"extra": {
"ssl": {
"rejectUnauthorized": false
}
},
"entities": ["dist/**/*.entity{.ts,.js}"],
"migrationsTableName": "custom_migration_table",
"migrations": ["migration/*{.ts,.js}"],
"cli": {
"migrationsDir": "migration"
}
}
migration was generated using ts-node ./node_modules/.bin/typeorm migration:generate -n AddUser
I'm using nest start --watch command to start the app.
Migration file {TIMESTAMP}-AddUser.ts:
import {MigrationInterface, QueryRunner} from "typeorm";
export class AddUser1589119433066 implements MigrationInterface {
name = 'AddUser1589119433066'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`CREATE TABLE "users" (...)`, undefined);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`DROP TABLE "users"`, undefined);
}
}
Thanks to #Isolated!
I've changed the ormconfig.json so entities and migrations files looks like this now and it works fine for me:
"entities": ["dist/**/*.entity{.ts,.js}"],
"migrations": ["dist/migration/*{.ts,.js}"],

Heroku Deployment Issues with Postgres and Sequelize

I am trying to deploy my app to Heroku. It works perfectly fine when run locally. From the moment I deployed it (deploying through github integration) I received the generic Application Error screen. Below are my heroku logs. These actually run three times but there was no point in me posting the same thing three times. They always end with:
2017-05-02T14:59:26.033702+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=calm-crag-40902.herokuapp.com request_id=6b64883e-9697-4d58-84d9-2f173d5b4cb1 fwd="70.
54.76.222" dyno= connect= service= status=503 bytes= protocol=https
2017-05-02T14:59:27.425435+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=calm-crag-40902.herokuapp.com request_id=d3719d8f-4670-4621-a044-a511ee6884
10 fwd="70.54.76.222" dyno= connect= service= status=503 bytes= protocol=https
This will print 2 to 4 times after each consecutive error screen. The first error is regarding the .env files not running and the second is trying to connect to sequelize. My primary focus is sorting out the .env because if that is sorted out, at least the app will show my app will be visible.
.env error:
{ Error: ENOENT: no such file or directory, open '.env'
2017-05-02T16:09:39.622865+00:00 app[web.1]: at Error (native)
2017-05-02T16:09:39.622866+00:00 app[web.1]: at Object.fs.openSync (fs.js:641:18)
2017-05-02T16:09:39.622867+00:00 app[web.1]: at Object.fs.readFileSync (fs.js:509:33)
2017-05-02T16:09:39.622867+00:00 app[web.1]: at Object.config (/app/node_modules/dotenv/lib/main.js:30:37)
2017-05-02T16:09:39.622868+00:00 app[web.1]: at Object.<anonymous> (/app/server.js:3:19)
2017-05-02T16:09:39.622869+00:00 app[web.1]: at Module._compile (module.js:570:32)
2017-05-02T16:09:39.622869+00:00 app[web.1]: at Object.Module._extensions..js (module.js:579:10)
2017-05-02T16:09:39.622870+00:00 app[web.1]: at Module.load (module.js:487:32)
2017-05-02T16:09:39.622871+00:00 app[web.1]: at tryModuleLoad (module.js:446:12)
2017-05-02T16:09:39.622871+00:00 app[web.1]: at Function.Module._load (module.js:438:3) errno: -2, code: 'ENOENT', syscall: 'open', path: '.env' }
2017-05-02T16:09:40.242885+00:00 app[web.1]: Unhandled rejection
Sequelize error:
SequelizeConnectionRefusedError: connect ECONNREFUSED 127.0.0.1:5432
2017-05-02T16:09:40.242902+00:00 app[web.1]: at /app/node_modules/sequelize/lib/dialects/postgres/connection-manager.js:98:20
2017-05-02T16:09:40.242903+00:00 app[web.1]: at Connection.<anonymous> (/app/node_modules/pg/lib/client.js:186:5)
2017-05-02T16:09:40.242904+00:00 app[web.1]: at emitOne (events.js:96:13)
2017-05-02T16:09:40.242905+00:00 app[web.1]: at Connection.emit (events.js:188:7)
2017-05-02T16:09:40.242905+00:00 app[web.1]: at Socket.<anonymous> (/app/node_modules/pg/lib/connection.js:86:10)
2017-05-02T16:09:40.242906+00:00 app[web.1]: at emitOne (events.js:96:13)
2017-05-02T16:09:40.242907+00:00 app[web.1]: at emitErrorNT (net.js:1281:8)
2017-05-02T16:09:40.242907+00:00 app[web.1]: at Socket.emit (events.js:188:7)
2017-05-02T16:09:40.242909+00:00 app[web.1]: at process._tickCallback (internal/process/next_tick.js:104:9)
2017-05-02T16:09:40.242908+00:00 app[web.1]: at _combinedTickCallback (internal/process/next_tick.js:80:11)
2017-05-02T16:09:40.360035+00:00 heroku[web.1]: Process exited with status 0
2017-05-02T16:09:40.373996+00:00 heroku[web.1]: State changed from starting to crashed
This is my index.js:
'use strict';
const fs = require('fs');
const path = require('path');
const Sequelize = require('sequelize');
const basename = path.basename(module.filename);
const env = process.env.NODE_ENV || 'development';
const config = require(__dirname + '/../config/config.json')[env];
const db = {};
if (config.use_env_variable) {
const sequelize = new Sequelize(process.env[config.use_env_variable]);
} else {
const sequelize = new Sequelize(config.database, config.username, config.password, config);
}
fs
.readdirSync(__dirname)
.filter((file) => {
return (file.indexOf('.') !== 0) && (file !== basename) && (file.slice(-3) === '.js');
})
.forEach((file) => {
const model = sequelize['import'](path.join(__dirname, file));
db[model.name] = model;
});
Object.keys(db).forEach((modelName) => {
if (db[modelName].associate) {
db[modelName].associate(db);
}
});
db.sequelize = sequelize;
db.Sequelize = Sequelize;
module.exports = db;
config.json:
{
"development": {
"username": "",
"password": "",
"database": "late_file",
"host": "127.0.0.1",
"dialect": "postgres"
},
"test": {
"username": "",
"password": "",
"database": "database_test",
"host": "127.0.0.1",
"dialect": "postgres"
},
"production": {
"use_env_variable": "DATABASE_URL",
"dialect": "postgres"
}
}
.env, modified to exclude specific names of things
DB_HOST=localhost
DB_USER=
DB_PASS=
DB_NAME=
DB_SSL=true if heroku
DB_PORT=5432
DATABASE_URL=postgres://appropriate/url
applicable part of server.js
const pg = require('pg');
pg.defaults.ssl = true;
pg.connect(process.env.DATABASE_URL, function(err, client) {
if (err) throw err;
console.log('Connected to postgres! Getting schemas...');
client
.query('SELECT table_schema,table_name FROM information_schema.tables;')
.on('row', function(row) {
console.log(JSON.stringify(row));
});
});
Any help would be greatly appreciated!
Thanks in advance for anyone who offers any support!
Brandon,
I am running an app on Heroku using JAWS_DB and MySQL, but otherwise identical config.json and index.js. In my case on Heroku, the "if (config.use_env_variable) {const sequelize = new Sequelize(process.env[config.use_env_variable])" statement connects to the database without error. The logs appear to point to the "pg.connect" failing in server.js. It's not clear to me (without seeing the rest of your code) why you need to connect to the database in index.js, and then connect again in server.js. If you can remove the connection from pg.connect and try to run with just the connection from index.js it may stop this error.

Meteor error - Storing tasks in a collection

I am following the meteor site tutorial (https://www.meteor.com/tutorials/blaze/collections).
But when you add the line:
export const Tasks = new Mongo.Collection('tasks');
I get the following error:
/Users/user/.meteor/packages/meteor-tool/.1.4.1_2.fpzmec++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:313
throw(ex);
^
MongoError: failed to connect to server [localhost:27017] on first connect
at Object.Future.wait (/Users/user/.meteor/packages/meteor-tool/.1.4.1_2.fpzmec++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:449:15)
at new MongoConnection (packages/mongo/mongo_driver.js:216:27)
at new MongoInternals.RemoteCollectionDriver (packages/mongo/remote_collection_driver.js:4:16)
at Object.<anonymous> (packages/mongo/remote_collection_driver.js:38:10)
at Object.defaultRemoteCollectionDriver (packages/underscore/underscore.js:750:1)
at new Mongo.Collection (packages/mongo/collection.js:103:40)
at meteorInstall.imports.api.tasks.js (imports/api/tasks.js:4:14)
at fileEvaluate (packages/modules-runtime/.npm/package/node_modules/install/install.js:153:1)
at Module.require (packages/modules-runtime/.npm/package/node_modules/install/install.js:82:1)
at Module.Mp.import (/Users/user/.meteor/packages/modules/.0.7.6_1.j54juu++os+web.browser+web.cordova/npm/node_modules/reify/lib/runtime.js:70:16)
- - - - -
at [object Object].<anonymous> (/Users/user/.meteor/packages/npm-mongo/.1.5.50.1g0yl8n++os+web.browser+web.cordova/npm/node_modules/mongodb-core/lib/topologies/server.js:313:35)
at emitOne (events.js:77:13)
at [object Object].emit (events.js:169:7)
at [object Object].<anonymous> (/Users/user/.meteor/packages/npm-mongo/.1.5.50.1g0yl8n++os+web.browser+web.cordova/npm/node_modules/mongodb-core/lib/connection/pool.js:260:12)
at [object Object].g (events.js:260:16)
at emitTwo (events.js:87:13)
at [object Object].emit (events.js:172:7)
at Socket.<anonymous> (/Users/user/.meteor/packages/npm-mongo/.1.5.50.1g0yl8n++os+web.browser+web.cordova/npm/node_modules/mongodb-core/lib/connection/connection.js:162:49)
at Socket.g (events.js:260:16)
at emitOne (events.js:77:13)
Exited with code: 1
Your application is crashing. Waiting for file change.
The line in the tutorial:
export const Tasks = new Mongo.Collection('tasks');
Is different from your line:
Export Tasks const = new Mongo.Collection ('tasks');
The goal of the code is to initialize a new constant, Tasks, set it to a new Mongo.Collection, and then export it.

error for push on heroku: PG::UndefinedObject: ERROR: type "string" does not exist

I'm trying to push an application for Heroku and I have some errors and don't know what to do. The development mode(webrick server) works fine, send the email, etc...
I'm using a activerecord-tableless for send email contact.
this is my ContactsController:
class ContactsController < ApplicationController
def new
#contact = Contact.new
end
def create
#contact = Contact.new(secure_params)
if #contact.valid?
UserMailer.contact_email(#contact).deliver_now
flash[:notice] = "Message sent from #{#contact.name}."
redirect_to root_path
else
flash.now[:error] = 'Cannot send message.'
render :new
end
end
private
def secure_params
params.require(:contact).permit(:name, :email, :content)
end
end
my Contact class:
class Contact < ActiveRecord::Base
has_no_table
column :name, :string
column :email, :string
column :content, :string
validates_presence_of :name, :email, :content
validates_format_of :email, :with => /\A[-a-z0-9_+\.]+\#([-a-z0-9]+\.)+[a-z0-9]{2,4}\z/i
validates_length_of :content, :maximum => 500
def self.column(name, sql_type = nil, default = nil, null = true)
type = "ActiveRecord::Type::#{sql_type.to_s.camelize}".constantize.new
tableless_options[:columns] << ActiveRecord::ConnectionAdapters::Column.new(name.to_s, default, type, null)
end
end
view new.html.erb:
<% content_for :title do %>Contact<% end %>
<div class="distance">
<div class="container">
<div class="row">
<div class="col-md-6 col-md-offset-3">
<div align="center">
<h2>Send a message to Us</h2>
<%= simple_form_for #contact do |form| %>
<%= form.error_notification %>
<%= form.input :name, autofocus: true, placeholder: 'Enter name' %>
<%= form.input :email, placeholder: 'Enter email' %>
<%= form.input :content, as: :text, placeholder: 'Enter the content' %>
<%= form.button :submit, 'Submit', class: 'btn btn-info btn-lg' %>
<% end %>
</div>
</div>
</div>
Gemfile:
source 'https://rubygems.org'
ruby '2.2.2'
gem 'rails', '4.2.4'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
group :development, :test do
gem 'byebug'
end
group :development do
gem 'web-console', '~> 2.0'
gem 'spring'
end
gem 'bootstrap-sass'
gem 'figaro', '>= 1.0.0.rc1'
gem 'simple_form'
gem 'font-awesome-sass', '~> 4.4.0'
gem "activerecord-tableless", ">= 1.3.4", git:'https://github.com/david135/activerecord-tableless.git'
group :development do
gem 'better_errors'
gem 'hub', :require=>nil
gem 'quiet_assets'
gem 'rails_layout'
end
group :development, :test do
gem 'sqlite3'
end
group :production do
gem 'pg'
gem 'rails_12factor'
gem 'thin'
end
database.yml:
# SQLite version 3.x
# gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
#
default: &default
adapter: sqlite3
pool: 5
timeout: 5000
development:
<<: *default
database: db/development.sqlite3
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
<<: *default
database: db/test.sqlite3
production:
<<: *default
database: db/production.sqlite3
production.rb
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both threaded web servers
# and those relying on copy on write to perform better.
# Rake tasks automatically ignore this option for performance.
config.eager_load = true
# Full error reports are disabled and caching is turned on.
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
# Enable Rack::Cache to put a simple HTTP cache in front of your application
# Add `rack-cache` to your Gemfile before enabling this.
# For large-scale production use, consider using a caching reverse proxy like
# NGINX, varnish or squid.
# config.action_dispatch.rack_cache = true
# Disable serving static files from the `/public` folder by default since
# Apache or NGINX already handles this.
config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
# Compress JavaScripts and CSS.
config.assets.js_compressor = :uglifier
# config.assets.css_compressor = :sass
# Do not fallback to assets pipeline if a precompiled asset is missed.
config.assets.compile = false
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
# yet still be able to expire them through the digest params.
config.assets.digest = true
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
# Specifies the header that your server uses for sending files.
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
# config.force_ssl = true
# Use the lowest log level to ensure availability of diagnostic information
# when problems arise.
config.log_level = :debug
# Prepend all log lines with the following tags.
# config.log_tags = [ :subdomain, :uuid ]
# Use a different logger for distributed setups.
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
# Use a different cache store in production.
# config.cache_store = :mem_cache_store
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
# config.action_controller.asset_host = 'http://assets.example.com'
# Ignore bad email addresses and do not raise email delivery errors.
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
# config.action_mailer.raise_delivery_errors = false
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation cannot be found).
config.i18n.fallbacks = true
# Send deprecation notices to registered listeners.
config.active_support.deprecation = :notify
config.action_mailer.smtp_settings = {
address: "smtp.gmail.com",
port: 587,
domain: Rails.application.secrets.domain_name,
authentication: "plain",
enable_starttls_auto: true,
user_name: Rails.application.secrets.email_provider_username,
password: Rails.application.secrets.email_provider_password
}
# ActionMailer Config
config.action_mailer.default_url_options = { :host => Rails.application.secrets.domain_name }
config.action_mailer.delivery_method = :smtp
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = false
config.action_mailer.default :charset => "utf-8"
config.action_mailer.smtp_settings = {
address: "smtp.gmail.com",
port: 587,
domain: ENV["DOMAIN_NAME"],
authentication: "plain",
enable_starttls_auto: true,
user_name: ENV["GMAIL_USERNAME"],
password: ENV["GMAIL_PASSWORD"]
}
# Use default logging formatter so that PID and timestamp are not suppressed.
config.log_formatter = ::Logger::Formatter.new
# Do not dump schema after migrations.
config.active_record.dump_schema_after_migration = false
end
I'm using the gem figaro and my application.yml is:
GMAIL_USERNAME: 'XXXXXXX'
GMAIL_PASSWORD: 'XXXXXXX'
DOMAIN_NAME: 'XXXXXXX'
OWNER_EMAIL: 'XXXXXXX#mail.com'
When I try to push for heroku I have this error:
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/motaprojectlive.git'
And when I try to run:
$ heroku run rails console
Running `rails console` attached to terminal... up, run.5541
PG::UndefinedObject: ERROR: type "string" does not exist
LINE 1: SELECT 'string'::regtype::oid
^
: SELECT 'string'::regtype::oid
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/postgresql/database_statements.rb:155:in `async_exec': PG::UndefinedObject: ERROR: type "string" does not exist (ActiveRecord::StatementInvalid)
LINE 1: SELECT 'string'::regtype::oid
^
: SELECT 'string'::regtype::oid
from /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/postgresql/database_statements.rb:155:in `block in execute'
$ heroku logs -t
2015-09-15T05:32:26.718951+00:00 app[web.1]: => Booting Thin
2015-09-15T05:32:26.718975+00:00 app[web.1]: => Rails 4.2.4 application starting in production on http://0.0.0.0:47284
2015-09-15T05:32:26.718977+00:00 app[web.1]: => Run `rails server -h` for more startup options
2015-09-15T05:32:26.718978+00:00 app[web.1]: => Ctrl-C to shutdown server
2015-09-15T05:32:26.718979+00:00 app[web.1]: PG::UndefinedObject: ERROR: type "string" does not exist
2015-09-15T05:32:26.718981+00:00 app[web.1]: LINE 1: SELECT 'string'::regtype::oid
2015-09-15T05:32:26.718982+00:00 app[web.1]: ^
2015-09-15T05:32:26.718983+00:00 app[web.1]: : SELECT 'string'::regtype::oid
2015-09-15T05:32:26.719031+00:00 app[web.1]: Exiting
2015-09-15T05:32:26.719097+00:00 app[web.1]: /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/postgresql/database_statements.rb:155:in `async_exec': PG::UndefinedObject: ERROR: type "string" does not exist (ActiveRecord::StatementInvalid)
2015-09-15T05:32:26.719099+00:00 app[web.1]: LINE 1: SELECT 'string'::regtype::oid
2015-09-15T05:32:26.719100+00:00 app[web.1]: ^
2015-09-15T05:32:26.719110+00:00 app[web.1]: : SELECT 'string'::regtype::oid
2015-09-15T05:32:26.719114+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/abstract_adapter.rb:473:in `block in log'
2015-09-15T05:32:26.719113+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/postgresql/database_statements.rb:155:in `block in execute'
2015-09-15T05:32:26.719117+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/abstract_adapter.rb:467:in `log'
2015-09-15T05:32:26.719115+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.4/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
2015-09-15T05:32:26.719120+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/postgresql/database_statements.rb:154:in `execute'
2015-09-15T05:32:26.719121+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/postgresql_adapter.rb:393:in `lookup_cast_type'
2015-09-15T05:32:26.719122+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/bundler/gems/activerecord-tableless-800393c52bd2/lib/activerecord-tableless.rb:93:in `column'
2015-09-15T05:32:26.719125+00:00 app[web.1]: from /app/app/models/contact.rb:3:in `<class:Contact>'
2015-09-15T05:32:26.719126+00:00 app[web.1]: from /app/app/models/contact.rb:1:in `<top (required)>'
2015-09-15T05:32:26.719132+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `block in require'
2015-09-15T05:32:26.719129+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `require'
2015-09-15T05:32:26.719142+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:317:in `depend_on'
2015-09-15T05:32:26.719139+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:360:in `require_or_load'
2015-09-15T05:32:26.719135+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:240:in `load_dependency'
2015-09-15T05:32:26.719147+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.4/lib/rails/engine.rb:472:in `block (2 levels) in eager_load!'
2015-09-15T05:32:26.719136+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `require'
2015-09-15T05:32:26.719187+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.4/lib/rails/engine.rb:471:in `block in eager_load!'
2015-09-15T05:32:26.719145+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:233:in `require_dependency'
2015-09-15T05:32:26.719191+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.4/lib/rails/engine.rb:469:in `each'
2015-09-15T05:32:26.719192+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.4/lib/rails/engine.rb:469:in `eager_load!'
2015-09-15T05:32:26.719150+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.4/lib/rails/engine.rb:471:in `each'
2015-09-15T05:32:26.719193+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.4/lib/rails/engine.rb:346:in `eager_load!'
2015-09-15T05:32:26.719196+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.4/lib/rails/application/finisher.rb:56:in `block in <module:Finisher>'
2015-09-15T05:32:26.719197+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.4/lib/rails/initializable.rb:30:in `instance_exec'
2015-09-15T05:32:26.719195+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.4/lib/rails/application/finisher.rb:56:in `each'
2015-09-15T05:32:26.719198+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.4/lib/rails/initializable.rb:30:in `run'
2015-09-15T05:32:26.719199+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.4/lib/rails/initializable.rb:55:in `block in run_initializers'
2015-09-15T05:32:26.719200+00:00 app[web.1]: from /app/vendor/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'
2015-09-15T05:32:26.719202+00:00 app[web.1]: from /app/vendor/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'
2015-09-15T05:32:26.719201+00:00 app[web.1]: from /app/vendor/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
2015-09-15T05:32:26.719204+00:00 app[web.1]: from /app/vendor/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'
2015-09-15T05:32:26.719205+00:00 app[web.1]: from /app/vendor/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:345:in `each'
2015-09-15T05:32:26.719207+00:00 app[web.1]: from /app/vendor/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'
2015-09-15T05:32:26.719206+00:00 app[web.1]: from /app/vendor/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:345:in `call'
2015-09-15T05:32:26.719210+00:00 app[web.1]: from /app/vendor/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'
2015-09-15T05:32:26.719211+00:00 app[web.1]: from /app/vendor/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each'
2015-09-15T05:32:26.719212+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.4/lib/rails/initializable.rb:54:in `run_initializers'
2015-09-15T05:32:26.719213+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.4/lib/rails/application.rb:352:in `initialize!'
2015-09-15T05:32:26.719215+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `require'
2015-09-15T05:32:26.719214+00:00 app[web.1]: from /app/config/environment.rb:5:in `<top (required)>'
2015-09-15T05:32:26.719216+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `block in require'
2015-09-15T05:32:26.719221+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `require'
2015-09-15T05:32:26.719222+00:00 app[web.1]: from /app/config.ru:3:in `block in <main>'
2015-09-15T05:32:26.719223+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `instance_eval'
2015-09-15T05:32:26.719224+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `initialize'
2015-09-15T05:32:26.719218+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:240:in `load_dependency'
2015-09-15T05:32:26.719227+00:00 app[web.1]: from /app/config.ru:in `new'
2015-09-15T05:32:26.719228+00:00 app[web.1]: from /app/config.ru:in `<main>'
2015-09-15T05:32:26.719229+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in `eval'
2015-09-15T05:32:26.719236+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/server.rb:299:in `build_app_and_options_from_config'
2015-09-15T05:32:26.719232+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in `new_from_string'
2015-09-15T05:32:26.719239+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/server.rb:208:in `app'
2015-09-15T05:32:26.719233+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:40:in `parse_file'
2015-09-15T05:32:26.719242+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.4/lib/rails/commands/server.rb:61:in `app'
2015-09-15T05:32:26.719246+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/server.rb:272:in `start'
2015-09-15T05:32:26.719243+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/server.rb:336:in `wrapped_app'
2015-09-15T05:32:26.719248+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.4/lib/rails/commands/server.rb:80:in `start'
2015-09-15T05:32:26.719251+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:80:in `block in server'
2015-09-15T05:32:26.719255+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:75:in `server'
2015-09-15T05:32:26.719254+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:75:in `tap'
2015-09-15T05:32:26.719258+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
2015-09-15T05:32:26.719263+00:00 app[web.1]: from bin/rails:8:in `require'
2015-09-15T05:32:26.719261+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.4/lib/rails/commands.rb:17:in `<top (required)>'
2015-09-15T05:32:26.719266+00:00 app[web.1]: from bin/rails:8:in `<main>'
2015-09-15T05:32:27.834264+00:00 heroku[web.1]: Process exited with status 1
2015-09-15T05:32:27.853661+00:00 heroku[web.1]: State changed from starting to crashed
2015-09-15T08:20:07.379945+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=motaprojectlive.herokuapp.com request_id=c8265c44-6398-44f4-ae08-a2077171ac55 fwd="46.27.166.60" dyno= connect= service= status=503 bytes=
2015-09-15T08:23:47.348699+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=motaprojectlive.herokuapp.com request_id=576b4f28-174f-4b1e-8700-5053fbf3323c fwd="46.27.166.60" dyno= connect= service= status=503 bytes=
2015-09-15T09:36:03.654458+00:00 heroku[api]: Starting process with command `rails console` by romenigld#gmail.com
2015-09-15T09:36:15.126378+00:00 heroku[run.3618]: Awaiting client
2015-09-15T09:36:15.162910+00:00 heroku[run.3618]: Starting process with command `rails console`
2015-09-15T09:36:15.516485+00:00 heroku[run.3618]: State changed from starting to up
2015-09-15T09:36:20.194081+00:00 heroku[run.3618]: State changed from up to complete
2015-09-15T09:36:20.183530+00:00 heroku[run.3618]: Process exited with status 1
2015-09-15T09:50:59.737668+00:00 heroku[api]: Starting process with command `rails console` by romenigld#gmail.com
2015-09-15T09:51:15.542149+00:00 heroku[run.1439]: Awaiting client
2015-09-15T09:51:15.750707+00:00 heroku[run.1439]: State changed from starting to up
2015-09-15T09:51:15.854508+00:00 heroku[run.1439]: Starting process with command `rails console`
2015-09-15T09:51:21.470332+00:00 heroku[run.1439]: State changed from up to complete
2015-09-15T09:51:21.462321+00:00 heroku[run.1439]: Process exited with status 1
2015-09-15T09:52:05.112988+00:00 heroku[slug-compiler]: Slug compilation started
2015-09-15T09:52:05.113010+00:00 heroku[slug-compiler]: Slug compilation error: slug archive could not be created
2015-09-15T10:15:15.727423+00:00 heroku[api]: Starting process with command `rails console` by romenigld#gmail.com
2015-09-15T10:15:26.853219+00:00 heroku[run.5541]: Awaiting client
2015-09-15T10:15:26.885072+00:00 heroku[run.5541]: Starting process with command `rails console`
2015-09-15T10:15:27.062819+00:00 heroku[run.5541]: State changed from starting to up
2015-09-15T10:15:31.889775+00:00 heroku[run.5541]: State changed from up to complete
2015-09-15T10:15:31.877044+00:00 heroku[run.5541]: Process exited with status 1
Your model is wrong.
These lines shouldn't be there.
column :name, :string
column :email, :string
column :content, :string
Just remove them, it should work.