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

Nothing happens when livereload watches a directory, much terminal output #33

Closed johnstephens closed 13 years ago

johnstephens commented 13 years ago

I'm just getting started with livereload, running Ruby 1.8.7-p302, and Rubygems 1.3.7 on Mac OS 10.5.8. When I initially run livereload, I see a whole wodge of output:

Version:  1.4  (compatible with browser extension versions 1.4.x)
Port:     35729
Watching: /Users/username/Sites/example.dev
  - extensions: .html .css .js .png .gif .jpg .php .php5 .py .rb .erb
  - excluding changes in: */.git/* */.svn/* */.hg/*
  - with a grace period of 0.05 sec after each change

LiveReload is waiting for browser to connect.
/Users/username/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- osx/foundation (LoadError)
    from /Users/username/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from /Users/username/.rvm/gems/ruby-1.8.7-p302/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher/platform/mac/rubycocoa_watcher.rb:2
    from /Users/username/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    from /Users/username/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from /Users/username/.rvm/gems/ruby-1.8.7-p302/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher/platform/mac.rb:16:in `initialize'
    from /Users/username/.rvm/gems/ruby-1.8.7-p302/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher/invokers/subprocess_invoker.rb:61:in `call'
    from /Users/username/.rvm/gems/ruby-1.8.7-p302/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher/invokers/subprocess_invoker.rb:61:in `start_subprocess'
    from /Users/username/.rvm/gems/ruby-1.8.7-p302/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher/invokers/subprocess_invoker.rb:20:in `initialize'
    from /Users/username/.rvm/gems/ruby-1.8.7-p302/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher/platform/mac.rb:25:in `new'
    from /Users/username/.rvm/gems/ruby-1.8.7-p302/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher/platform/mac.rb:25:in `initialize'
    from /Users/username/.rvm/gems/ruby-1.8.7-p302/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher/monitor.rb:35:in `new'
    from /Users/username/.rvm/gems/ruby-1.8.7-p302/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher/monitor.rb:35:in `watch'
    from /Users/username/.rvm/gems/ruby-1.8.7-p302/gems/livereload-1.4/bin/../lib/livereload.rb:175:in `restart_watching'
    from /Users/username/.rvm/gems/ruby-1.8.7-p302/gems/livereload-1.4/bin/../lib/livereload.rb:243:in `run'
    from /Users/username/.rvm/gems/ruby-1.8.7-p302/gems/livereload-1.4/bin/../lib/livereload.rb:243:in `each'
    from /Users/username/.rvm/gems/ruby-1.8.7-p302/gems/livereload-1.4/bin/../lib/livereload.rb:243:in `run'
    from /Users/username/.rvm/gems/ruby-1.8.7-p302/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `call'
    from /Users/username/.rvm/gems/ruby-1.8.7-p302/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run_machine'
    from /Users/username/.rvm/gems/ruby-1.8.7-p302/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run'
    from /Users/username/.rvm/gems/ruby-1.8.7-p302/gems/livereload-1.4/bin/../lib/livereload.rb:215:in `run'
    from /Users/username/.rvm/gems/ruby-1.8.7-p302/gems/livereload-1.4/bin/livereload:51
    from /Users/username/.rvm/gems/ruby-1.8.7-p302/bin/livereload:19:in `load'
    from /Users/username/.rvm/gems/ruby-1.8.7-p302/bin/livereload:19

I have the Livereload extension installed in Safari, and when I click "Enable Livereload", I see a Browser Connected message in the terminal, but nothing happens when I edit a CSS file and save. Since I don't have any successful experience with livereload, I don't know what I'm doing wrong or what debugging info is relevant.

NV commented 13 years ago
  1. Livereload is incompatible with rvm
  2. Install RubyCocoa
johnstephens commented 13 years ago

Thanks, NV. I ran the RubyCocoa installer, but I'm not sure how to switch the active Ruby I'm using without breaking everything.

NV commented 13 years ago

You can switch to system's ruby before running livereload. Then switch back.

➤ rvm system
➤ which ruby
/usr/bin/ruby
➤ livereload
➤ rvm use default
Using /Users/nv/.rvm/gems/ruby-1.8.7-p302
johnstephens commented 13 years ago

Thanks again— almost there now. livereload seems to be tied to my rvm Ruby install-- the command isn't available when I switch; I get command not found instead.

When I run which ruby, it says /Users/me/.rvm/bin/ruby instead of /usr/bin/ruby.

NV commented 13 years ago

You have to install livereload again after switch. Different rubies bundled with different sets of gems.

Run rvm system; which ruby. It should show you /usr/bin/ruby (at least if you're on OS X 10.6). rvm use default; which ruby, however, might show you /Users/me/.rvm/bin/ruby. It's okay.

johnstephens commented 13 years ago

I'm on OS 10.5.8. When I run rvm system; which ruby, it shows me /Users/john/.rvm/bin/ruby.

I ran gem install livereload after switching, and got confirmation messages that livereload was installed along with its ri and RDoc stuff. But it still doesn't work-- it throws command not found error.

When I run gem list, it shows me the gems available in my rvm ruby environment, none of which are accessible until I run rvm use default.

NV commented 13 years ago

I don't know why rvm system doesn't switch you to the ruby which was used before you installed rvm. Maybe you should ask about it on irc.freenode.net#rvm.