Gem environment for running rb-libsvm

I was hoping someone could clarify this really simply question about using gem tools that I had.

I am trying to run some code that uses rb-libsvm, and I successfully installed this using gem install; when I use gem list, rb-libsvm is listed. However, in the code, the command ./svm-predict throws the following errors:

  • Startup redmine 1.2 fail
  • I can not extract data from an embedded PDF (Ruby)
  • Adding Preview Thumbnails in jwplayer, how to generate vtt file in rails and how to integrate in my rails jwplayer
  • Ruby net-dns reverse lookups
  • Stomp ruby gem does not publish on dead letter exchange queue Rabbitmq
  • What the difference between mysql and ruby-mysql gem
  • sh: ./svm-train: No such file or directory
    sh: ./svm-predict: No such file or directory

    Is there something else I need to get the gem working on my computer?

  • Rails - Devise Installation (Succeds/Works on site but files don't exist)
  • Can I have a different workflow when using nested_form?
  • Error while pushing gem to rubygems (Psych::SyntaxError)
  • How to install rubyracer gem on 10.10.3 OSX
  • Can't resolve (too many redirects)
  • Looking for a gem that simplifies rewriting in Rails
  • 2 Solutions collect form web for “Gem environment for running rb-libsvm”

    I am not sure how you are running it on shell, you can test it in irb by following sample code from provided in the documentation from

    require 'libsvm'
    # This library is namespaced.
    problem =
    parameter =
    parameter.cache_size = 1 # in megabytes
    parameter.eps = 0.001
    parameter.c = 10
    examples = [ [1,0,1], [-1,0,-1] ].map {|ary| Libsvm::Node.features(ary) }
    labels = [1, -1]
    problem.set_examples(labels, examples)
    model = Libsvm::Model.train(problem, parameter)
    pred = model.predict(Libsvm::Node.features(1, 1, 1))
    puts "Example [1, 1, 1] - Predicted #{pred}"

    The gem doesn’t include the command line tools. Please see the README.

    For that, consider installing the whole package. Despite the name libsvm, it’s actually a package with command line tools and Python bindings, alongside the library proper.

    Ruby is the best programming language in the world - Ruby on Rails.