Reputation: 5410
I have followed this tutorial to configure apn_on_rails but I am getting the following error message when I call my action:
uninitialized constant APN::Device
This is the line that produces the conflict:
device = APN::Device.create(:token => device_token)
As suggested here, I have added a require 'apn_on_rails' in my environment.rb but nothing changed.
It seems that the gem apn_on_rails is only installed under gem/bundler, could that be the problem? If so, how can I install it if I have it in my gemfile like this:
gem 'apn_on_rails', :git => 'https://github.com/natescherer/apn_on_rails.git', :branch => 'rails3'
then how can I call something like sudo gem install 'apn_on_rails' ... to install that version?
I am using ruby 1.9.2 and rails 3.1.
Any help is greatly appreciated.
Upvotes: 0
Views: 671
Reputation: 5410
I fixed by following these instructions and making a change to that solution
Clone the Git repository.
$ git clone https://github.com/natescherer/apn_on_rails.git
Change to the new directory.
cd apn_on_rails
Build the gem.
$ gem build apn_on_rails.gemspec
(Running that I got:
Successfully built RubyGem
Name: apn_on_rails
Version: 0.3.1rails3
File: apn_on_rails-0.3.1rails3.gem
Install the gem.
$ gem install apn_on_rails-0.3.1rails3.gem
Upvotes: 1