rb-libsvm icon indicating copy to clipboard operation
rb-libsvm copied to clipboard

require 'libsvm' fails (MS windows)

Open jeppevb opened this issue 13 years ago • 12 comments

I've installed ruby, devkit and rubygems and sucessfully installed the rb-libsvm gem. When I try to run the examples or go require 'libsvm' in irb i get this:

C:\dev>ruby
require 'libsvm'
^Z
c:/dev/ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': 193: %1 is not a valid Win32 application.   - c:/dev/ruby193/lib/ruby/gems/1.9.1/gems/rb-libsvm-1.0.8/lib/libsvm/libsvm_ext.so (LoadError)
        from c:/dev/ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from c:/dev/ruby193/lib/ruby/gems/1.9.1/gems/rb-libsvm-1.0.8/lib/libsvm.rb:2:in `'
        from c:/dev/ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `require'
        from c:/dev/ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
        from c:/dev/ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
        from -:1:in `
'

jeppevb avatar Sep 06 '12 18:09 jeppevb

I don't have access to a Windows machine, so I can't really help. Patches would be welcome.

febeling avatar Sep 06 '12 19:09 febeling

I'll look into it. I suppose the module does not compile properly for windows.

On 6 September 2012 21:52, Florian Ebeling [email protected] wrote:

I don't have access to a Windows machine, so I can't really help. Patches would be welcome.

— Reply to this email directly or view it on GitHubhttps://github.com/febeling/rb-libsvm/issues/10#issuecomment-8345049.

jeppevb avatar Sep 06 '12 19:09 jeppevb

I only have access to windows via a virtual machine. I'll see if I have everything I need to try to do it.

On Thu, Sep 6, 2012 at 12:52 PM, Florian Ebeling [email protected]:

I don't have access to a Windows machine, so I can't really help. Patches would be welcome.

— Reply to this email directly or view it on GitHubhttps://github.com/febeling/rb-libsvm/issues/10#issuecomment-8345049.

neovintage avatar Sep 06 '12 21:09 neovintage

I installed the libsvm-ruby-swig (0.4.0) gem (both gems installed) and the error changed.

C:\dev\Ruby193\lib\ruby\gems\1.9.1\gems\rb-libsvm-1.0.8\examples>ruby toy.rb
toy.rb:4:in `
': uninitialized constant Libsvm::Problem (NameError) C:\dev\Ruby193\lib\ruby\gems\1.9.1\gems\rb-libsvm-1.0.8\examples>ruby text.rb text.rb:30:in `block in
': uninitialized constant Libsvm::Node (NameError) from text.rb:28:in `each' from text.rb:28:in `
' C:\dev\Ruby193\lib\ruby\gems\1.9.1\gems\rb-libsvm-1.0.8\examples>gem list

jeppevb avatar Sep 06 '12 21:09 jeppevb

Need MS windows version also

ksaveras avatar Nov 02 '13 14:11 ksaveras

when You install libsvm-ruby-swig, it loads libsvm.rb file, not extension. When You have rb-libsvm only - it tries to load libsvm_ext.so but fails on windows

ksaveras avatar Nov 02 '13 15:11 ksaveras

This package, rb-libsvm, doesn't support Windows, unfortunately (unless somebody supplies a patch).

Please note that libsvm-ruby-swig and rb-libsvm packages are alternatives and not meant to be used together.

febeling avatar Nov 02 '13 15:11 febeling

Just saw that rake-compiler has support for cross-compiling now, and also provides a special rake-compiler-dev-box VM for this. Might make implementing this thing easier.

https://github.com/rake-compiler/rake-compiler#cross-compilation---the-future-is-now

febeling avatar May 17 '15 10:05 febeling

I don't find the time to do this. So the new status pretty much is: PR welcome.

febeling avatar May 18 '18 16:05 febeling

@jeppevb - Not really an answer to your issue, but I'll share with you my experience. Using Ruby on Windows makes it more difficult than Mac or Ubuntu. I suggest installing Ubuntu in Windows. It is very simple and you do not need dual boot.

georgeu2000 avatar Feb 10 '19 23:02 georgeu2000

@Kraviscloud What is gp?

febeling avatar Feb 26 '23 09:02 febeling