firebase-ruby icon indicating copy to clipboard operation
firebase-ruby copied to clipboard

cannot require 'firebase' after bundle install gem 'firebase'

Open timfong888 opened this issue 10 years ago • 13 comments

Hi, I have a Gemfile with: gem 'firebase'

after bundle install, when I type:

require 'firebase'

I get:

irb(main):001:0> require 'firebase'
LoadError: cannot load such file -- firebase

This process works for other gems....am I missing something?

timfong888 avatar Oct 07 '14 16:10 timfong888

+1

se6wagner avatar Dec 03 '14 11:12 se6wagner

What happens when you run bundle show firebase?

stevenpetryk avatar Dec 21 '14 15:12 stevenpetryk

Thanks for now we switched to a different online database and cache. 

[email protected] Sent from phone

On Sun, Dec 21, 2014 at 7:17 AM -0800, "Steven Petryk" [email protected] wrote:

What happens when you run bundle show firebase?

— Reply to this email directly or view it on GitHub.

timfong888 avatar Dec 21 '14 18:12 timfong888

Did you restart your Rails server?

wbeange avatar Jan 20 '15 03:01 wbeange

I'm having the same issue. Here's my output:

bundle install Using httpclient 2.6.0.1 Using json 1.8.2 Using firebase 0.2.3 Using bundler 1.8.3 Bundle complete! 1 Gemfile dependency, 4 gems now installed. Use bundle show [gemname] to see where a bundled gem is installed.

bundle show firebase /var/lib/gems/1.8/gems/firebase-0.2.3

irb irb(main):001:0> require 'firebase' LoadError: no such file to load -- firebase from (irb):1:in `require' from (irb):1 from :0 irb(main):002:0>

Can anybody help with this?

markdrake avatar Mar 05 '15 22:03 markdrake

I've tried the same with RVM and the latest stable ruby 2.2.0p0 and I still get the error but with more information:

/usr/local/rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in require': cannot load such file -- firebase (LoadError) from /usr/local/rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:inrescue in require' from /usr/local/rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:39:in require' from update_unread_messages.rb:1:in

'

But they are installed correctly:

gem list firebase

*** LOCAL GEMS ***

firebase (0.2.3)

markdrake avatar Mar 05 '15 22:03 markdrake

Loading development environment (Rails 4.2.2)
[1] pry(main)> require 'firebase'
=> false
[2] pry(main)> Firebase::Client
=> Firebase::Client
 → irb
irb(main):001:0> require 'firebase'
=> true
irb(main):002:0> Firebase::Client
=> Firebase::Client

It works in local development and test envs, but when i run build in GitLab CI it fails with NameError: uninitialized constant Firebase::Client when app is running specs

artem-russkikh avatar Aug 10 '15 20:08 artem-russkikh

Hi! Having the same behaviour. Local: Ruby 2.2.2 installed via Rbenv in Ubuntu 14.04

$ gem list firebase

*** LOCAL GEMS ***

firebase (0.2.4)
$ rails c
Loading development environment (Rails 4.2.2)
[1] pry(main)> Firebase::Client
=> Firebase::Client

rails test environment:

rails c -e test
Loading test environment (Rails 4.2.2)
[1] pry(main)> Firebase::Client
=> Firebase::Client

All working locally.

But in GitLab-CI with GitLab-CI-multi-runner: System-wide ruby 2.2.2 installed in Docker-image based on Ubuntu.14.04, where ci-runner launches all test-jobs. In each test-job bundler installs all gems into cross-containers shared '/cache' directory, and there is firebase gem too. form ci-job log:

bundle install --without production development --jobs $(nproc)  --path /cache
...
Using rake 10.4.2
Using i18n 0.7.0
...
Using httpclient 2.6.0.1
Using firebase 0.2.4
Using foreman 0.78.0
...
Bundle complete! 48 Gemfile dependencies, 118 gems now installed.
Gems in the groups production and development were not installed.
Bundled gems are installed into /cache.
gem list firebase

gem list bundler
bundler (1.10.6, 1.10.5)
bundle exec brakeman -z
...

So, gem list firebase shows nothing. And of course it will give NameError: uninitialized constant Firebase::Client in spec test-job

esergion avatar Aug 12 '15 07:08 esergion

Added bundle show command to test-job script:

...
bundle show firebase
/cache/ruby/2.2.0/gems/firebase-0.2.4
bundle show airbrake
/cache/ruby/2.2.0/gems/airbrake-4.3.0
bundle exec brakeman -z
...

But in test:

      NameError:
        uninitialized constant Firebase::Client

esergion avatar Aug 12 '15 07:08 esergion

If i run specs with Guard on my machine there is also appears that error

NameError: uninitialized constant Firebase::Client

artem-russkikh avatar Aug 13 '15 15:08 artem-russkikh

@esergion still seeing this problem? Any chance you could help us reproduce with a simpler set of instructions? I'm unaware of firebase-ruby doing anything weird as a gem package, but I didn't set that part up.

vincentwoo avatar Nov 19 '15 13:11 vincentwoo

NameError: uninitialized constant Firebase::Client

I can able to load fiebase gem through console require firebase Firebase::Client

I appreciate any answers

khamroddin avatar Aug 14 '18 08:08 khamroddin

Try this:

  1. Go to your Gemfile and add: gem 'firebase', '0.2.8'
  2. Go to your terminal and run bundle install

Don't forget to use require 'firebase' before call Firebase::Client.

That's it! It works for me.

caioabreu2 avatar Jan 26 '19 01:01 caioabreu2