mockko / livereload Goto Github PK
View Code? Open in Web Editor NEWLiveReload applies CSS/JS changes to Safari or Chrome w/o reloading the page (and autoreloads the page when HTML changes)
Home Page: http://livereload.com/
LiveReload applies CSS/JS changes to Safari or Chrome w/o reloading the page (and autoreloads the page when HTML changes)
Home Page: http://livereload.com/
Clicking the icon enables LiveReload only on the current tab, but it shows like it's enabled on all current tabs of all windows.
Will fix it by using page actions instead of browser actions.
Just thought I'd give this gem a go, looks very interesting and could be a great time saver. I've installed the gem on my machine and when I move to my source directory and invoke 'livereload' I get a stack trace with:
../custom_require.rb:31:in `gem_original_require': no such file to load -- osx/foundation (LoadError)
To install:
SomeComputer:somedirectory me$ gem install livereload
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 ruby-json-1.1.2
Successfully installed livereload-1.4
5 gems installed
SomeComputer:somedirectory me$ livereload
I gather that osx foundation is part of RubyCocoa, but no mention of this is made in the documentation as a required gem. Any ideas/help would be appreciated.
Gav
I'm wondering if you'd consider using FSSM for better file system watching. It supports using FSEvents on MacOS (with ruby 1.8), Inotify on GNU/Linux, and polling anywhere else. It works quite well: http://github.com/ttilley/fssm
I can't connect with the livereload server. This message occurs:
LiveReload server connection closed. Please restart the server and re-enable LiveReload.
My Setup: Google Chrome 6.0.458.1 dev, Phusion Passenger (using Passenger Pane) under Mac Os X.
If you need more informations, I would love to help.
Version: 1.2
Port: 10083
Directory: C:/cygwin/home/marcos.vanetta/code/newsletter
Extensions: .html .css .js .png .gif .jpg .php .py .rb
LiveReload is waiting for browser to connect.
Browser connected.
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/eventmachine-0.12.10-x86-mswin32-60/lib/eventmachine.rb:1266: [BUG
] rb_sys_fail(no file watching support on this system) - errno == 0
ruby 1.8.6 (2007-09-24) [i386-mswin32]
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
$ rvm 1.8.7
$ livereload
/Users/ooo/.rvm/rubies/ruby-1.8.7-p299/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/ooo/.rvm/rubies/ruby-1.8.7-p299/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /Users/ooo/.rvm/gems/ruby-1.8.7-p299/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher/platform/mac/rubycocoa_watcher.rb:2
from /Users/ooo/.rvm/rubies/ruby-1.8.7-p299/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /Users/ooo/.rvm/rubies/ruby-1.8.7-p299/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /Users/ooo/.rvm/gems/ruby-1.8.7-p299/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher/platform/mac.rb:16:in `initialize'
from /Users/ooo/.rvm/gems/ruby-1.8.7-p299/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher/invokers/subprocess_invoker.rb:61:in `call'
from /Users/ooo/.rvm/gems/ruby-1.8.7-p299/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher/invokers/subprocess_invoker.rb:61:in `start_subprocess'
from /Users/ooo/.rvm/gems/ruby-1.8.7-p299/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher/invokers/subprocess_invoker.rb:20:in `initialize'
from /Users/ooo/.rvm/gems/ruby-1.8.7-p299/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher/platform/mac.rb:25:in `new'
from /Users/ooo/.rvm/gems/ruby-1.8.7-p299/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher/platform/mac.rb:25:in `initialize'
from /Users/ooo/.rvm/gems/ruby-1.8.7-p299/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher/monitor.rb:35:in `new'
from /Users/ooo/.rvm/gems/ruby-1.8.7-p299/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher/monitor.rb:35:in `watch'
from /Users/ooo/.rvm/gems/ruby-1.8.7-p299/gems/livereload-1.4/bin/../lib/livereload.rb:175:in `restart_watching'
from /Users/ooo/.rvm/gems/ruby-1.8.7-p299/gems/livereload-1.4/bin/../lib/livereload.rb:243:in `run'
from /Users/ooo/.rvm/gems/ruby-1.8.7-p299/gems/livereload-1.4/bin/../lib/livereload.rb:243:in `each'
from /Users/ooo/.rvm/gems/ruby-1.8.7-p299/gems/livereload-1.4/bin/../lib/livereload.rb:243:in `run'
from /Users/ooo/.rvm/gems/ruby-1.8.7-p299/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `call'
from /Users/ooo/.rvm/gems/ruby-1.8.7-p299/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run_machine'
from /Users/ooo/.rvm/gems/ruby-1.8.7-p299/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run'
from /Users/ooo/.rvm/gems/ruby-1.8.7-p299/gems/livereload-1.4/bin/../lib/livereload.rb:215:in `run'
from /Users/ooo/.rvm/gems/ruby-1.8.7-p299/gems/livereload-1.4/bin/livereload:51
from /Users/ooo/.rvm/gems/ruby-1.8.7-p299/bin/livereload:19:in `load'
from /Users/ooo/.rvm/gems/ruby-1.8.7-p299/bin/livereload:19
I know there are a couple of other issues about problems with 1.4 and I don't mean to create extra heat, but is there a way to revert back to 1.3?
I guess Chrome auto-upgraded and asked me to update the gem. After installing RubyCocoa, I started getting eventmachine-0.12.10/lib/eventmachine.rb:572:in `start_tcp_server': no acceptor (RuntimeError). I'm guessing that's the "rvm error"? Anyway, I uninstalled 1.4. 1.3 livereload server says "Browser connected." - but Chrome doesn't reload. I'm guessing because it's using version 1.4 (the extension). Is there a way to switch back to an older extension and have it stay that way (until this is fixed)?
When writing changes to disk, vim sometimes seems to delete and recreate the file rather than just modifying it. I'm not certain why vim does this, but I'm not inclined to crack open vim's source and change it.
Instead I've modified livereload so that it will send a refresh command to the browser when livereload detects a newly added file. This behavior seems pretty harmless because, in the case of vim, the "newly added file" is really just a modified file, and the browser will refresh the file since the browser already has a copy of the file located in the DOM. For files that are genuinely new, never-before-seen files, the browser extension won't find a file to update in the DOM and instead will refresh the entire page, which seems to be correct behavior to me.
This is really only half the battle though. DirectoryWatcher only checks for new files every 30 seconds. This interval is far too long to detect files that vim has removed and recreated, so I added a config.interval option which allows me to set the interval to something more like 1 or 2 seconds.
I've put the config.interval and send refresh on file add in this branch: http://github.com/aguynamedryan/livereload/commit/beb83d83564ec9d1114632098826e39aa9a82e99
If you only want the config.interval changes, they are in this branch: http://github.com/aguynamedryan/livereload/commit/5fb13814d4166f4eb0bf28be56420c93e717eb32
If you only want the changes to send refresh when files are added, they are in this branch: http://github.com/aguynamedryan/livereload/commit/282b80534dd79c88152d7b4774c6b1af0232e999
I do most of my day job on remote server via ssh. I want to use livereload there as well as on my local machine.
We need
localhost
(not a big deal)Hi,
OS: Mac OS X 10.5.8
uname: Darwin DogsHouse.local 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_I386 i386
livereload --version: 1.3
When I start livereload, the following is printed:
/Users/melo/.gem/ruby/1.8/gems/livereload-1.3/lib/livereload.rb:95:in `merge': undefined method `reduce' for #<Array:0x11b2e9c> (NoMethodError)
from /Users/melo/.gem/ruby/1.8/gems/livereload-1.3/lib/livereload.rb:200:in `run'
from /Users/melo/.gem/ruby/1.8/gems/livereload-1.3/bin/livereload:51
from /Users/melo/.gem/ruby/1.8/bin/livereload:19:in `load'
from /Users/melo/.gem/ruby/1.8/bin/livereload:19
Any ideas? Not a ruby user...
Thanks
This error does not prevent LR from functioning, it is just slightly annoyng. Console log:
LiveReload: !!ver:1.3
SyntaxError: Unexpected token ILLEGAL
Opera 11 alpha supports extensions. I believe it's possible to make LiveReload able to work in Opera.
More of a by the way than a bug, but if you draw on a canvas, changing the JS will draw again on the canvas without clearing it first.
You can tell livereload to refresh whole page, not just js in the .livereload file, or make sure you reset the canvas as the first part of your script.
Perhaps livereload could check if you are using the canvas API and default to reloading whole page in that case?
I'm going to remove apply_css_live option from a .livereload
config file. appply_css_live works so smooth. I don't see the reason to disable it.
Is there someone who turns it off? If so, why?
It brings unnecessary complexity to the code and makes harder to implement things like #53.
So I have two clean machines vista/7, installed Ruby 1.8.7 from the installer.
I installed all rails gems and stuff then eventmachine
'gem install eventmachine --platform=win32' fails telling you to checkout some log.
I searched for a few hours and found that there's a way to install gems locally, so I downloaded the eventmachine win32 0.12.10 gem and
gem install --local "c:\path\to\the.gemfile"
And eventmachine installed
then I installed the changenotify thing and livereload thing without problem.
when I do
c:\rails\demo_app\livereload
this line gives problem
c:\Ruby-187-p299/lib/ruby/gems/1.8/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher/platform/windows/monitor.rb:4
Though both Chrome and Safari for Windows activated the livereload feature without problem, but they are not getting any refreshes. Possibly because nothing is being watched.
Currently, the LiveReload client (e.g. Chrome extension and Safari extension) is closely tied to ws://127.0.0.1:35729/websocket
. I would like to add an option in GUI for the clients to change server URL.
➤ livereload --version 1.4 ➤ livereload ~ Version: 1.4 (compatible with browser extension versions 1.4.x) Port: 35729 Watching: /Users/nikitavasilev - 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
CPU was warm, but livereload wasn't working. I was waiting for about 10 minutes, but nothing changed. I suppose, it scans files, but doesn't show me any progress bar.
Then I pressed Ctrl + C
^C/usr/local/lib/ruby/1.8/set.rb:264:in `merge': Interrupt from /usr/local/lib/ruby/1.8/set.rb:76:in `initialize' from /usr/local/lib/ruby/gems/1.8/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher/tree.rb:75:in `new' from /usr/local/lib/ruby/gems/1.8/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher/tree.rb:75:in `refresh!' from /usr/local/lib/ruby/gems/1.8/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher/tree.rb:76:in `refresh!' from /usr/local/lib/ruby/1.8/set.rb:195:in `each' from /usr/local/lib/ruby/1.8/set.rb:195:in `each_key' from /usr/local/lib/ruby/1.8/set.rb:195:in `each' from /usr/local/lib/ruby/gems/1.8/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher/tree.rb:76:in `refresh!' from /usr/local/lib/ruby/gems/1.8/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher/tree.rb:76:in `refresh!' from /usr/local/lib/ruby/1.8/set.rb:195:in `each' from /usr/local/lib/ruby/1.8/set.rb:195:in `each_key' from /usr/local/lib/ruby/1.8/set.rb:195:in `each' from /usr/local/lib/ruby/gems/1.8/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher/tree.rb:76:in `refresh!' from /usr/local/lib/ruby/gems/1.8/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher/tree.rb:76:in `refresh!' from /usr/local/lib/ruby/1.8/set.rb:195:in `each' from /usr/local/lib/ruby/1.8/set.rb:195:in `each_key' from /usr/local/lib/ruby/1.8/set.rb:195:in `each' from /usr/local/lib/ruby/gems/1.8/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher/tree.rb:76:in `refresh!' from /usr/local/lib/ruby/gems/1.8/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher/tree.rb:76:in `refresh!' from /usr/local/lib/ruby/1.8/set.rb:195:in `each' from /usr/local/lib/ruby/1.8/set.rb:195:in `each_key' from /usr/local/lib/ruby/1.8/set.rb:195:in `each' from /usr/local/lib/ruby/gems/1.8/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher/tree.rb:76:in `refresh!' from /usr/local/lib/ruby/gems/1.8/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher/tree.rb:76:in `refresh!' from /usr/local/lib/ruby/1.8/set.rb:195:in `each' from /usr/local/lib/ruby/1.8/set.rb:195:in `each_key' from /usr/local/lib/ruby/1.8/set.rb:195:in `each' from /usr/local/lib/ruby/gems/1.8/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher/tree.rb:76:in `refresh!' from /usr/local/lib/ruby/gems/1.8/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher/tree.rb:76:in `refresh!' from /usr/local/lib/ruby/1.8/set.rb:195:in `each' from /usr/local/lib/ruby/1.8/set.rb:195:in `each_key' from /usr/local/lib/ruby/1.8/set.rb:195:in `each' from /usr/local/lib/ruby/gems/1.8/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher/tree.rb:76:in `refresh!' from /usr/local/lib/ruby/gems/1.8/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher/tree.rb:76:in `refresh!' from /usr/local/lib/ruby/1.8/set.rb:195:in `each' from /usr/local/lib/ruby/1.8/set.rb:195:in `each_key' from /usr/local/lib/ruby/1.8/set.rb:195:in `each' from /usr/local/lib/ruby/gems/1.8/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher/tree.rb:76:in `refresh!' from /usr/local/lib/ruby/gems/1.8/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher/tree.rb:173:in `initialize' from /usr/local/lib/ruby/gems/1.8/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher/monitor.rb:21:in `new' from /usr/local/lib/ruby/gems/1.8/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher/monitor.rb:21:in `watch' from /usr/local/lib/ruby/gems/1.8/gems/livereload-1.4/bin/../lib/livereload.rb:175:in `restart_watching' from /usr/local/lib/ruby/gems/1.8/gems/livereload-1.4/bin/../lib/livereload.rb:243:in `run' from /usr/local/lib/ruby/gems/1.8/gems/livereload-1.4/bin/../lib/livereload.rb:243:in `each' from /usr/local/lib/ruby/gems/1.8/gems/livereload-1.4/bin/../lib/livereload.rb:243:in `run' from /usr/local/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `call' from /usr/local/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run_machine' from /usr/local/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run' from /usr/local/lib/ruby/gems/1.8/gems/livereload-1.4/bin/../lib/livereload.rb:215:in `run' from /usr/local/lib/ruby/gems/1.8/gems/livereload-1.4/bin/livereload:51 from /usr/local/bin/livereload:19:in `load' from /usr/local/bin/livereload:19
I would say how many files I have if I knew how to measure.
ls **/*.{html,css,js,png,gif,jpg} | xargs wc -l zsh: argument list too long: ls 0
it seems javascript events are not refreshed after a live reload.. old events are still trigered.. i'm using jquery 1.4 doing a simple toggle function on Safari 5.0.2 (OSX 10.6.4).
$('.help').toggle(
function(e) {
// do stuff
e.preventDefault();
},
function(e) {
// do stuff
e.preventDefault();
}
);
};
i have a few css files linked to the master stylesheet via @import method. after a few editing i realized the live reload doesn't run. the page does get refreshed by the extension, but without the live reload thing.. i hope you understand what i mean :P
i'm working with SASS files and developing on Safari 5.0.2 (OSX 10.6.4)
I don't like that a browser extension version 1.5 requires monitoring tool with the same version. In fact, LR extension 1.5 fully compatible with 1.4 monitoring tool, but we still force users to update. Things get worse with third-party monitoring tools. We already have at least one — guard-livereload. I shouldn't have to do commits like this.
We should rely on LiveReload protocol version.
My plan:
When right-clicking and selecting "Enable LiveReload", Safari crash without any error message.
In the console there is just "Browser connected. Browser disconnected."
Safari Version 5.0 (6533.16), LiveReload 1.2.1, OSX 10.6.4, project is a php project.
I did a song and dance to install RubyCocoa and livereload on top of ree 1.8.7-2009.10 (Ruby Enterprise Edition), which is installed on my OS X 10.6 system via rvm.
I got everything installed -- I think -- but when I run livereload, I get the message in the title of this issue, and nothing on the page ever seems to update.
Any suggestions?
It looks like the win32-event gem is required, but this isn't mentioned in the installation docs. Once I did gem install win32-event
it worked like a charm.
[C:\Users\charlesr\My Dropbox\Projects\SARG\Prototype]livereload
Version: 1.4 (compatible with browser extension versions 1.4.x)
Port: 35729
Watching: C:/Users/charlesr/My Dropbox/Projects/SARG/Prototype
- extensions: .html .css .js .png .gif .jpg .php .php5 .py .rb .erb .haml .sass
- excluding changes in: */.git/* */.svn/* */.hg/*
- with a grace period of 0.05 sec after each change
LiveReload is waiting for browser to connect.
C:/Users/charlesr/Tools/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- win32/event (LoadError)
from C:/Users/charlesr/Tools/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from C:/Users/charlesr/Tools/Ruby187/lib/ruby/gems/1.8/gems/win32-changenotify-0.5.1/lib/win32/changenotify.rb:1
from C:/Users/charlesr/Tools/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
from C:/Users/charlesr/Tools/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from C:/Users/charlesr/Tools/Ruby187/lib/ruby/gems/1.8/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher/platform/windows/monitor.rb:4
Any volunteers to build Firefox extension?
XRefresh is an alternative to LiveReload that works in Firefox 3.6. The problem is, it doesn't work in Firefox 4 beta.
XRefresh ins't compatible with livereload command-line utility.
Personally, I won't even try to build Firefox 4 extension until ChromeBug worked with it.
It would be great to have an option to exclude certain files from watching.
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.
snow leopard 10.6.4 + ruby 1.8.7——
scriptfansmatoMacBook-Pro:untrip html scriptfans$ livereload
Version: 1.4 (compatible with browser extension versions 1.4.x)
Port: 35729
Watching: /Users/scriptfans/untrip html
LiveReload is waiting for browser to connect.
/opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- rubycocoa (LoadError)
How to solve this problem?
I get the idea that when only css changes the browser would update the page without refreshing the whole page. Isn't happening for me.
Thanks.
Hi, I'm on ubuntu 10.10. When launching livereload from the shell, I get these errors:
LiveReload is waiting for browser to connect. /home/fabio/.rvm/gems/ruby-1.9.2-p0@global/gems/eventmachine-0.12.10/lib/eventmachine.rb:572:in `start_tcp_server': no acceptor (RuntimeError) from /home/fabio/.rvm/gems/ruby-1.9.2-p0@global/gems/eventmachine-0.12.10/lib/eventmachine.rb:572:in `start_server' from /home/fabio/.rvm/gems/ruby-1.9.2-p0@global/gems/em-websocket-0.2.0/lib/em-websocket/websocket.rb:14:in `block in start' from /home/fabio/.rvm/gems/ruby-1.9.2-p0@global/gems/eventmachine-0.12.10/lib/eventmachine.rb:241:in `call' from /home/fabio/.rvm/gems/ruby-1.9.2-p0@global/gems/eventmachine-0.12.10/lib/eventmachine.rb:241:in `run' from /home/fabio/.rvm/gems/ruby-1.9.2-p0@global/gems/em-websocket-0.2.0/lib/em-websocket/websocket.rb:9:in `start' from /home/fabio/.rvm/gems/ruby-1.9.2-p0@global/gems/livereload-1.4/lib/livereload.rb:247:in `block in run' from /home/fabio/.rvm/gems/ruby-1.9.2-p0@global/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `call' from /home/fabio/.rvm/gems/ruby-1.9.2-p0@global/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run_machine' from /home/fabio/.rvm/gems/ruby-1.9.2-p0@global/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run' from /home/fabio/.rvm/gems/ruby-1.9.2-p0@global/gems/livereload-1.4/lib/livereload.rb:215:in `run' from /home/fabio/.rvm/gems/ruby-1.9.2-p0@global/gems/livereload-1.4/bin/livereload:51:in `' from /home/fabio/.rvm/gems/ruby-1.9.2-p0@global/bin/livereload:19:in `load' from /home/fabio/.rvm/gems/ruby-1.9.2-p0@global/bin/livereload:19:in `'
Actually, after this error livereload is working as expected.
RubyCocoa is giving a headache to many. Let's just drop it.
This bug is created to merge several bugreports created after 1.4 release.
The whole idea is to eliminate any user interactions with command-line tool, ruby and rubygems. It scare the shit out of some HTML/CSS guys.
LiveReload in Mac OS X menu bar
Livereload app starts on system load. It listens on 35729 port (as it works now), but it does not monitor any files yet. It start monitoring when you turn on LiveReload browser extension. Browser sends URL of current page to the LR app. When it matches some of user-defined rules then it starts monitoring files.
The rules file might looks like:
match('http://example.com') {
watch('/Users/nv/Sites/example.com/')
}
When user turn off browser extension then LR app stops monitor the files.
Just a heads up that running the command:
gem install eventmachine win32-changenotify win32-event livereload --platform=ruby
with an install of Ruby 1.9.2 results in failure. (Something to do with conversion of data types. Sorry for the lack of detail.) I've since installed 1.9.1 and everything works great!
Love the gem. Would really like to use it with automated javascript testing. Problem is that some of the popular testing frameworks (I'm using Jasmine) don't get refreshed by livereload. This seems to be because the page is not actually being reloaded when the JS is modified, so the new tests don't get run.
Is it possible to optionally configure livereload so that it will reload the page when a JS file is changed?
Use command-line arguments instead.
At the moment there is a global fallback to reloading the whole page if a file is changed that has nothing to do with the current page:
https://github.com/mockko/livereload/blob/master/src/core.js#L153
What are the thoughts behind that? At least for CSS I can't think of any reason why I want to do this. Could you please make this behavior configurable?
USERNAME@MACHINE: ~/Sites/rails/depot $ livereload
Version: 1.4 (compatible with browser extension versions 1.4.x)
Port: 35729
Watching: /Users/USERNAME/Sites/rails/depot
LiveReload is waiting for browser to connect.
internal:lib/rubygems/custom_require:29:in require': no such file to load -- osx/foundation (LoadError) from <internal:lib/rubygems/custom_require>:29:in
require'
from /Users/USERNAME/.rvm/gems/ruby-1.9.2-p0/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher/platform/mac/rubycocoa_watcher.rb:2:in <top (required)>' from <internal:lib/rubygems/custom_require>:29:in
require'
from internal:lib/rubygems/custom_require:29:in require' from /Users/USERNAME/.rvm/gems/ruby-1.9.2-p0/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher/platform/mac.rb:16:in
block in initialize'
from /Users/USERNAME/.rvm/gems/ruby-1.9.2-p0/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.9.2-p0/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.9.2-p0/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.9.2-p0/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher/platform/mac.rb:25:in
new'
from /Users/USERNAME/.rvm/gems/ruby-1.9.2-p0/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher/platform/mac.rb:25:in initialize' from /Users/USERNAME/.rvm/gems/ruby-1.9.2-p0/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher/monitor.rb:35:in
new'
from /Users/USERNAME/.rvm/gems/ruby-1.9.2-p0/gems/em-dir-watcher-0.9.4/lib/em-dir-watcher/monitor.rb:35:in watch' from /Users/USERNAME/.rvm/gems/ruby-1.9.2-p0/gems/livereload-1.4/lib/livereload.rb:175:in
restart_watching'
from /Users/USERNAME/.rvm/gems/ruby-1.9.2-p0/gems/livereload-1.4/lib/livereload.rb:243:in block (2 levels) in run' from /Users/USERNAME/.rvm/gems/ruby-1.9.2-p0/gems/livereload-1.4/lib/livereload.rb:243:in
each'
from /Users/USERNAME/.rvm/gems/ruby-1.9.2-p0/gems/livereload-1.4/lib/livereload.rb:243:in block in run' from /Users/USERNAME/.rvm/gems/ruby-1.9.2-p0/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in
call'
from /Users/USERNAME/.rvm/gems/ruby-1.9.2-p0/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in run_machine' from /Users/USERNAME/.rvm/gems/ruby-1.9.2-p0/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in
run'
from /Users/USERNAME/.rvm/gems/ruby-1.9.2-p0/gems/livereload-1.4/lib/livereload.rb:215:in run' from /Users/USERNAME/.rvm/gems/ruby-1.9.2-p0/gems/livereload-1.4/bin/livereload:51:in
<top (required)>'
from /Users/USERNAME/.rvm/gems/ruby-1.9.2-p0/bin/livereload:19:in load' from /Users/USERNAME/.rvm/gems/ruby-1.9.2-p0/bin/livereload:19:in
my .livereload (nothing special I guess)
config.apply_js_live = true
config.apply_css_live = true
config.grace_period = 0.05
Reload images included via:
<img>
background-image
, list-style-image
and border-image
(hope I didn't forget something)
<style>
or <link>
<div style="background-image: url(ferrets.jpg)">
Working on it.
The version is 1.3 and it blows up with the Too many open files error.
ree-1.8.7-2010.02@automation [~/rails_apps/automation (refactor)⚡] ➔ livereload
Version: 1.3 (compatible with browser extension versions 1.3.x)
Port: 10083
Watching: /Users/millisami/rails_apps/automation
- extensions: .html .css .js .png .gif .jpg .php .php5 .py .rb .erb .haml
- excluding changes in: /public/javascripts/* */.git/* */.svn/* */.hg/*
/Users/millisami/.rvm/gems/ree-1.8.7-2010.02@global/gems/eventmachine-0.12.10/lib/eventmachine.rb:1266:in `watch_filename': Too many open files - failed to open file /Users/millisami/rails_apps/automation/public/javascripts/right/i18n/ru.js for registering with kqueue: Too many open files (Errno::EMFILE)
from /Users/millisami/.rvm/gems/ree-1.8.7-2010.02@global/gems/eventmachine-0.12.10/lib/eventmachine.rb:1266:in `watch_file'
from /Users/millisami/.rvm/gems/ree-1.8.7-2010.02@automation/gems/directory_watcher-1.3.2/lib/directory_watcher/em_scanner.rb:187:in `_watch_file'
from /Users/millisami/.rvm/gems/ree-1.8.7-2010.02@automation/gems/directory_watcher-1.3.2/lib/directory_watcher/em_scanner.rb:69:in `start'
from /Users/millisami/.rvm/gems/ree-1.8.7-2010.02@automation/gems/directory_watcher-1.3.2/lib/directory_watcher/em_scanner.rb:67:in `each'
from /Users/millisami/.rvm/gems/ree-1.8.7-2010.02@automation/gems/directory_watcher-1.3.2/lib/directory_watcher/em_scanner.rb:67:in `start'
from /Users/millisami/.rvm/gems/ree-1.8.7-2010.02@automation/gems/directory_watcher-1.3.2/lib/directory_watcher.rb:497:in `start'
from /Users/millisami/.rvm/gems/ree-1.8.7-2010.02@automation/gems/livereload-1.3/lib/livereload.rb:185:in `restart_watching'
from /Users/millisami/.rvm/gems/ree-1.8.7-2010.02@automation/gems/livereload-1.3/lib/livereload.rb:237:in `run'
from /Users/millisami/.rvm/gems/ree-1.8.7-2010.02@automation/gems/livereload-1.3/lib/livereload.rb:237:in `each'
from /Users/millisami/.rvm/gems/ree-1.8.7-2010.02@automation/gems/livereload-1.3/lib/livereload.rb:237:in `run'
from /Users/millisami/.rvm/gems/ree-1.8.7-2010.02@global/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `call'
from /Users/millisami/.rvm/gems/ree-1.8.7-2010.02@global/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run_machine'
from /Users/millisami/.rvm/gems/ree-1.8.7-2010.02@global/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run'
from /Users/millisami/.rvm/gems/ree-1.8.7-2010.02@automation/gems/livereload-1.3/lib/livereload.rb:209:in `run'
from /Users/millisami/.rvm/gems/ree-1.8.7-2010.02@automation/gems/livereload-1.3/bin/livereload:51
from /Users/millisami/.rvm/gems/ree-1.8.7-2010.02@automation/bin/livereload:19:in `load'
from /Users/millisami/.rvm/gems/ree-1.8.7-2010.02@automation/bin/livereload:19
ree-1.8.7-2010.02@automation [~/rails_apps/automation (refactor)⚡] ➔
Load page. Change .css file. LiveReload will request style.css?livereload=1. Browser will load and cache this file.
Now manually refresh page. Change .css file again. LiveReload will request style.css?livereload=1 again. Browser will happily use stale cached file.
An example:
file://tmp/mysite/index.html is opened in the browser. When I edit /some_other/index.html then LiveReload refreshes the page because filenames match. It's completely unnecessary.
Via darwin/xrefresh#9.
Getting the following problem on Windows 7:
checking for rb_trap_immediate in ruby.h,rubysig.h... no
checking for rb_thread_blocking_region()... no
checking for inotify_init() in sys/inotify.h... no
checking for __NR_inotify_init in sys/syscall.h... no
checking for writev() in sys/uio.h... no
checking for rb_thread_check_ints()... no
checking for rb_time_new()... no
checking for windows.h... no
could not find header: windows.h
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/Ruby187/bin/ruby
Gem files will remain installed in C:/Ruby187/lib/ruby/gems/1.8/gems/eventmachin
e-0.12.10 for inspection.
Results logged to C:/Ruby187/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/ext/gem
_make.out
Livereload command-line tool should run in "sleep mode" until browser is connected. It would save a lot of unnecessary CPU heat.
This is the one crazy idea. Is it possible to create a NPAPI plug-in that would monitor file changes? Does it have all necessary permissions?
Browser plug-ins are much easy to install than ruby gems which has binaries and RubyCocoa dependencies.
How to reproduce:
What happens:
What should happen:
I put some exclusions in the .livereload
file. livereload notices them but doesn't actually do anything with them.
Version: 1.3 (compatible with browser extension versions 1.3.x)
Port: 10083
Watching: /Users/sjl/src/project
- extensions: .html .css .js .png .gif .jpg .php .php5 .py .rb .erb
- excluding changes in: .png .gif .jpg */media/uploads/* */media/admin/* */media/ckeditor/* */media/filebrowser/* */media/pages/* */.git/* */.svn/* */.hg/*
/Library/Ruby/Gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:1266:in `watch_filename': Too many open files - failed to open file /Users/sjl/src/project/media/uploads/case-studies/foo/bar/baz.jpg for registering with kqueue: Too many open files (Errno::EMFILE)
Notice how the file (/Users/sjl/src/project/media/uploads/case-studies/foo/bar/baz.jpg
) matches both an excluded extension and an excluded directory, but is still included.
Nice updates on the config, but it seems to be impossible to reset tracked extensions.
Example:
config.exts = %w[.haml .sass]
only appends them once again, not setting the extensions to track. A bit annoying to track PHP and PY files in Rails app that is.
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>'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.