Burgestrand / Hallon

Hallon is currently **UNMAINTAINED**.
http://rdoc.info/github/Burgestrand/Hallon/master/frames
135 stars 12 forks source link

Can't run in Windows: 'sp_build_id' does not exist #147

Open basicallydan opened 11 years ago

basicallydan commented 11 years ago

Hey!

Thanks for making this wrapper - it's great! I'm having no problems on mac, but when I run my script on windows with the latest DLL in the directory (12.1.52) I get this error:

[WARN] You are running the Spotify gem on an unknown platform. (C:/Ruby193/lib/ruby/gems/1.9.1/gems/spotify-12.5.2/lib/spotify/util.rb:32)
[WARN] Platform: windows
bin/run.rb:18:in `eval': Function 'sp_build_id' not found in [libspotify] (FFI::NotFoundError)
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/spotify-12.5.2/lib/spotify/api.rb:24:in `attach_function'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/spotify-12.5.2/lib/spotify/api.rb:32:in `<class:API>'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/spotify-12.5.2/lib/spotify/api.rb:2:in `<module:Spotify>'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/spotify-12.5.2/lib/spotify/api.rb:1:in `<top (required)>'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/spotify-12.5.2/lib/spotify.rb:113:in `require'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/spotify-12.5.2/lib/spotify.rb:113:in `<top (required)>'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/hallon-0.18.2/lib/hallon.rb:2:in `require'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/hallon-0.18.2/lib/hallon.rb:2:in `<top (required)>'
        from (eval):6:in `require'
        from (eval):6:in `block in <main>'
        from bin/run.rb:18:in `eval'
        from bin/run.rb:18:in `block in <main>'
        from bin/run.rb:16:in `each'
        from bin/run.rb:16:in `<main>'

Any ideas what could be going on here?

Thanks!

Burgestrand commented 11 years ago

I currently don’t own a windows machine, and I have not recently tried running Hallon on one. I believe this issue stems from the libspotify DLL using stdcall, which mangles the names in a predictable manner. It’s possible this fix might work (but I cannot try it myself):

module Spotify
  class API
    @ffi_convention = :stdcall
  end
end

require "spotify"

The warning you receive about running the gem on an unknown platform is not fixable without a new release of the spotify gem, but it is no cause for concern at the moment.

Burgestrand commented 11 years ago

I’ve updated the posted snippet in my comment. It should be correct now, but as I said earlier I have no way of trying it for myself at the moment.

basicallydan commented 11 years ago

Hey Kim,

Thanks, I'll give that a go when I'm in the office - put that in the file where I'm requiring Hallon, right?

Burgestrand commented 11 years ago

Yep! Make sure to put it before you require Hallon.