title: `require': cannot load such file -- curses (LoadError)
body: <p>I am a ruby beginner and trying to understand and learn ruby. I came across this error while trying to run a ruby file which uses "require curses" but I am getting the following error while doing so. Any help or hint is appreciated.</p>
  
  <pre><code>desktop$ ruby curses.rb 
  /desktop/jsipp-master$ gem list
  
  *** LOCAL GEMS ***
  
  bigdecimal (1.2.8)
  CFPropertyList (2.2.8)
  curses (1.2.4)
  did_you_mean (1.0.0)
  enumerate (0.0.7)
  enumerated (1.0.1)
  enumeration (1.3.3)
  ffi (1.9.25)
  ffi-rzmq (2.0.6)
  ffi-rzmq-core (1.0.6)
  io-console (0.4.5)
  json (1.8.3)
  libxml-ruby (2.9.0)
  minitest (5.8.5)
  net-telnet (0.1.1)
  nokogiri (1.5.6)
  power_assert (0.2.6)
  psych (2.1.0)
  rake (10.4.2)
  rdoc (4.2.1)
  sqlite3 (1.3.11)
  test-unit (3.1.5)
  
  /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- curses (LoadError)
      from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
      from curses.rb:3:in `&lt;main&gt;'
  
     jsipp-master$ ruby -v
  ruby 2.3.3p222 (2016-11-21 revision 56859) [universal.x86_64-darwin17]
  
  #!/usr/bin/ruby
  
  require 'curses'
  require 'ffi-rzmq'
  require 'enumerator'
  
  POSITIONS = "%15s %8s %8s %12s %12s %12s\n"
  POSITIONS2 = "%-38s %-38s\n"
  POSITIONS3 = "%15s %-12s%%-10s%%-10s%%-10s%%-15s\n"
  
  OUT_ARROW = "--------&gt;"
  IN_ARROW = "&lt;--------"
  PAUSE =    "[%6dms]"
  
  class MinuteLongBuffer
    def initialize
      @values = []
    end
  
    def add v
      @values &lt;&lt; [Time.new.to_f, v]
    end
  
    def count
      @values = @values.keep_if {|v| v[0] &gt; (Time.new.to_f - 1)}
      @values.length
    end
  end
  
  class Scenario
    def parse_scenario_desc desc
      @strings = []
      @msg_counts = []
      parts = desc.split(";")
      parts.each do |part|
        type, value = part.split(":")
        if type == "IN"
          @strings &lt;&lt; (POSITIONS3 % [value, IN_ARROW])
        elsif type == "OUT"
          @strings &lt;&lt; (POSITIONS3 % [value, OUT_ARROW])
        elsif type == "PAUSE"
          @strings &lt;&lt; (POSITIONS3 % [(PAUSE % value), ""])
        end
        @msg_counts &lt;&lt; 0
        @unexpected_msg_counts &lt;&lt; 0
        @timeout_counts &lt;&lt; 0
      end
    end
  
    def inc_msg idx
      @msg_counts[idx.to_i] += 1
      if idx.to_i == 0
        @new_calls.add 1
      end
    end
  
    def inc_unexpected idx
      @unexpected_msg_counts[idx.to_i] += 1
    end
  
    def inc_timeout idx
      @timeout_counts[idx.to_i] += 1
    end
  
    def update
      Curses.clear
      Curses.addstr(POSITIONS % ["Call-rate", "Length", "Port", "Total-time", "Total-calls", "Remote-host"])
      Curses.addstr(POSITIONS % [("?cps"), "? ms", "????", ("%.2fs" % (Time.new.to_f - @start)), "?", "??? (???)"])
      Curses.addstr("\n")
      Curses.addstr(POSITIONS2 % ["%d new calls during 1.000s period" % @new_calls.count, "?ms scheduler resolution"])
      Curses.addstr(POSITIONS2 % ["? concurrent calls (limit ?)", "Peak was ? calls, after ?s"])
      Curses.addstr(POSITIONS2 % ["? out-of-call msg (discarded)", "? open sockets"])
      Curses.addstr("\n")
      Curses.addstr((POSITIONS3 % ["", "",]) % ["Messages", "Retrans", "Timeout", "Unexpected-Msg"])
      @strings.each_with_index do |s, i|
        Curses.addstr(s % [@msg_counts[i], 0, @timeout_counts[i], @unexpected_msg_counts[i]])
      end
      Curses.refresh
    end
  
    def initialize
      @new_calls = MinuteLongBuffer.new
      @strings = []
      @msg_counts = []
      @unexpected_msg_counts = []
      @timeout_counts = []
      @start = Time.new.to_f
  
      Thread.new do
        context = ZMQ::Context.new
        socket = context.socket(ZMQ::SUB)
        socket.connect("tcp://localhost:5556")
        socket.setsockopt(ZMQ::SUBSCRIBE, "SIPP")
  
        socket2 = context.socket(ZMQ::REQ)
        socket2.connect("tcp://localhost:5557")
        socket2.send_string "",0
        socket2.recv_string msg2 = ""
        parse_scenario_desc msg2
        loop do
          socket.recv_strings(msgs = [])
          msgs.each do |msg|
          name, ts, scenario, callnum, callid, idx, result = msg.split(":")
          if name == "SIPP-PHASE_SUCCESS"
            inc_msg idx
          end
          if name == "SIPP-UNEXPECTED_MSG_RECVD"
            inc_unexpected idx
          end
          if name == "SIPP-RECV_TIMED_OUT"
            inc_timeout idx
          end
        end
        end
      end
    end
  end
  
  SCENARIO = Scenario.new
  
  Curses.init_screen()
  
  Thread.new do
    loop do
      tmp = Curses.getch
    end
  end
  
  loop do
    SCENARIO.update
    sleep 1
  end
  </code></pre>
  
  <p>Also when I check the ruby version it is pointing to 2.3.3 but while running the it shows me ruby 2.3.0 running the file. If someone could explain why is that would also help me.
  After installing gems in file manually I am getting another error please see below.</p>
  
  <pre><code>/jsipp-master$ ruby curses.rb
  Unable to load this gem. The libzmq library (or DLL) could not be found.
  If this is a Windows platform, make sure libzmq.dll is on the PATH.
  If the DLL was built with mingw, make sure the other two dependent DLLs,
  libgcc_s_sjlj-1.dll and libstdc++6.dll, are also on the PATH.
  For non-Windows platforms, make sure libzmq is located in this search path:
  ["/Library/Ruby/Gems/2.3.0/gems/ffi-rzmq-core-1.0.6/lib/ffi-rzmq-core/../../ext/libzmq.dylib", "/usr/local/bin/libzmq.dylib", "/usr/bin/libzmq.dylib", "/bin/libzmq.dylib", "/usr/sbin/libzmq.dylib", "/sbin/libzmq.dylib", "/opt/X11/bin/libzmq.dylib", "/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/libzmq.dylib", "/usr/local/lib/libzmq.dylib", "/opt/local/lib/libzmq.dylib", "/usr/local/lib/libzmq.dylib", "/usr/lib64/libzmq.dylib"]
  /Library/Ruby/Gems/2.3.0/gems/ffi-rzmq-core-1.0.6/lib/ffi-rzmq-core/libzmq.rb:61:in `rescue in &lt;module:LibZMQ&gt;': The libzmq library (or DLL) could not be loaded (LoadError)
      from /Library/Ruby/Gems/2.3.0/gems/ffi-rzmq-core-1.0.6/lib/ffi-rzmq-core/libzmq.rb:10:in `&lt;module:LibZMQ&gt;'
      from /Library/Ruby/Gems/2.3.0/gems/ffi-rzmq-core-1.0.6/lib/ffi-rzmq-core/libzmq.rb:7:in `&lt;top (required)&gt;'
      from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
      from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
      from /Library/Ruby/Gems/2.3.0/gems/ffi-rzmq-core-1.0.6/lib/ffi-rzmq-core.rb:3:in `&lt;top (required)&gt;'
      from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
      from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
      from /Library/Ruby/Gems/2.3.0/gems/ffi-rzmq-2.0.6/lib/ffi-rzmq.rb:66:in `&lt;top (required)&gt;'
      from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `require'
      from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `rescue in require'
      from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:40:in `require'
      from curses.rb:4:in `&lt;main&gt;'
  </code></pre>