Q: Using Appium with Ruby I get: ERROR: Unable to connect to Appium. Is the server running? (RuntimeError) I have the appium.dmg client running with:    
Server Address: 127.0.0.1
Port: 4723
but Im Receiving the following error after attempting to run my Ruby Appium script
/Users/tboland/.rbenv/shims/bundle exec /Users/tboland/.rbenv/versions/2.3.1/bin/ruby -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /Users/tboland/RubymineProjects/AppiumProject/FirstScript/launch_safari_on_ios_device.rb
/Users/tboland/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/appium_lib-8.0.2/lib/appium_lib/driver.rb:492:inrescue in start_driver': ERROR: Unable to connect to Appium. Is the server running? (RuntimeError)
    from /Users/tboland/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/appium_lib-8.0.2/lib/appium_lib/driver.rb:477:in ``start_driver'
    from /Users/tboland/RubymineProjects/AppiumProject/FirstScript/launch_safari_on_ios_device.rb:24:in <top (required)>'
    from -e:1:inload'
    from -e:1:in `'
Process finished with exit code 1`
Here is the Ruby code:
Gemfile:
`source 'http://rubygems.org'
gem 'appium_lib'
gem 'appium_console' 
gem 'selenium-webdriver'`
launch_safari_on_ios_device.rb
`require 'rubygems'
require 'appium_lib'
require 'selenium-webdriver'
Defining Desired Capabilities for the Driver
desired_capabilities = {
caps: {

    platformName: 'iOS',
    platformVersion: '9.3',
    browserName: 'safari',
    #iPod Touch
    deviceName: 'aaaa',
    udid:'#####'
}

}
Create appium driver
@driver = Appium::Driver.new(desired_capabilities).start_driver
sleep 5
@driver.get "http://androidsdet.blogspot.com"`

A: You need to have an Appium server up and running waiting for your test to connect. This could be in your own localhost or alternatively on some remote server or cloud service.
The Appium ruby client sets the server to use your localhost by default, unless you provide SauceLabs user details. For other use cases, you will need to provide a value to the server_url variable to target a specific server or service.
For Appium webdriver the values such as server_url need to be provided within appium_lib. See the simple_test.rb example from Appium's sample-code page: https://github.com/appium/sample-code/blob/master/sample-code/examples/ruby/simple_test.rb#L36
With Selenium Webdriver, the init of the webdriver could look like this:
@driver = Selenium::WebDriver.for(:remote, :desired_capabilities => desired_capabilities, :url => server_url, :http_client => http_client)

To see how to set up your own Appium server to your localhost, please refer to Appium's README at https://github.com/appium/appium

A: Its because you have appium already running and are trying to start another session using the same port. 
Use the command killall node on terminal and then run Appium again
