Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
timfong888 opened this issue Oct 7, 2014 · 13 comments
Open

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

timfong888 opened this issue Oct 7, 2014 · 13 comments

Comments

@timfong888
Copy link

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?

@se6wagner
Copy link

+1

@stevenpetryk
Copy link

What happens when you run bundle show firebase?

@timfong888
Copy link
Author

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.

@wbeange
Copy link

wbeange commented Jan 20, 2015

Did you restart your Rails server?

@markdrake
Copy link

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
Copy link

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)

@artem-russkikh
Copy link

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

@esergion
Copy link

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
Copy link

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

@artem-russkikh
Copy link

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

NameError: uninitialized constant Firebase::Client

@vincentwoo
Copy link
Collaborator

@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.

@khamroddin
Copy link

NameError: uninitialized constant Firebase::Client

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

I appreciate any answers

@caioabreu2
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants