cesarferreira/alfi

Uninitialized constant Alfi::Providers::Base (NameError)

Closed this issue ยท 7 comments

I have just installed alfi with rvm all do gem install alfi when I try to use it I receive an error:

$HOME/.rvm/gems/ruby-2.3.0/gems/alfi-0.4.3/lib/alfi/providers/bintray.rb:1:in `<top (required)>': uninitialized constant Alfi::Providers::Base (NameError)
    from $HOME/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from $HOME/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from $HOME/.rvm/gems/ruby-2.3.0/gems/alfi-0.4.3/lib/alfi.rb:10:in `block in <top (required)>'
    from $HOME/.rvm/gems/ruby-2.3.0/gems/alfi-0.4.3/lib/alfi.rb:10:in `each'
    from $HOME/.rvm/gems/ruby-2.3.0/gems/alfi-0.4.3/lib/alfi.rb:10:in `<top (required)>'
    from $HOME/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from $HOME/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from $HOME/.rvm/gems/ruby-2.3.0/gems/alfi-0.4.3/bin/alfi:3:in `<top (required)>'
    from $HOME/.rvm/gems/ruby-2.3.0/bin/alfi:23:in `load'
    from $HOME/.rvm/gems/ruby-2.3.0/bin/alfi:23:in `<main>'
    from $HOME/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `eval'
    from $HOME/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `<main>'

Could you tell me what am I doing wrong?

Just removed my alfi gem, and did the rvm all do gem install alfi and it works fine, I'm also on ruby 2.3

$ ruby -v
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin14]

I've never came across this.. ๐Ÿ˜ž

ok, thanks for responding

Additional information:

My team mate uses OSX and it works on his machine. I use Ubuntu 14.04.
I replicated this issue on ruby versions starting from 2.1 to 2.3.

$ ruby -v
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]

It is also not a matter of wrong rvm/ruby/gem configuration because other executable gems works correctly.

I am a total newbie in ruby. Just hoping that one day someone better than me will face the same problem ;)

I'm facing the same problem and i executed the command "rvm all do gem install alfi" and the problem still remains! How can i solve it?

@cesarferreira We should try to load base provider first, I think problem could be in that.
File alfi.rb:

...
require 'alfi/providers'
require 'alfi/providers/base'
...

It looks like you're right @ivan-leschinsky ๐Ÿ‘
just released alfi 0.4.4 to rubygems.org., let me know if it fixed it for you guys

Works perfect. Thank you all very much.