mockko / livereload

LiveReload applies CSS/JS changes to Safari or Chrome w/o reloading the page (and autoreloads the page when HTML changes)
http://livereload.com/
1.18k stars 56 forks source link

Ruby 1.9.1 incompatibility on Windows #20

Closed charlesroper closed 13 years ago

charlesroper commented 14 years ago

LiveReload does not work on Ruby 1.9.1 on Windows which may confuse some users seeing as 1.9.1 is the top download link on the RubyInstaller site. It's broken because the win32-api gem is compiled against 1.8 and pops-up this error when LR is run:

The program can't start because msvcrt-ruby18.dll is missing from your computer. Try reinstalling the program to fix this problem.

You then get this error on the command line:

   C:\> livereload
C:/Users/charlesr/.pik/rubies/Ruby-191-p429/lib/ruby/gems/1.9.1/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher/platform/windows/path_to_ruby_exe.rb:2:in `require': 126: The specified module could not be found.   - C:/Users/charlesr/.pik/rubies/Ruby-191-p429/lib/ruby/gems/1.9.1/gems/win32-api-1.4.6-x86-mingw32/lib/win32/api.so (LoadError)
        from C:/Users/charlesr/.pik/rubies/Ruby-191-p429/lib/ruby/gems/1.9.1/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher/platform/windows/path_to_ruby_exe.rb:2:in `<top (required)>'
        from C:/Users/charlesr/.pik/rubies/Ruby-191-p429/lib/ruby/gems/1.9.1/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher/platform/windows.rb:2:in `require'
        from C:/Users/charlesr/.pik/rubies/Ruby-191-p429/lib/ruby/gems/1.9.1/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher/platform/windows.rb:2:in `<top (required)>'
        from C:/Users/charlesr/.pik/rubies/Ruby-191-p429/lib/ruby/gems/1.9.1/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher.rb:16:in `require'
        from C:/Users/charlesr/.pik/rubies/Ruby-191-p429/lib/ruby/gems/1.9.1/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher.rb:16:in `<top (required)>'
        from C:/Users/charlesr/.pik/rubies/Ruby-191-p429/lib/ruby/gems/1.9.1/gems/livereload-1.4/lib/livereload.rb:2:in `require'
        from C:/Users/charlesr/.pik/rubies/Ruby-191-p429/lib/ruby/gems/1.9.1/gems/livereload-1.4/lib/livereload.rb:2:in `<top (required)>'
        from C:/Users/charlesr/.pik/rubies/Ruby-191-p429/lib/ruby/gems/1.9.1/gems/livereload-1.4/bin/livereload:3:in `require'
        from C:/Users/charlesr/.pik/rubies/Ruby-191-p429/lib/ruby/gems/1.9.1/gems/livereload-1.4/bin/livereload:3:in `<top (required)>'
        from C:/Users/charlesr/.pik/rubies/Ruby-191-p429/bin/livereload:19:in `load'
        from C:/Users/charlesr/.pik/rubies/Ruby-191-p429/bin/livereload:19:in `<main>'
andreyvit commented 14 years ago

Right. I'm not sure what to do about this, though. Do you have any ideas?

charlesroper commented 14 years ago

I've asked the authors if they'll compile a version against 1.9. If I get no joy there, I'll see what the RubyInstaller guys think.

andreyvit commented 14 years ago

Thanks a lot.

charlesroper commented 14 years ago

I've now got it working thanks to the folks on the RubyInstaller group. Adding --platform=ruby forces the binary extensions to compile using the DevKit:

[C:\]gem install win32-changenotify win32-event livereload --platform=ruby
Building native extensions.  This could take a while...
Successfully installed win32-api-1.4.6
Successfully installed windows-api-0.4.0
Successfully installed windows-pr-1.0.9
Successfully installed win32-changenotify-0.5.1
Successfully installed win32-ipc-0.5.3
Successfully installed win32-event-0.5.2
Building native extensions.  This could take a while...
Successfully installed eventmachine-0.12.10
Successfully installed em-websocket-0.1.3
Successfully installed em-dir-watcher-0.9.4
Successfully installed livereload-1.4
10 gems installed

Here's the thread on the RubyInstaller group:

http://groups.google.com/group/rubyinstaller/browse_thread/thread/d9c226735a54679f

dottedmag commented 14 years ago

I have updated installation instructions for ruby 1.9 on Win32

chodorowicz commented 14 years ago

I have still the same problem... What version of DevKit are you using (the legacy or the newest one?) Do I have to reinstall some gems maybe?

charlesroper commented 14 years ago

I'm using the new one - 4.5.0 - found here: http://github.com/oneclick/rubyinstaller/downloads

I don't think there are installation instructions for it yet as it's not been officially released. It's easy enough, though: put it in a path with no spaces, then run ruby dk.rb init then ruby dk.rb review and finally ruby dk.rb install. You'll need to remove the old DevKit from your setup first.

Best place to get further help with the DevKit is the the RubyInstaller group - they're a very friendly and helpful bunch.

chodorowicz commented 14 years ago

I'll try the 4.5.0 - thanks for the instructions!

NV commented 13 years ago

I've tried to install LiveReload with

gem install eventmachine-win32 win32-changenotify win32-event livereload

and had exactly the same problem as OP. I uninstall all win- and windows- gems. Then I run

gem install win32-changenotify win32-event livereload --platform=ruby

and everything worked well.

I've updated README.