Directory names in OSX — Listen Gem

Fermín Alejandro Moreno C.
2 min readNov 3, 2016

--

For the past couple of months I’ve been working in a project with Ruby on Rails and last week I found myself in the need of installing PostgreSQL. Somehow while doing so, I messed up with the directories in my computer. Next thing I know is that my rails local server wasn’t starting and this crash was appearing every time I tried to start it:

E, [2016–11–01T00:07:41.403919 #87513] ERROR — : fsevent: running worker failed: different prefix: “” and “/Users/ferminmoreno/Documents/LDAW:AMS/CourseHandler/CECEQ/CourseHandler/app/controllers”:/Users/ferminmoreno/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/pathname.rb:520:in `relative_path_from’/Users/ferminmoreno/.rvm/gems/ruby-2.3.0/gems/listen-3.0.8/lib/listen/adapter/darwin.rb:61:in `block in _process_event’/Users/ferminmoreno/.rvm/gems/ruby-2.3.0/gems/listen-3.0.8/lib/listen/adapter/darwin.rb:57:in `each’/Users/ferminmoreno/.rvm/gems/ruby-2.3.0/gems/listen-3.0.8/lib/listen/adapter/darwin.rb:57:in `_process_event’/Users/ferminmoreno/.rvm/gems/ruby-2.3.0/gems/listen-3.0.8/lib/listen/adapter/base.rb:42:in `block (2 levels) in configure’/Users/ferminmoreno/.rvm/gems/ruby-2.3.0/gems/rb-fsevent-0.9.7/lib/rb-fsevent/fsevent.rb:45:in `run’/Users/ferminmoreno/.rvm/gems/ruby-2.3.0/gems/listen-3.0.8/lib/listen/adapter/darwin.rb:68:in `_run_worker’/Users/ferminmoreno/.rvm/gems/ruby-2.3.0/gems/listen-3.0.8/lib/listen/adapter/darwin.rb:77:in `block (2 levels) in _run_workers_in_background’/Users/ferminmoreno/.rvm/gems/ruby-2.3.0/gems/listen-3.0.8/lib/listen/internals/thread_pool.rb:6:in `block in add’ called from: /Users/ferminmoreno/.rvm/gems/ruby-2.3.0/gems/listen-3.0.8/lib/listen/adapter/darwin.rb:67:in `_run_worker’/Users/ferminmoreno/.rvm/gems/ruby-2.3.0/gems/listen-3.0.8/lib/listen/adapter/darwin.rb:77:in `block (2 levels) in _run_workers_in_background’/Users/ferminmoreno/.rvm/gems/ruby-2.3.0/gems/listen-3.0.8/lib/listen/internals/thread_pool.rb:6:in `block in add’

After doing some research I found out that this bug is caused by a directory with a colon in its name. In my case such directory was LDAW:AMS. The colon creates a conflict while trying to read the directory path, causing it to be read as a relative path, which, in turn, creates a conflict with the gem listen, that always expects absolute paths. My workaround over this problem was pretty simple, all I did was change the name of my directory LDAW/AMS, which got converted into LDAW:AMS in the console line, to LDAW-AMS.

Source:

--

--