Lokesh Lokesh - 2 months ago 6
Ruby Question

Getting error while running ruby script

I am trying to run a ruby script which is basically a Stomp client to make call to ActiveMQ broker.

When i run the script, i get this error:

going to startC:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:5
4:in `require': cannot load such file -- stomp (LoadError)
from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54
:in `require'
from C:/Users/lokesh.kumar/Documents/issues/ActiveMQ-slowness/activemq-c
acti-plugin.rb:34:in `<main>'


Following is the result of command
gem env


C:\Users\lokesh.kumar>gem env
RubyGems Environment:
- RUBYGEMS VERSION: 2.4.5.1
- RUBY VERSION: 2.2.5 (2016-04-26 patchlevel 319) [x64-mingw32]
- INSTALLATION DIRECTORY: C:/Ruby22-x64/lib/ruby/gems/2.2.0
- RUBY EXECUTABLE: C:/Ruby22-x64/bin/ruby.exe
- EXECUTABLE DIRECTORY: C:/Ruby22-x64/bin
- SPEC CACHE DIRECTORY: Z:/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: C:/ProgramData
- RUBYGEMS PLATFORMS:
- ruby
- x64-mingw32
- GEM PATHS:
- C:/Ruby22-x64/lib/ruby/gems/2.2.0
- Z:/.gem/ruby/2.2.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- C:\oracle\product\11.2.0\client_1\bin
- C:\Windows\system32
- C:\Windows
- C:\Windows\System32\Wbem
- C:\Windows\System32\WindowsPowerShell\v1.0\
- C:\Program Files\TortoiseHg\
- C:\Program Files\TortoiseSVN\bin
- C:\Program Files (x86)\Enterprise Vault\EVClient\
- C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static
- C:\Program Files (x86)\GitExtensions\
- C:\Program Files (x86)\AMD\ATI.ACE\Core-Static
- C:\Program Files (x86)\Skype\Phone\
- c:\Program Files\TortoiseGit\bin
- C:\Ruby22-x64\bin
- C:\Users\lokesh.kumar\.babun
- D:\Installations\apache-maven-3.2.5\bin
- C:\Program Files\Java\jdk1.8.0_91\bin


I have never worked in Ruby, so it might be a basic installation mistake. Any pointers to resolve this?

Answer

Seems like you don't have stomp gem installed.
You can install any gem you want with gem install GEMNAME.

In your particular case GEMNAME is stomp.
So try to run gem install stomp and run your script once again.

P.S.
By default gem install command uses rubygems as gem source.
So you can always check out gem names here.