firebase-ruby
firebase-ruby copied to clipboard
cannot require 'firebase' after bundle install gem 'firebase'
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?
+1
What happens when you run bundle show firebase
?
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.
Did you restart your Rails server?
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?
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:in
rescue in require' from /usr/local/rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:39:inrequire' from update_unread_messages.rb:1:in
'
But they are installed correctly:
gem list firebase
*** LOCAL GEMS ***
firebase (0.2.3)
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
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
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
If i run specs with Guard on my machine there is also appears that error
NameError: uninitialized constant Firebase::Client
@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.
NameError: uninitialized constant Firebase::Client
I can able to load fiebase gem through console
require firebase
Firebase::Client
I appreciate any answers
Try this:
- Go to your Gemfile and add:
gem 'firebase', '0.2.8'
- 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.