payola subscription with rails - ruby

I am trying to implement the payola-payment subscription in a Rails project.
I have tried to use the gem payola-payments but after running bundle, I am facing the following error when running rake db:migrate:
NoMethodError: undefined method `event_retriever=' for StripeEvent:Module
Did you mean? event_filter=
I have found a solution that suggests using gem 'payola-payments', :git => 'git#github.com:payolapayments/payola.git', but after that I get a migration error:
NoMethodError: undefined method `[]' for #
Can any one help with this?

Your version of payola-payment has a bug check it here :
github.com/payolapayments
It is suggested to replace
gem 'payola-payments'
with
gem 'payola-payments', :git =>
'git#github.com:payolapayments/payola.git'
in you Gemfile.

Related

Prawn gem - Undefined Method 'position'

Using ruby 2.0.0, I am receiving the following error:
undefined method 'position=' for #<Prawn::Table:0x007fa85cb72850> (NoMethodError)
I've read several posts and 100% of them have pointed to adding this to your gem file and running bundle update:
gem 'prawn', :git => "https://github.com/prawnpdf/prawn.git", :ref => '8028ca0cd2'
However, I still get the same error when I do this versus just using gem 'prawn'.
It's worth noting that my script worked perfectly fine on another machine in another environment, using the same gem file that only had gem prawn in it. I don't recall altering the other environment in any way to make it work, but it's possible that I did.
Any thoughts as to how I can get rid of this error?

how do I require 'rake' to be able to use FileList in .gemspec?

I am using :path => '/path/to/gem' functionality of bundler to build and use a modified upstream gem, which uses Rake::FileList in its .gemspec.
At this stage, the bundle I'm installing is not yet activated, or maybe the order things are installed forbids bundler from using rake.
I am using ruby 1.8.7.
My Gemfile:
source 'http://rubygems.org'
gem "rake"
gem "foreign_gem", :path => '/home/user/src/foreign_gem'
The error I get:
$ bundle install
Unfortunately, a fatal error has occurred. Please see the Bundler
troubleshooting documentation at http://bit.ly/bundler-issues. Thanks!
/home/ilya/src/foreign_gem/foreign_gem.gemspec:11: uninitialized constant FileList (NameError)
from /home/user/.rbenv/versions/1.8.7-p358/lib/ruby/site_ruby/1.8/rubygems/specification.rb:426:in 'initialize'
from /home/user/src/foreign_gem/foreign_gem.gemspec:1:in 'new'
from /home/user/src/foreign_gem/foreign_gem.gemspec:1
You should be able to add require 'rake' at the top of your foreign_gem.gemspec file in order to use FileList.
I don't know if this is a best practice, but it should work.

undefined method `ruby' for #<Bundler::Dsl:0x007fc17c3fc6c8> (NoMethodError)

Just pulled latest code and now getting:
...my_app/Gemfile:2:in `evaluate':
undefined method `ruby' for #<Bundler::Dsl:0x007fc17c3fc6c8> (NoMethodError)
The ruby method that allows you to specify the version of Ruby your project should use was only added in Bundler 1.2. You’ve got a project with a Gemfile that uses this new ruby method, but have an old version of Bundler. You just need to get Bundler 1.2 with
gem install bundler
and you should be good to go.

Can't fetch data with Ruby and Basecamp API

My code:
require 'rubygems'
require 'basecamp'
basecamp = Basecamp.establish_connection!('example.basecamphq.com', 'example', '123456', true)
projects = Basecamp::Project.find(:all)
projects.inspect
It gives:
/Users/kir/.rvm/gems/ruby-1.8.7-p352#project/gems/activeresource-3.1.0/lib/active_resource/base.rb:922:in `instantiate_collection': undefined method `collect!' for #<Hash:0x105faa450> (NoMethodError)
from /Users/kir/.rvm/gems/ruby-1.8.7-p352#project/gems/activeresource-3.1.0/lib/active_resource/base.rb:894:in `find_every'
from /Users/kir/.rvm/gems/ruby-1.8.7-p352#project/gems/activeresource-3.1.0/lib/active_resource/base.rb:806:in `find'
from bs.rb:4
What's wrong with my code?
There were some problems with the basecamp wrapper gem and rails >= 3.1.x. The "undefined method `collect!'" error was one of them. I pushed some fixes and bumped the gem version to 0.0.7 which should solve that and other problems.

Rails 3 Authlogic - 'acts_as_authentic' undefined

I'm getting the following error:
NameError (undefined local variable or method `acts_as_authentic' for #<Class:0x1037e6310>):
app/models/user.rb:2
app/controllers/user_controller.rb:3:in `new'
I'm using Rails 3.0.0, with Ruby 1.8.7. Authlogic is in my Gemfile as follows:
gem 'authlogic', :git => "git://github.com/binarylogic/authlogic.git"
The entire contents of my User.rb file are as follows:
class User < ActiveRecord::Base
acts_as_authentic
end
I get the same error whether through 'rails console' or through the server. I have restarted the server more times than I can count. Please help, I can't figure it out.
Use a version of authlogic patched for Rails 3
gem 'authlogic', :git => 'git://github.com/odorcicd/authlogic.git', :branch => 'rails3'
Or even better. Use Devise
Is the Authlogic Gem installed ?.
Please do
Bundle install
this should solve your problem.
gem "authlogic", "2.1.6"
Then
Bundle install
Hope it'll helpfull for you. :)
create a file in config/initializers as restful_authentication.rb
and paste this inside the file and restart server and try
require 'authenticated_system'
require 'restful_authentication/authentication'
require 'restful_authentication/authentication/by_password'
require 'restful_authentication/authentication/by_cookie_token'
require 'restful_authentication/authorization/aasm_roles'
require 'restful_authentication/authorization/stateful_roles'
require 'restful_authentication/trustification/email_validation'

Resources