EugenMayer / docker-sync

Run your application at full speed while syncing your code for development, finally empowering you to utilize docker for development under OSX/Windows/*Linux
GNU General Public License v3.0
3.54k stars 290 forks source link

Detect if docker-sync has been installed as root - ask for sudo or warn #501

Closed zedtux closed 6 years ago

zedtux commented 6 years ago

Error

$ docker-sync-stack start
          ok  Checking if a newer native_osx (unison:hostsync_0.2) image is available
          ok  No newer image found - current image is up to date.
          ok  Checking if a newer unison image is available
          ok  No newer image found - current image is up to date.
          ok  Checking if a newer rsync image is available
          ok  No newer image found - current image is up to date.
     warning  There is an update (0.5.0) available (current version 0.4.6
). Please update before you continue
Shall I update docker-sync to 0.5.0 for you? yes
Updating installed gems
Updating docker-sync
Fetching: docker-compose-1.1.7.gem (100%)
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory.
     success  Successfully updated, please restart docker-sync and check the changelog at https://github.com/EugenMayer/docker-sync/wiki/5.-Changelog

I have then installed manually the docker-compose gem using sudo but I'm not sure if this is enough to finish the update?

Docker Driver

d4m

Sync strategy

default

OS

macOS High Sierra 10.13.2 Beta (17C76a)

EugenMayer commented 6 years ago

thats not a docker-sync issue, rahter a local installation with rbenv / whatever you used - you simply have installed docker-sync using sudo, but updating using the normal user

zedtux commented 6 years ago

I know about that, the reason of my issue (and sorry to not have been more clear) is to check if the docker-sync update process could better manage this case.

To options in my eyes:

EugenMayer commented 6 years ago

Well i am honest about that, that is just out of scope. Covering any little detail about how gems could have been detailed and layered would easily create a lot of code hard to maintain.

How to upgrade gems should be in any developers mind, like npm modules. And if the auto-update helper does not make the job, you can still run sudo gem update docker-sync

Still, i fully understand the inconvenience here and that in general, we could make it easier. If you have a simple way of doing both, your PR is welcome. I rather think, we should not jump onto that, or the expectations on how much effort you need to use this tool will grow a lot. Still, open to any PR.

zedtux commented 6 years ago

Okay I understand, thank you @EugenMayer