decision-labs / gcm

A gem that helps developers send data from ruby backend servers to their Mobile applications on devices via Google Cloud Messaging (GCM).
MIT License
385 stars 61 forks source link

Can't open my rails console after adding 'gcm' to Gemfile #16

Closed shivakumaarmgs closed 9 years ago

shivakumaarmgs commented 10 years ago
/home/shivakumaarmgs/.rvm/gems/ruby-2.1.1/gems/gcm-0.0.9/lib/gcm.rb:5:in `<top (required)>': GCM is not a class (TypeError)
    from /home/shivakumaarmgs/.rvm/gems/ruby-2.1.1@global/gems/bundler-1.7.3/lib/bundler/runtime.rb:76:in `require'
    from /home/shivakumaarmgs/.rvm/gems/ruby-2.1.1@global/gems/bundler-1.7.3/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
    from /home/shivakumaarmgs/.rvm/gems/ruby-2.1.1@global/gems/bundler-1.7.3/lib/bundler/runtime.rb:72:in `each'
    from /home/shivakumaarmgs/.rvm/gems/ruby-2.1.1@global/gems/bundler-1.7.3/lib/bundler/runtime.rb:72:in `block in require'
    from /home/shivakumaarmgs/.rvm/gems/ruby-2.1.1@global/gems/bundler-1.7.3/lib/bundler/runtime.rb:61:in `each'
    from /home/shivakumaarmgs/.rvm/gems/ruby-2.1.1@global/gems/bundler-1.7.3/lib/bundler/runtime.rb:61:in `require'
    from /home/shivakumaarmgs/.rvm/gems/ruby-2.1.1@global/gems/bundler-1.7.3/lib/bundler.rb:133:in `require'
    from /home/shivakumaarmgs/Rails/PCA/config/application.rb:15:in `<top (required)>'
    from /home/shivakumaarmgs/.rvm/gems/ruby-2.1.1/gems/railties-4.1.0/lib/rails/commands/commands_tasks.rb:146:in `require'
    from /home/shivakumaarmgs/.rvm/gems/ruby-2.1.1/gems/railties-4.1.0/lib/rails/commands/commands_tasks.rb:146:in `require_application_and_environment!'
    from /home/shivakumaarmgs/.rvm/gems/ruby-2.1.1/gems/railties-4.1.0/lib/rails/commands/commands_tasks.rb:68:in `console'
    from /home/shivakumaarmgs/.rvm/gems/ruby-2.1.1/gems/railties-4.1.0/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
    from /home/shivakumaarmgs/.rvm/gems/ruby-2.1.1/gems/railties-4.1.0/lib/rails/commands.rb:17:in `<top (required)>'
    from bin/rails:4:in `require'
    from bin/rails:4:in `<main>'
kashif commented 10 years ago

thanks for the report @shivakumaarmgs. I am having a look. Can you check if it works with the previous version?

shivakumaarmgs commented 10 years ago

Switched to 0.0.8 but getting the same error.

/home/shivakumaarmgs/.rvm/gems/ruby-2.1.1/gems/gcm-0.0.8/lib/gcm.rb:5:in `<top (required)>': GCM is not a class (TypeError)
    from /home/shivakumaarmgs/.rvm/gems/ruby-2.1.1@global/gems/bundler-1.7.3/lib/bundler/runtime.rb:76:in `require'
    from /home/shivakumaarmgs/.rvm/gems/ruby-2.1.1@global/gems/bundler-1.7.3/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
    from /home/shivakumaarmgs/.rvm/gems/ruby-2.1.1@global/gems/bundler-1.7.3/lib/bundler/runtime.rb:72:in `each'
    from /home/shivakumaarmgs/.rvm/gems/ruby-2.1.1@global/gems/bundler-1.7.3/lib/bundler/runtime.rb:72:in `block in require'
    from /home/shivakumaarmgs/.rvm/gems/ruby-2.1.1@global/gems/bundler-1.7.3/lib/bundler/runtime.rb:61:in `each'
    from /home/shivakumaarmgs/.rvm/gems/ruby-2.1.1@global/gems/bundler-1.7.3/lib/bundler/runtime.rb:61:in `require'
    from /home/shivakumaarmgs/.rvm/gems/ruby-2.1.1@global/gems/bundler-1.7.3/lib/bundler.rb:133:in `require'
    from /home/shivakumaarmgs/Rails/PCA/config/application.rb:15:in `<top (required)>'
    from /home/shivakumaarmgs/.rvm/gems/ruby-2.1.1/gems/railties-4.1.0/lib/rails/commands/commands_tasks.rb:146:in `require'
    from /home/shivakumaarmgs/.rvm/gems/ruby-2.1.1/gems/railties-4.1.0/lib/rails/commands/commands_tasks.rb:146:in `require_application_and_environment!'
    from /home/shivakumaarmgs/.rvm/gems/ruby-2.1.1/gems/railties-4.1.0/lib/rails/commands/commands_tasks.rb:68:in `console'
    from /home/shivakumaarmgs/.rvm/gems/ruby-2.1.1/gems/railties-4.1.0/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
    from /home/shivakumaarmgs/.rvm/gems/ruby-2.1.1/gems/railties-4.1.0/lib/rails/commands.rb:17:in `<top (required)>'
    from bin/rails:4:in `require'
    from bin/rails:4:in `<main>'
kashif commented 10 years ago

ok @shivakumaarmgs so what is in line 15 of your config/application.rb ?

shivakumaarmgs commented 10 years ago

In the line 15 of application.rb, I have the following Bundler.require(*Rails.groups)

kashif commented 10 years ago

and you just added gcm to the Gemfile and did a bundle install and then bundle exec rails c ? I tried this on an empty rails project and all is fine...

shivakumaarmgs commented 10 years ago

Yeah, Is its just me getting this error? I tried adding require 'gcm' at the top of application.rb, doesn't help though.

kaneda commented 10 years ago

@shivakumaarmgs / @kashif I can't help but notice /home/shivakumaarmgs/.rvm/gems/ruby-2.1.1/gems/gcm-0.0.9/lib/gcm.rb, I'd expect this to be read out of the vendors folder of your project instead of on the system (in this case through rvm)

rohandey commented 9 years ago

faced this today .. workaround for me in your gemfile do this gem 'gcm', :require => false

include this line where you want to use it require 'gcm'

kaneda commented 9 years ago

@rohandey I had assumed that they'd want to test GCM from console. Odds are you have some kind of incorrect GEM_PATH set for this.

rohandey commented 9 years ago

@kaneda you are right .. something wrong .. not working now. Any solutions?

kashif commented 9 years ago

@rohandey @kaneda I am trying to replicate this locally without any luck...

rohandey commented 9 years ago

@kashif are you installing this in rvm setup or without it?

kashif commented 9 years ago

@rohandey I use rbenv...

kaneda commented 9 years ago

@kashif / @rohandey are you using bundler? Odds are it's not using the vendor folder local to your project. To verify this set GEM_PATH=/path/to/your/project/vendor/...;$GEM_PATH

mckenn commented 9 years ago

@shivakumaarmgs Facing exactly the same issue.

mckenn commented 9 years ago

false alert. Conflict with pushmeup gem.

kashif commented 9 years ago

:relieved:

shivakumaarmgs commented 9 years ago

Even I was using Pushme up for APNS, I guess GCM would have had conflict with that. just now realized. closing this one.

shivakumaarmgs commented 9 years ago

@mckenn :+1: