Guard no longer detecting file changes with Yosemite OSX 10.10 - ruby-on-rails

I set up a clean install of Yosemite and can't get guard to detect whenever a file is changed.
My Environment:
guard (2.6.1)
guard-minitest (2.2.0)
rubygems-bundler (1.4.4)
Ruby 1.9.3 and 2.0.0 both have been testing
Here is the output from debugging:
tom#Toms-MBP:~/Sites/tick (master)$ LISTEN_GEM_DEBUGGING=2 bundle exec guard -d
I, [2014-10-27T15:34:53.417196 #1059] INFO -- : Celluloid loglevel set to: 0
15:34:53 - DEBUG - Command execution: emacsclient --eval '1' 2> /dev/null || echo 'N/A'
15:34:53 - INFO - Guard is using TerminalTitle to send notifications.
15:34:53 - DEBUG - Command execution: hash stty
15:34:53 - DEBUG - Guard starts all plugins
15:34:53 - DEBUG - Hook :start_begin executed for Guard::Minitest
15:34:53 - INFO - Guard::Minitest 2.3.2 is running, with Minitest::Unit 4.7.5!
15:34:53 - DEBUG - Hook :start_end executed for Guard::Minitest
15:34:53 - INFO - Guard is now watching at '/Users/tom/Dropbox/Sites/tick'
15:34:53 - DEBUG - Command execution: sysctl -n hw.ncpu
D, [2014-10-27T15:34:53.517668 #1059] DEBUG -- : Adapter: considering TCP ...
D, [2014-10-27T15:34:53.517749 #1059] DEBUG -- : Adapter: considering polling ...
D, [2014-10-27T15:34:53.517776 #1059] DEBUG -- : Adapter: considering optimized backend...
I, [2014-10-27T15:34:53.587089 #1059] INFO -- : Record.build(): 0.06837701797485352 seconds
15:34:53 - DEBUG - Command execution: stty -g 2>/dev/null
15:34:53 - DEBUG - Start interactor
[1] guard(main)>
I am not sure how to test the underlying listen gem, but seems like it has to be related. I have confirmed that guard works correctly with polling (bundle exec guard start --force-polling).

I was able to resolve my issue by moving the files out of Dropbox. Once I saw this working, I knew that Dropbox was somehow causing the issue with the file system. I resolved it by removing the folder and re-adding it through Dropbox and now everything is working as before.

I had the same problem, and only thanks to a warning issued by the LiveReload application I fixed it.
Because the problem is not restrained to Dropbox and/or ruby on rails, I wanted to share what I did:
Rename problematic folder (in my case containing the Guardfile)
Create new folder with the old folders name
Move files from old to new folder
Other solutions mentioned by LiveReload are:
rebooting the computer
checking the disk and repairing permissions via Disk Utility
adding the folder to Spotlight privacy list (the list of folders to not index), and then removing from it, effectively forcing a
reindexing
renaming the folder, and then possibly renaming it back
re-creating the folder and moving the old contents back into it
Read more: http://feedback.livereload.com/knowledgebase/articles/86239
This not only fixed my Guard problem, but also allowed Compass watch to run again.

Did you add rb-fsevent gem ?
group :development, :test do
gem 'rb-fsevent' if `uname` =~ /Darwin/
end
if you're using OS X, it will be used OS X FSEvents API.

Related

Brew postinstall mysql#5.7 complaining about data directory not empty when it is empty

Having a lot of trouble installing mysql 5.7 on Mac Mojave, (ran 'brew install mysql#5.7')
on initial install, got msg saying postinstall was not completed successfully (please see msg below).
So, after I delete everything in the directory /usr/local/var/mysql (which mysql says is not empty), I STILL get same message when re-running postinstall command ... (which is quite annoying seems MySQL is populating the data dir then complaining it is not empty?!)
[08:02:48][~/tmp]#brew postinstall mysql#5.7
==> Postinstalling mysql#5.7
==> /usr/local/Cellar/mysql#5.7/5.7.28/bin/mysqld --initialize-insecure --user=gert --basedir=/usr/local/Cellar/mysql#5.7/5.7.28 --datadir=/usr/local/var/my Last 15 lines from /Users/gert/Library/Logs/Homebrew/mysql#5.7/post_install.01.mysqld: 2019-12-09 08:03:39 +0200
/usr/local/Cellar/mysql#5.7/5.7.28/bin/mysqld
--initialize-insecure
--user=gert
--basedir=/usr/local/Cellar/mysql#5.7/5.7.28
--datadir=/usr/local/var/mysql
--tmpdir=/tmp
2019-12-09T06:03:39.151987Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use
--explicit_defaults_for_timestamp server option (see documentation for more details). 2019-12-09T06:03:39.154025Z 0
[ERROR] --initialize specified but the data directory has files in it. Aborting. 2019-12-09T06:03:39.154074Z 0 [ERROR] Aborting
Trying to start mysql as root gives error:
[08:04:41][~/tmp]#sudo /usr/local/opt/mysql#5.7/bin/mysql.server start
Password: Starting MySQL ..... ERROR! The server quit without updating
PID file (/var/run/mysqld/mysqld.pid).
Banging head against wall for days now trying to follow StackOverflow posts MySql server startup error 'The server quit without updating PID file ', none of which is working ...
My my.cnf:
[mysqld]
# Only allow connections from localhost
#bind-address = 127.0.0.1
#SO posts said to comment out the above ...
pid-file = /var/run/mysqld/mysqld.pid #Checked, this folder + file exists, with write permissions
Try using a data dir away from the mysql directory i.e if mysql is in /usr/local/mysql, use the data dir as /var/data.
root#photon [ /var ]# /usr/local/mysql/bin/mysqld --initialize-insecure --user=mysql --datadir=/var/data
2020-02-22T21:42:27.121230Z 0 [System] [MY-013169] [Server] /usr/local/mysql/bin/mysqld (mysqld 8.0.19) initializing of server in progress as process 820
2020-02-22T21:42:35.018238Z 5 [Warning] [MY-010453] [Server] root#localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.

Why is Guard Livereload not starting the server?

I have setup Guard and Guar-Livereload on my new Rails project similarly on how I had on a previous one: Gemfile:
group :development do
gem 'spork-rails', '4.0.0'
gem 'guard-spork', '1.5.0'
gem 'childprocess'
gem "rspec-rails"
gem 'guard-livereload', require: false
gem 'spring'
gem "guard-rspec"
end
And in my Guardfile:
guard 'livereload' do
watch(%r{app/views/.+\.(erb|haml|slim)$})
watch(%r{app/helpers/.+\.rb})
watch(%r{app/assets/.+\.rb})
watch(%r{app/assets/.+\.(css|js|scss|jpg|png)})
watch(%r{public/.+\.(css|js|html)})
watch(%r{config/locales/.+\.yml})
# Rails Assets Pipeline
watch(%r{(app|vendor)(/assets/\w+/(.+\.(css|js|html|png|jpg))).*}) { |m| "/assets/#{m[3]}" }
end
Which was created after issuing the command guard init guard-livereload. When I issue guard I can see the following messages:
18:35:41 - INFO - Guard is using TerminalTitle to send notifications.
18:35:43 - INFO - Guard::RSpec is running
18:35:43 - INFO - LiveReload is waiting for a browser to connect.
18:35:43 - INFO - Guard is now watching at '/Volumes/volume/Users/myuser/Documents/RubyApps/myapp'
[1] guard(main)>
But the server doesn't start, however if I rails s the server will start and visible on the front end. This leads me to believe the issue is with Guard. Can anyone point me in the right direction?
Many thanks
EDIT Added console after running guard -d:
18:31:56 - DEBUG - Command execution: emacsclient --eval '1' 2> /dev/null || echo 'N/A'
18:31:56 - INFO - Guard is using TerminalTitle to send notifications.
18:31:57 - DEBUG - Command execution: hash stty
18:31:57 - DEBUG - Guard starts all plugins
18:31:57 - DEBUG - Hook :start_begin executed for Guard::RSpec
18:31:57 - INFO - Guard::RSpec is running
18:31:57 - DEBUG - Hook :start_end executed for Guard::RSpec
18:31:57 - DEBUG - Hook :start_begin executed for Guard::LiveReload
18:31:57 - DEBUG - Hook :start_end executed for Guard::LiveReload
18:31:57 - INFO - LiveReload is waiting for a browser to connect.
18:31:57 - INFO - Guard is now watching at '/Volumes/fenix/Users/wagner/Documents/htdocs/RubyApps/turing'
18:31:57 - DEBUG - Start interactor
18:31:57 - DEBUG - Command execution: stty -g 2>/dev/null`
look at #ec2's recent comment on this:
for livereload, run guard with the '-d' option (bundle exec guard -d) and you should see Hook :run_on_modifications_begin executed for Guard::LiveReload. Let us know if you get that message or not (next step depends on the answer). And of course, make sure livereload is actually turned on in your browser (I have to enable it every time I start the project) - ideally, just open a static html file in the browser, edit that file and check - it should work.

error installing openmeeting local system

I am installing openmeeting 3.0.1 in local machine. While installing i am facing following error. How to solve this issue?
WARN 05-30 16:29:27.879 o.a.o.d.d.b.ConfigurationDao:123 [org.springframework.scheduling.quartz.SchedulerFactoryBean#0_Worker-6] - Could not find key in configuration CONF_KEY: mail.smtp.timeout
DEBUG 05-30 16:29:27.879 o.a.o.q.s.TestSetupCleanupJob:34 [org.springframework.scheduling.quartz.SchedulerFactoryBean#0_Worker-5] - TestSetupClearJob.execute
DEBUG 05-30 16:29:27.880 o.a.o.m.MailHandler:258 [org.springframework.scheduling.quartz.SchedulerFactoryBean#0_Worker-6] - sendMails enter ...
DEBUG 05-30 16:29:28.114 o.a.o.m.MailHandler:260 [org.springframework.scheduling.quartz.SchedulerFactoryBean#0_Worker-6] - Number of emails in init queue 0
DEBUG 05-30 16:29:28.114 o.a.o.m.MailHandler:265 [org.springframework.scheduling.quartz.SchedulerFactoryBean#0_Worker-6] - ... sendMails done.
DEBUG 05-30 16:29:32.832 o.a.o.d.d.s.SessiondataDao:404 [org.springframework.scheduling.quartz.SchedulerFactoryBean#0_Worker-7] - ****** clearSessionTable:
Though I see you already found a solution one may also wish to try the following:
1. Go to the releases page: https://github.com/Red5/red5-server/releases
2. Download tarball: https://github.com/Red5/red5-server/releases/download/v1.0.5-RELEASE/red5-server-1.0.5-RELEASE-server.tar.gz (or you can use *.zip)
3. Extract it somewhere
4. Run red5.sh (red5.bat)
Also, installing sendmail as part of your prerequisite can also help with SNMP Key errors

live reload not working after upgrading yo grunt-cli bower

I Just built Nodejs and installed 0.10.6 then uninstalled yo+grunt-cli+bower+generator-webapp and reinstalled to latest using npm -g,
yo webapp
But now live reload doesnt work, cant see any errors either in chrome devtools
yo -v: 1.0beta5
grunt-cli v0.1.8 and grunt v0.4.1
bower -v: 0.9.2
node -v: 0.10.6
npm -v: 1.2.18
grunt server shows the watch task: time + the name of file changed
tried : changing the port number in Gruntfile to.. LIVERELOAD_PORT = 34729; nogo :(
my older webapp projects still work fine
Lost..
Thanks
--------------------- UPDATE
1. moved lrSnippet to 1st position in Grunfile.js
2. in index.js moved
end.call(res, res.data, encoding);
outside the if Block
Now it works Partially :
summary :
1. changes to index.html > reloads ok
2. changes to main.scss > reloads ok
3. changes to my.sass > Not OK
after 3rd step
1. changes to index.html > Not OK
2. changes to main.scss > Not OK
4. changes to hello.coffe > Not OK
After step 4
1. changes to index.html > ok
2. changes to main.scss > ok
//------------------------------------- index.html
Changes to index.html
reload ok
grunt server window logs change and issues reload command
grunt server window grab =
Running "watch" task
Waiting...OK
>> File "app/index.html" changed.
Running "watch" task
... Reload app/index.html ...
Completed in 0.002s at Sat May 18 2013 12:47:58 GMT+0530 (IST) - Waiting...
//------------------------------------- main.scss
Changes to main.scss
reload ok
grunt server window grab =
>> File "app/styles/main.scss" changed.
Running "compass:server" (compass) task
overwrite .tmp/styles/main.css
unchanged app/styles/my.sass
Running "watch" task
Completed in 1.906s at Sat May 18 2013 12:48:24 GMT+0530 (IST) - Waiting...
OK
>> File ".tmp/styles/main.css" changed.
Running "watch" task
... Reload .tmp/styles/main.css ...
Completed in 0.002s at Sat May 18 2013 12:48:24 GMT+0530 (IST) - Waiting...
//------------------------------------- my.sass
changes to my.sass
reload not ok (not reloading)
grunt server window grab =
Running "watch" task
Waiting...OK
>> File "app/styles/my.sass" changed.
Running "compass:server" (compass) task
unchanged app/styles/main.scss
unchanged .tmp/images/generated/design-s65ab268e46.png
overwrite .tmp/styles/my.css
Running "watch" task
Completed in 0.602s at Sat May 18 2013 13:00:19 GMT+0530 (IST) - Waiting...
//-------------------------------------
After the my.sass is changed
changes made to index.html or main.scss r not shown in grunt server window
the Watch command doesnt log anything.
changes r not reloaded
//-------------------------------------
Restarted Grunt Server
//------------------------------------- hello.coffee
grunt server window grab =
OK
>> File "app/scripts/hello.coffee" changed.
Running "coffee:dist" (coffee) task
File .tmp/scripts/hello.js created.
Running "watch" task
Completed in 0.011s at Sat May 18 2013 13:34:56 GMT+0530 (IST) - Waiting...
//-------------------------------------
There is a bug with the current livereload/yo setup. Here are the details alongside a fix for the problematic dependency (connect-livereload).
https://github.com/yeoman/generator-webapp/issues/63
Three things which you can make sure to diagnose the issue further.
Make sure you're on the latest version npm update -g yo
You shouldn't be using LiveReload plugin explicitly, it conflicts with Yeoman watch command while running
Your port (in gruntfile.js) might be using by some other process, try to exit from the terminal, change the port and it see it works or not.
The problem is yeoman doesn't change the port automatically in the current version, that's where it stopped working if you close it forcefully in the current terminal session.
The same issue has been discussed here - https://github.com/yeoman/yeoman/issues/938
If you still see the issue then try to run the following command and past the output here.
yo --version && echo $PATH $NODE_PATH && node -e 'console.log(process.platform, process.versions)' && cat Gruntfile.js
A commit was made to solve this problem.
https://github.com/yeoman/generator-webapp/pull/67
We'll see an update soon I guess.
in the meantime what you can do is modify your Gruntfile.js. Look near the line 61 for the connect option for livereload and replace the configuration for this snippet.
livereload: {
options: {
middleware: function (connect) {
return [
lrSnippet,
mountFolder(connect, '.tmp'),
mountFolder(connect, yeomanConfig.app)
];
}
}
},
Also, is a good idea to update the module connect-livereload to 0.1.4.
Just run npm install connect-livereload on your project directory.
I added live reload as an option under watch in the Gruntfile.js:
watch: {
options: {
nospawn: true,
livereload: true
},
Setting the livereload:port instead of livereload:options:port worked for me:
livereload: {
port: 35728
}

Why is guard stopping?

I have a rails application that I just threw guard and minitest and my gaurd file is
guard 'minitest', :cli => '--drb --format doc --color' do
# with Minitest::Unit
watch(%r|^test/(.*)\/?test_(.*)\.rb|)
watch(%r|^lib/(.*)([^/]+)\.rb|) { |m| "test/#{m[1]}test_#{m[2]}.rb" }
watch(%r|^test/test_helper\.rb|) { "test" }
# Rails
watch(%r|^app/controllers/(.*)\.rb|) { |m| "test/functional/#{m[1]}_test.rb" }
watch(%r|^app/helpers/(.*)\.rb|) { |m| "test/helpers/#{m[1]}_test.rb" }
watch(%r|^app/models/(.*)\.rb|) { |m| "test/unit/#{m[1]}_test.rb" }
end
but when i run guard i get a command prompt
bundle exec guard
22:14:12 - INFO - Guard uses TerminalTitle to send notifications.
22:14:12 - INFO - Guard is now watching at '/Users/trace/Sites/application'
1.9.3 (main):0 > 2 + 2
=> 4
Why am i getting this prompt. Any ideas... here are some of the gems i am using
UPDATE...
when i run all minitest then the tests run...but why do i have to run that...any ideas
What your seeing is the Guard interactor, which makes use of Pry. Normally the prompt looks a bit different, so I assume you've a ~/.pryrc file with some configuration. With Guard 1.5.3, released yesterday, Guard ignores ~/.pryrc and only evaluates ~/.guardrc for the Pry configuration, so the normal Pry configuration is separated from the Guard Pry interactor.
When you're seeing this prompt, it means that Guard is waiting and has nothing to do. You can now start working and Guard automatically starts testing your app with minitest according to your file modifications and watcher configuration, or you can manually trigger an action.
You can get a list of the available actions with help guard. Some commands are generated depending on your Guard plugins and groups within your Guardfile. Here's an example of one of my projects:
$ bundle exec guard
09:58:14 - INFO - Guard uses GNTP to send notifications.
09:58:14 - INFO - Guard is now watching at '/Users/michi/Repositories/extranett'
09:58:15 - INFO - Guard::Jasmine starts Unicorn test server on port 8888 in development environment.
09:58:17 - INFO - Waiting for Jasmine test runner at http://dnndev.me:8888/jasmine
09:58:23 - INFO - Run all Jasmine suites
09:58:23 - INFO - Run Jasmine suite at http://dnndev.me:8888/jasmine
09:58:41 - INFO - Finished in 8.853 seconds
09:58:41 - INFO - 896 specs, 0 failures
09:58:41 - INFO - Done.
09:58:41 - INFO - Guard::RSpec is running
09:58:41 - INFO - LiveReload 1.6 is waiting for a browser to connect.
[1] guard(main)> help guard
Guard
all Run all plugins.
backend Run all backend
change Trigger a file change.
coffeescript Run all coffeescript
frontend Run all frontend
jasmine Run all jasmine
livereload Run all livereload
notification Toggles the notifications.
pause Toggles the file listener.
reload Reload all plugins.
rspec Run all rspec
show Show all Guard plugins.
[2] guard(main)> exit
09:59:39 - INFO - Guard::Jasmine stops server.
09:59:39 - INFO - Bye bye...

Resources