Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

`<class:GlobalConfig>': uninitialized constant DockerSync::GlobalConfig::DateTime (NameError) #509

Closed
facine opened this issue Dec 1, 2017 · 14 comments

Comments

@facine
Copy link
Contributor

facine commented Dec 1, 2017

I get this error trying to use docker-sync.

Error/Feature Requestion/Docs

$docker-sync-stack start
/Users/facine/.rvm/gems/ruby-2.4.2/gems/docker-sync-0.5.1/lib/docker-sync/config/global_config.rb:15:in `<class:GlobalConfig>': uninitialized constant DockerSync::GlobalConfig::DateTime (NameError)
	from /Users/facine/.rvm/gems/ruby-2.4.2/gems/docker-sync-0.5.1/lib/docker-sync/config/global_config.rb:8:in `<module:DockerSync>'
	from /Users/facine/.rvm/gems/ruby-2.4.2/gems/docker-sync-0.5.1/lib/docker-sync/config/global_config.rb:7:in `<top (required)>'
	from /Users/facine/.rvm/rubies/ruby-2.4.2/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /Users/facine/.rvm/rubies/ruby-2.4.2/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /Users/facine/.rvm/gems/ruby-2.4.2/gems/docker-sync-0.5.1/lib/docker-sync/update_check.rb:3:in `<top (required)>'
	from /Users/facine/.rvm/rubies/ruby-2.4.2/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /Users/facine/.rvm/rubies/ruby-2.4.2/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /Users/facine/.rvm/gems/ruby-2.4.2/gems/docker-sync-0.5.1/bin/docker-sync-stack:7:in `<top (required)>'
	from /Users/facine/.rvm/gems/ruby-2.4.2/bin/docker-sync-stack:23:in `load'
	from /Users/facine/.rvm/gems/ruby-2.4.2/bin/docker-sync-stack:23:in `<main>'
	from /Users/facine/.rvm/gems/ruby-2.4.2/bin/ruby_executable_hooks:15:in `eval'
	from /Users/facine/.rvm/gems/ruby-2.4.2/bin/ruby_executable_hooks:15:in `<main>'

Docker Driver

docker-machine

Sync strategy

native_osx

your docker-sync.yml

version: 2
options:
  compose-file-path: docker-compose.yml
syncs:
  docker-project-html-sync:
    src: ../
    sync_userid: 3000
    sync_host_port: 10872
    sync_excludes: ['docker', '.idea', '.DS_Store']

OS

macOS High Sierra (10.13.1)

@EugenMayer
Copy link
Owner

you global config seems to be damaged somehow, please run rm ~/.docker-sync-global.yml and try again.

@facine
Copy link
Contributor Author

facine commented Dec 1, 2017

Same...
My steps:
$ rm ~/.docker-sync-global.yml
$ docker-compose build
$ docker-sync-stack start

@EugenMayer
Copy link
Owner

cat ~/.docker-sync-global.yml

@EugenMayer
Copy link
Owner

@facine
Copy link
Contributor Author

facine commented Dec 1, 2017

$ cat ~/.docker-sync-global.yml
cat: /Users/facine/.docker-sync-global.yml: No such file or directory

Also I've tried:
$ gem uninstall docker-sync
$ gem install docker-sync

@EugenMayer
Copy link
Owner

we probably just miss the require?

require 'date' ?

@EugenMayer
Copy link
Owner

please clone https://github.com/EugenMayer/docker-sync

and run

gem uninstall dwm
cd repo
./deploy_locally.sh

Lets see if f37767a fixes it for you

@facine
Copy link
Contributor Author

facine commented Dec 1, 2017

Hi, you have a typo: #510

Now works fine!
Thanks!

@EugenMayer
Copy link
Owner

Great, good catch. Will release 0.5.2 soonish due to that

@EugenMayer EugenMayer added this to the 0.5.2 bugfixing milestone Dec 1, 2017
@MatthiasKuehneEllerhold
Copy link

MatthiasKuehneEllerhold commented Dec 4, 2017

Please release the hotfix fast. Ive updated to 0.5.1 and nothing works anymore. Even downgrading to 0.5.0 or 0.4.6 throws the same error:

/usr/local/lib/ruby/gems/2.4.0/gems/docker-sync-0.4.6/lib/docker-sync/config/global_config.rb:15:in `<class:GlobalConfig>': uninitialized constant DockerSync::GlobalConfig::DateTime (NameError)
	from /usr/local/lib/ruby/gems/2.4.0/gems/docker-sync-0.4.6/lib/docker-sync/config/global_config.rb:8:in `<module:DockerSync>'
	from /usr/local/lib/ruby/gems/2.4.0/gems/docker-sync-0.4.6/lib/docker-sync/config/global_config.rb:7:in `<top (required)>'
	from /usr/local/Cellar/ruby/2.4.2_1/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /usr/local/Cellar/ruby/2.4.2_1/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /usr/local/lib/ruby/gems/2.4.0/gems/docker-sync-0.4.6/lib/docker-sync/update_check.rb:3:in `<top (required)>'
	from /usr/local/Cellar/ruby/2.4.2_1/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /usr/local/Cellar/ruby/2.4.2_1/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /usr/local/lib/ruby/gems/2.4.0/gems/docker-sync-0.4.6/bin/docker-sync:7:in `<top (required)>'
	from /usr/local/bin/docker-sync:23:in `load'
	from /usr/local/bin/docker-sync:23:in `<main>'

I've tried fiddling with the config file "~/.docker-sync-global.yml" to no avail.

Installing master fixed the problem.

@EugenMayer
Copy link
Owner

@MatthiasKuehneEllerhold that issue was not introduced with 0.5.1, it was there since the early betas - i rather fixed on similar missing include in 0.5.1 but that one was not discovered yet.

0.5.2 released just right now, thank you fro the feedback

@MatthiasKuehneEllerhold
Copy link

0.5.2 works! Thanks for the fix!

@vishnun
Copy link

vishnun commented Jan 7, 2022

Getting the same error for a recent version. Just started using docker-sync and it didn't work

/.rvm/gems/ruby-3.0.0/gems/docker-sync-0.0.11/lib/config.rb:18:in `global_config': uninitialized constant DockerSyncConfig::DateTime (NameError)
	from /Users/vishnunarang/.rvm/gems/ruby-3.0.0/gems/docker-sync-0.0.11/lib/update_check.rb:10:in `initialize'
	from /Users/vishnunarang/.rvm/gems/ruby-3.0.0/gems/docker-sync-0.0.11/tasks/sync/sync.thor:16:in `new'
	from /Users/vishnunarang/.rvm/gems/ruby-3.0.0/gems/docker-sync-0.0.11/tasks/sync/sync.thor:16:in `start'
	from /Users/vishnunarang/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
	from /Users/vishnunarang/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
	from /Users/vishnunarang/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
	from /Users/vishnunarang/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'
	from /Users/vishnunarang/.rvm/gems/ruby-3.0.0/gems/docker-sync-0.0.11/bin/docker-sync:12:in `<top (required)>'
	from /Users/vishnunarang/.rvm/gems/ruby-3.0.0/bin/docker-sync:25:in `load'
	from /Users/vishnunarang/.rvm/gems/ruby-3.0.0/bin/docker-sync:25:in `<main>'
	from /Users/vishnunarang/.rvm/gems/ruby-3.0.0/bin/ruby_executable_hooks:22:in `eval'
	from /Users/vishnunarang/.rvm/gems/ruby-3.0.0/bin/ruby_executable_hooks:22:in `<main>'

@EugenMayer
Copy link
Owner

We are not ruby 3 compatible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants