Appium Capybara mobile automation on andriod physical device connection unstable

we are working on mobile automation using Appium & Capybara on physical device

Although our code is working, issue is with stability, it fails 4 in 10 times below are the details and log attached

when i run the code, most of the time Appium log says that device is not online and after retry from Appium, device is online but by then my automation fails.

> info: --> POST /wd/hub/session {"desiredCapabilities":{"platformName":"Android","platformVersion":"4.3","deviceName":"Achyuth","browserName":"chrome"}}
> info: Client User-Agent string: Ruby
> info: Set mode: Proxying straight through to Chromedriver
> info: [debug] Looks like we want chrome on android
> info: [debug] Creating new appium session c556660a-a5eb-4421-a91c-d9caac1f967a
> info: [debug] Checking whether adb is present
> info: [debug] Using adb from C:\Projects\process\mobile\android-sdk-windows\platform-tools\adb.exe
> info: [debug] Using fast reset? true
> info: [debug] Preparing device for session
> info: [debug] Not checking whether app is present since we are assuming it's already on the device
> info: Retrieving device
> info: [debug] Trying to find a connected android device
> info: [debug] Getting connected devices...
> info: [debug] executing cmd: C:\Projects\process\mobile\android-sdk-windows\platform-tools\adb.exe devices
> info: [debug] 1 device(s) connected
> info: Found device 42f74d186fe79f8b
> info: [debug] Setting device id to 42f74d186fe79f8b
> info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
> info: [debug] executing cmd: C:\Projects\process\mobile\android-sdk-windows\platform-tools\adb.exe -s 42f74d186fe79f8b wait-for-device
> info: [debug] executing cmd: C:\Projects\process\mobile\android-sdk-windows\platform-tools\adb.exe -s 42f74d186fe79f8b shell "echo 'ready'"
> info: [debug] Starting logcat capture
> info: [debug] Pushing unlock helper app to device...
> info: [debug] executing cmd: C:\Projects\process\mobile\android-sdk-windows\platform-tools\adb.exe -s 42f74d186fe79f8b install "C:\Projects\process\mobile\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk"
> info: [debug] executing cmd: C:\Projects\process\mobile\android-sdk-windows\platform-tools\adb.exe -s 42f74d186fe79f8b shell "dumpsys window"
> info: [debug] Screen already unlocked, continuing.
> info: [debug] Forwarding system:4724 to device:4724
> info: [debug] executing cmd: C:\Projects\process\mobile\android-sdk-windows\platform-tools\adb.exe -s 42f74d186fe79f8b forward tcp:4724 tcp:4724
> info: [debug] Pushing appium bootstrap to device...
> info: [debug] executing cmd: C:\Projects\process\mobile\android-sdk-windows\platform-tools\adb.exe -s 42f74d186fe79f8b push "C:\\Projects\\process\\mobile\\Appium\\node_modules\\appium\\build\\android_bootstrap\\AppiumBootstrap.jar" /data/local/tmp/
> info: Starting App
> info: [debug] Attempting to kill all 'uiautomator' processes
> info: [debug] Getting all processes with 'uiautomator'
> info: [debug] executing cmd: C:\Projects\process\mobile\android-sdk-windows\platform-tools\adb.exe -s 42f74d186fe79f8b shell "ps 'uiautomator'"
> info: [debug] No matching processes found
> info: [debug] Running bootstrap
> info: [debug] spawning: C:\Projects\process\mobile\android-sdk-windows\platform-tools\adb.exe -s 42f74d186fe79f8b shell uiautomator runtest AppiumBootstrap.jar -c io.appium.android.bootstrap.Bootstrap -e pkg com.android.chrome -e disableAndroidWatchers false
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
> info: [debug] [UIAUTOMATOR STDOUT] io.appium.android.bootstrap.Bootstrap:
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 1
> info: [debug] [BOOTSTRAP] [debug] Socket opened on port 4724
> info: [debug] [BOOTSTRAP] [debug] Appium Socket Server Ready
> info: [debug] [BOOTSTRAP] [debug] Loading json...
> info: [debug] [BOOTSTRAP] [debug] Registered crash watchers.
> info: [debug] Pushing command to appium work queue: ["getDataDir",{}]
> info: [debug] [BOOTSTRAP] [debug] Client connected
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"getDataDir","params":{}}
> info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
> info: [debug] [BOOTSTRAP] [debug] Got command action: getDataDir
> info: [debug] dataDir set to: /data/local/tmp
> info: Chromedriver: Changed state to 'starting'
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":"\/data\/local\/tmp","status":0}
> info: Chromedriver: Set chromedriver binary as: C:\Projects\process\mobile\Appium\node_modules\appium\node_modules\appium-chromedriver\chromedriver\win\chromedriver.exe
> info: Chromedriver: Killing any old chromedrivers, running: FOR /F "usebackq tokens=5" %a in (`netstat -nao ^| findstr /R /C:"9515 "`) do (FOR /F "usebackq" %b in (`TASKLIST /FI "PID eq %a" ^| findstr /I chromedriver.exe`) do (IF NOT %b=="" TASKKILL /F /PID %a))
> info: Chromedriver: No old chromedrivers seemed to exist
> info: Chromedriver: Spawning chromedriver with: C:\Projects\process\mobile\Appium\node_modules\appium\node_modules\appium-chromedriver\chromedriver\win\chromedriver.exe --url-base=wd/hub --port=9515
> info: Chromedriver: [STDOUT] Starting ChromeDriver 2.18.343845 (73dd713ba7fbfb73cbb514e62641d8c96a94682a) on port 9515
> Only local connections are allowed.
> info: JSONWP Proxy: Proxying [GET /status] to [GET http://127.0.0.1:9515/wd/hub/status] with no body
> info: JSONWP Proxy: Got response with status 200: "{\"sessionId\":\"\",\"status\":0,\"value\":{\"build\":{\"version\":\"alpha\"},\"os\":{\"arch\":\"x86_64\",\"name\":\"Windows NT\",\"version\":\"6.1 SP1\"}}}"
> info: JSONWP Proxy: Proxying [POST /session] to [POST http://127.0.0.1:9515/wd/hub/session] with body: {"desiredCapabilities":{"chromeOptions":{"androidPackage":"com.android.chrome","androidDeviceSerial":"42f74d186fe79f8b"}}}
> info: JSONWP Proxy: Got response with status 200: {"sessionId":"ada5c000c4922658f0fcf63b7036ce4b","status":13,"value":{"message":"unknown error: Device 42f74d186fe79f8b is not online\n  (Driver info: chromedriver=2.18.343845 (73dd713ba7fbfb73cbb51...
> info: JSONWP Proxy: Proxying [POST /session] to [POST http://127.0.0.1:9515/wd/hub/session] with body: {"desiredCapabilities":{"chromeOptions":{"androidPackage":"com.android.chrome","androidDeviceSerial":"42f74d186fe79f8b"}}}
> info: JSONWP Proxy: Got response with status 200: {"sessionId":"438697107eb380c6a93d42dda404d71d","status":13,"value":{"message":"unknown error: Device 42f74d186fe79f8b is not online\n  (Driver info: chromedriver=2.18.343845 (73dd713ba7fbfb73cbb51...
> info: JSONWP Proxy: Proxying [POST /session] to [POST http://127.0.0.1:9515/wd/hub/session] with body: {"desiredCapabilities":{"chromeOptions":{"androidPackage":"com.android.chrome","androidDeviceSerial":"42f74d186fe79f8b"}}}
> info: JSONWP Proxy: Got response with status 200: {"sessionId":"39a5b91f404c167110e7afb357599fb1","status":13,"value":{"message":"unknown error: Device 42f74d186fe79f8b is not online\n  (Driver info: chromedriver=2.18.343845 (73dd713ba7fbfb73cbb51...
> info: JSONWP Proxy: Proxying [POST /session] to [POST http://127.0.0.1:9515/wd/hub/session] with body: {"desiredCapabilities":{"chromeOptions":{"androidPackage":"com.android.chrome","androidDeviceSerial":"42f74d186fe79f8b"}}}
> info: JSONWP Proxy: Got response with status 200: {"sessionId":"612e169640e516d7eec9feb7bd41d9f4","status":13,"value":{"message":"unknown error: Device 42f74d186fe79f8b is not online\n  (Driver info: chromedriver=2.18.343845 (73dd713ba7fbfb73cbb51...
> error: Chromedriver: Chromedriver exited unexpectedly with code null, signal SIGTERM
> info: Chromedriver: Changed state to 'stopped'
> info: Chromedriver stopped unexpectedly on us, shutting down then calling back up with the on-die callback
> error: Chromedriver: Error: An unknown server-side error occurred while processing the command. (Original error: unknown error: Device 42f74d186fe79f8b is not online
>   (Driver info: chromedriver=2.18.343845 (73dd713ba7fbfb73cbb514e62641d8c96a94682a),platform=Windows NT 6.1 SP1 x86_64))
>     at JWProxy.command$ (lib/proxy.js:133:15)
>     at tryCatch (C:\Projects\process\mobile\Appium\node_modules\appium\node_modules\appium-chromedriver\node_modules\appium-jsonwp-proxy\node_modules\babel-runtime\regenerator\runtime.js:67:40)
>     at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Projects\process\mobile\Appium\node_modules\appium\node_modules\appium-chromedriver\node_modules\appium-jsonwp-proxy\node_modules\babel-runtime\regenerator\runtime.js:315:22)
>     at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (C:\Projects\process\mobile\Appium\node_modules\appium\node_modules\appium-chromedriver\node_modules\appium-jsonwp-proxy\node_modules\babel-runtime\regenerator\runtime.js:100:21)
>     at GeneratorFunctionPrototype.invoke (C:\Projects\process\mobile\Appium\node_modules\appium\node_modules\appium-chromedriver\node_modules\appium-jsonwp-proxy\node_modules\babel-runtime\regenerator\runtime.js:136:37)
>     at bound (domain.js:284:14)
>     at GeneratorFunctionPrototype.runBound (domain.js:297:12)
>     at run (C:\Projects\process\mobile\Appium\node_modules\appium\node_modules\appium-chromedriver\node_modules\appium-jsonwp-proxy\node_modules\babel-runtime\node_modules\core-js\library\modules\es6.promise.js:89:39)
>     at C:\Projects\process\mobile\Appium\node_modules\appium\node_modules\appium-chromedriver\node_modules\appium-jsonwp-proxy\node_modules\babel-runtime\node_modules\core-js\library\modules\es6.promise.js:100:28
>     at flush (C:\Projects\process\mobile\Appium\node_modules\appium\node_modules\appium-chromedriver\node_modules\appium-jsonwp-proxy\node_modules\babel-runtime\node_modules\core-js\library\modules\$.microtask.js:17:13)
>     at process._tickDomainCallback (node.js:381:11)
>  { [Error: An unknown server-side error occurred while processing the command. (Original error: unknown error: Device 42f74d186fe79f8b is not online
>   (Driver info: chromedriver=2.18.343845 (73dd713ba7fbfb73cbb514e62641d8c96a94682a),platform=Windows NT 6.1 SP1 x86_64))]
>   status: 13,
>   value: { message: 'unknown error: Device 42f74d186fe79f8b is not online\n  (Driver info: chromedriver=2.18.343845 (73dd713ba7fbfb73cbb514e62641d8c96a94682a),platform=Windows NT 6.1 SP1 x86_64)' },
>   httpCode: 200 }
> error: Failed to start an Appium session, err was: Error: An unknown server-side error occurred while processing the command. (Original error: unknown error: Device 42f74d186fe79f8b is not online
>   (Driver info: chromedriver=2.18.343845 (73dd713ba7fbfb73cbb514e62641d8c96a94682a),platform=Windows NT 6.1 SP1 x86_64))
> info: [debug] Cleaning up appium session
> info: [debug] Error: An unknown server-side error occurred while processing the command. (Original error: unknown error: Device 42f74d186fe79f8b is not online
>   (Driver info: chromedriver=2.18.343845 (73dd713ba7fbfb73cbb514e62641d8c96a94682a),platform=Windows NT 6.1 SP1 x86_64))
>     at JWProxy.command$ (lib/proxy.js:133:15)
>     at tryCatch (C:\Projects\process\mobile\Appium\node_modules\appium\node_modules\appium-chromedriver\node_modules\appium-jsonwp-proxy\node_modules\babel-runtime\regenerator\runtime.js:67:40)
>     at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Projects\process\mobile\Appium\node_modules\appium\node_modules\appium-chromedriver\node_modules\appium-jsonwp-proxy\node_modules\babel-runtime\regenerator\runtime.js:315:22)
>     at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (C:\Projects\process\mobile\Appium\node_modules\appium\node_modules\appium-chromedriver\node_modules\appium-jsonwp-proxy\node_modules\babel-runtime\regenerator\runtime.js:100:21)
>     at GeneratorFunctionPrototype.invoke (C:\Projects\process\mobile\Appium\node_modules\appium\node_modules\appium-chromedriver\node_modules\appium-jsonwp-proxy\node_modules\babel-runtime\regenerator\runtime.js:136:37)
>     at bound (domain.js:284:14)
>     at GeneratorFunctionPrototype.runBound (domain.js:297:12)
>     at run (C:\Projects\process\mobile\Appium\node_modules\appium\node_modules\appium-chromedriver\node_modules\appium-jsonwp-proxy\node_modules\babel-runtime\node_modules\core-js\library\modules\es6.promise.js:89:39)
>     at C:\Projects\process\mobile\Appium\node_modules\appium\node_modules\appium-chromedriver\node_modules\appium-jsonwp-proxy\node_modules\babel-runtime\node_modules\core-js\library\modules\es6.promise.js:100:28
>     at flush (C:\Projects\process\mobile\Appium\node_modules\appium\node_modules\appium-chromedriver\node_modules\appium-jsonwp-proxy\node_modules\babel-runtime\node_modules\core-js\library\modules\$.microtask.js:17:13)
>     at process._tickDomainCallback (node.js:381:11)
> info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: An unknown server-side error occurred while processing the command. (Original error: unknown error: Device 42f74d186fe79f8b is not online\n  (Driver info: chromedriver=2.18.343845 (73dd713ba7fbfb73cbb514e62641d8c96a94682a),platform=Windows NT 6.1 SP1 x86_64)))","status":13,"value":{"message":"unknown error: Device 42f74d186fe79f8b is not online\n  (Driver info: chromedriver=2.18.343845 (73dd713ba7fbfb73cbb514e62641d8c96a94682a),platform=Windows NT 6.1 SP1 x86_64)"},"httpCode":200,"origValue":"An unknown server-side error occurred while processing the command. (Original error: unknown error: Device 42f74d186fe79f8b is not online\n  (Driver info: chromedriver=2.18.343845 (73dd713ba7fbfb73cbb514e62641d8c96a94682a),platform=Windows NT 6.1 SP1 x86_64))"},"sessionId":null}
> info: <-- POST /wd/hub/session 500 8585.337 ms - 863 
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"shutdown"}
> info: [debug] [BOOTSTRAP] [debug] Got command of type SHUTDOWN
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":"OK, shutting down","status":0}
> info: [debug] Sent shutdown command, waiting for UiAutomator to stop...
> info: [debug] [BOOTSTRAP] [debug] Closed client connection
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=.
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 0
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
> info: [debug] [UIAUTOMATOR STDOUT] Test results for WatcherResultPrinter=.
> info: [debug] [UIAUTOMATOR STDOUT] Time: 2.03
> info: [debug] [UIAUTOMATOR STDOUT] OK (1 test)
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: -1
> info: [debug] UiAutomator shut down normally
> info: [debug] executing cmd: C:\Projects\process\mobile\android-sdk-windows\platform-tools\adb.exe -s 42f74d186fe79f8b shell "am force-stop com.android.chrome"
> info: --> POST /wd/hub/session {"desiredCapabilities":{"platformName":"Android","platformVersion":"4.3","deviceName":"Achyuth","browserName":"chrome"}}
> info: Client User-Agent string: Ruby
> info: Set mode: Proxying straight through to Chromedriver
> info: [debug] Looks like we want chrome on android
> info: [debug] Creating new appium session b5b2a524-792d-497b-8522-60957772fda3
> info: [debug] Checking whether adb is present
> info: [debug] Using adb from C:\Projects\process\mobile\android-sdk-windows\platform-tools\adb.exe
> info: [debug] Using fast reset? true
> info: [debug] Preparing device for session
> info: [debug] Not checking whether app is present since we are assuming it's already on the device
> info: Retrieving device
> info: [debug] Trying to find a connected android device
> info: [debug] Getting connected devices...
> info: [debug] executing cmd: C:\Projects\process\mobile\android-sdk-windows\platform-tools\adb.exe devices
> info: [debug] 1 device(s) connected
> info: Found device 42f74d186fe79f8b
> info: [debug] Setting device id to 42f74d186fe79f8b
> info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
> info: [debug] executing cmd: C:\Projects\process\mobile\android-sdk-windows\platform-tools\adb.exe -s 42f74d186fe79f8b wait-for-device
> info: [debug] executing cmd: C:\Projects\process\mobile\android-sdk-windows\platform-tools\adb.exe -s 42f74d186fe79f8b shell "echo 'ready'"
> info: [debug] Starting logcat capture
> info: [debug] Pushing unlock helper app to device...
> info: [debug] executing cmd: C:\Projects\process\mobile\android-sdk-windows\platform-tools\adb.exe -s 42f74d186fe79f8b install "C:\Projects\process\mobile\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk"
> info: [debug] Stopping logcat capture
> info: [debug] Logcat terminated with code null, signal SIGTERM
> info: [debug] Cleaning up appium session
> info: [debug] executing cmd: C:\Projects\process\mobile\android-sdk-windows\platform-tools\adb.exe -s 42f74d186fe79f8b shell "dumpsys window"
> info: [debug] Screen already unlocked, continuing.
> info: [debug] Forwarding system:4724 to device:4724
> info: [debug] executing cmd: C:\Projects\process\mobile\android-sdk-windows\platform-tools\adb.exe -s 42f74d186fe79f8b forward tcp:4724 tcp:4724
> info: [debug] Pushing appium bootstrap to device...
> info: [debug] executing cmd: C:\Projects\process\mobile\android-sdk-windows\platform-tools\adb.exe -s 42f74d186fe79f8b push "C:\\Projects\\process\\mobile\\Appium\\node_modules\\appium\\build\\android_bootstrap\\AppiumBootstrap.jar" /data/local/tmp/
> info: Starting App
> info: [debug] Attempting to kill all 'uiautomator' processes
> info: [debug] Getting all processes with 'uiautomator'
> info: [debug] executing cmd: C:\Projects\process\mobile\android-sdk-windows\platform-tools\adb.exe -s 42f74d186fe79f8b shell "ps 'uiautomator'"
> info: [debug] No matching processes found
> info: [debug] Running bootstrap
> info: [debug] spawning: C:\Projects\process\mobile\android-sdk-windows\platform-tools\adb.exe -s 42f74d186fe79f8b shell uiautomator runtest AppiumBootstrap.jar -c io.appium.android.bootstrap.Bootstrap -e pkg com.android.chrome -e disableAndroidWatchers false
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
> info: [debug] [UIAUTOMATOR STDOUT] io.appium.android.bootstrap.Bootstrap:
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 1
> info: [debug] [BOOTSTRAP] [debug] Socket opened on port 4724
> info: [debug] [BOOTSTRAP] [debug] Appium Socket Server Ready
> info: [debug] [BOOTSTRAP] [debug] Loading json...
> info: [debug] Pushing command to appium work queue: ["getDataDir",{}]
> info: [debug] [BOOTSTRAP] [debug] Registered crash watchers.
> info: [debug] [BOOTSTRAP] [debug] Client connected
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"getDataDir","params":{}}
> info: [debug] dataDir set to: /data/local/tmp
> info: Chromedriver: Changed state to 'starting'
> info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
> info: [debug] [BOOTSTRAP] [debug] Got command action: getDataDir
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":"\/data\/local\/tmp","status":0}
> info: Chromedriver: Set chromedriver binary as: C:\Projects\process\mobile\Appium\node_modules\appium\node_modules\appium-chromedriver\chromedriver\win\chromedriver.exe
> info: Chromedriver: Killing any old chromedrivers, running: FOR /F "usebackq tokens=5" %a in (`netstat -nao ^| findstr /R /C:"9515 "`) do (FOR /F "usebackq" %b in (`TASKLIST /FI "PID eq %a" ^| findstr /I chromedriver.exe`) do (IF NOT %b=="" TASKKILL /F /PID %a))
> info: Chromedriver: No old chromedrivers seemed to exist
> info: Chromedriver: Spawning chromedriver with: C:\Projects\process\mobile\Appium\node_modules\appium\node_modules\appium-chromedriver\chromedriver\win\chromedriver.exe --url-base=wd/hub --port=9515
> info: Chromedriver: [STDOUT] Starting ChromeDriver 2.18.343845 (73dd713ba7fbfb73cbb514e62641d8c96a94682a) on port 9515
> Only local connections are allowed.
> info: JSONWP Proxy: Proxying [GET /status] to [GET http://127.0.0.1:9515/wd/hub/status] with no body
> info: JSONWP Proxy: Got response with status 200: "{\"sessionId\":\"\",\"status\":0,\"value\":{\"build\":{\"version\":\"alpha\"},\"os\":{\"arch\":\"x86_64\",\"name\":\"Windows NT\",\"version\":\"6.1 SP1\"}}}"
> info: JSONWP Proxy: Proxying [POST /session] to [POST http://127.0.0.1:9515/wd/hub/session] with body: {"desiredCapabilities":{"chromeOptions":{"androidPackage":"com.android.chrome","androidDeviceSerial":"42f74d186fe79f8b"}}}
> info: JSONWP Proxy: Got response with status 200: {"sessionId":"b60caca97c18f7fda779c67865db496f","status":0,"value":{"acceptSslCerts":true,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"browserName":"chrome","chrome":{},"cssSel...
> info: Chromedriver: Changed state to 'online'
> info: [debug] Overriding session id with "b60caca97c18f7fda779c67865db496f"
> info: [debug] Device launched! Ready for commands
> info: [debug] Setting command timeout to the default of 60 secs
> info: [debug] Appium session started with sessionId b60caca97c18f7fda779c67865db496f
> info: <-- POST /wd/hub/session 303 22468.245 ms - 70 
> info: --> GET /wd/hub/session/b60caca97c18f7fda779c67865db496f {}
> info: <-- GET /wd/hub/session/b60caca97c18f7fda779c67865db496f 404 4.041 ms - 40

capybara code

Capybara.default_driver = :selenium
#Capybara.javascript_driver = :poltergeist
Capybara.default_wait_time = 180
Capybara.register_driver :appium do |app|
    capabilities = {:platformName => 'Android', :platformVersion => '4.3', :deviceName=> '42f74d186fe79f8b', :browserName => 'chrome'}
Capybara::Selenium::Driver.new(app,
                                 :browser => :remote,
                                 :desired_capabilities => capabilities,
                                 :url => "http://127.0.0.1:4723/wd/hub")
end

Any help on this would be appreciated