alki-project / alki

Dependency Injection for Ruby
http://alki.io
MIT License
28 stars 1 forks source link

Alki::Loader::LoaderError on all use #1

Closed pushcx closed 5 years ago

pushcx commented 6 years ago

I'm trying to get an executable working with code reloading, but get an exception on startup.

I went to put together a minimal testcase and realized that alki-examples/fizzbuzz is one. So, with Ruby 2.5.1 on Linux I cloned that repo and reproduced the error:

~/alki-examples/fizzbuzz:master= $ bundle exec bin/fizzbuzz 
bundler: failed to load command: bin/fizzbuzz (bin/fizzbuzz)
Alki::Loader::LoaderError: Path not registered with name or in $LOAD_PATH /opt/gem/ruby/2.5.1/gems/alki-0.13.3/lib/alki/assembly/types/group.rb
  /opt/gem/ruby/2.5.1/gems/alki-loader-0.2.3/lib/alki/loader.rb:37:in `build'
  /opt/gem/ruby/2.5.1/gems/alki-loader-0.2.3/lib/alki/loader/core_ext/kernel.rb:18:in `Alki'
  /opt/gem/ruby/2.5.1/gems/alki-0.13.3/lib/alki/assembly/types/group.rb:1:in `<top (required)>'
  /opt/gem/ruby/2.5.1/gems/alki-loader-0.2.3/lib/alki/loader/core_ext/kernel.rb:5:in `require'
  /opt/gem/ruby/2.5.1/gems/alki-loader-0.2.3/lib/alki/loader/core_ext/kernel.rb:5:in `require'
  /opt/gem/ruby/2.5.1/gems/alki-support-0.7.0/lib/alki/support.rb:11:in `load'
  /opt/gem/ruby/2.5.1/gems/alki-support-0.7.0/lib/alki/support.rb:5:in `load'
  /opt/gem/ruby/2.5.1/gems/alki-0.13.3/lib/alki/assembly/types.rb:5:in `build'
  /opt/gem/ruby/2.5.1/gems/alki-0.13.3/lib/alki/override_builder.rb:40:in `build_type'
  /opt/gem/ruby/2.5.1/gems/alki-0.13.3/lib/alki/override_builder.rb:16:in `build'
  /opt/gem/ruby/2.5.1/gems/alki-0.13.3/lib/alki/assembly.rb:7:in `new'
  bin/fizzbuzz:7:in `<top (required)>'
medlefsen commented 6 years ago

Thanks for the issue report.

Which Linux distribution and version are you using? Also, is the Ruby you're using the system ruby or installed via a ruby manager such as RVM or Rbenv?

pushcx commented 6 years ago

ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux] on Arch Linux. I installed it with ruby-install.

medlefsen commented 6 years ago

I think I may have identified the issue. I can reproduce when the directory in $LOAD_PATH contains a symlink. Is that the case for you?

pushcx commented 6 years ago

Yep. My GEM_HOME is a symlink to the /opt path you see above.

medlefsen commented 6 years ago

I've pushed version 0.2.5 of alki-loader to rubygems which should fix your problem. Please let me know if that fixes it, and if you have any other problems.

Thanks

pushcx commented 5 years ago

Just tried to test this and ran into an issue, I think something didn't get pushed. (Sorry for the slow response; I traveled last week to start a new job and it stomped on my project time.)

$ bundle
Fetching gem metadata from https://rubygems.org/.........
Could not find alki-dsl-0.6.1 in any of the sources
medlefsen commented 5 years ago

I've pushed an update for alki-examples that fixes the Gemfile.lock. If you do a pull and retest it should work for you. Thanks!

pushcx commented 5 years ago

It worked, yep. Thanks, I'm going to start digging in over the next few days.