koudoku
koudoku copied to clipboard
Newbie question, how to install
Hi,
I have followed the installation instructions up until; "After installing, you'll need to add some subscription plans." Then I don't know how to add those subscription plans and also I don't see subscriptions appearing in my App.
Also, I had a few conflicts during installation, despite those files not existing previously:
conflict app/models/subscription.rb
conflict app/models/plan.rb
conflict app/models/coupon.rb
These files did not exist so I don't know why they are conflicting?
I really like koudoku and I really want to use it but I don't know how. So please can you help.
Open a rails console by typing rails c
into a terminal in your apps directory. Then add plans using Plan.create
as shown in the Readme.
Alternatively, you can put those lines in a migration (add a new one with rails g migration add_plans
)
Thanks. I tried that and it seems to have worked:
$ rails c Loading development environment (Rails 4.2.0) irb(main):001:0> Plan.create({ name: 'LeafyPond', price: 63.00, interval: 'yearly', stripe_id: '1', features: ['Unlimited Access', 'All games', '1 User'].join("\n\n"), display_order: 1});
Sorry that I don't know, but how do I make the plan/subscription appear in my App?
Actually I get a huge error:
NoMethodError: undefined method attr_accessible' for Plan (call 'Plan.connection' to establish a connection):Class from /home/drewpotter/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/dynamic_matchers.rb:26:in
method_missing'
from /home/drewpotter/LeafyPond-YouDinar/App/app/models/plan.rb:5:in <class:Plan>' from /home/drewpotter/LeafyPond-YouDinar/App/app/models/plan.rb:1:in
<top (required)>'
from /home/drewpotter/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:457:in load' from /home/drewpotter/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:457:in
block in load_file'
from /home/drewpotter/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:647:in new_constants_in' from /home/drewpotter/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:456:in
load_file'
from /home/drewpotter/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:354:in require_or_load' from /home/drewpotter/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:494:in
load_missing_constant'
from /home/drewpotter/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:184:in const_missing' from (irb):3 from /home/drewpotter/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/railties-4.2.0/lib/rails/commands/console.rb:110:in
start'
from /home/drewpotter/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/railties-4.2.0/lib/rails/commands/console.rb:9:in start' from /home/drewpotter/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:68:in
console'
from /home/drewpotter/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:39:in run_command!' from /home/drewpotter/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/railties-4.2.0/lib/rails/commands.rb:17:in
<top (required)>'
from /home/drewpotter/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in require' from /home/drewpotter/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in
block in require'
from /home/drewpotter/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:240:in load_dependency' from /home/drewpotter/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in
require'
from /home/drewpotter/LeafyPond-YouDinar/App/bin/rails:8:in <top (required)>' from /home/drewpotter/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:268:in
load'
from /home/drewpotter/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:268:in block in load' from /home/drewpotter/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:240:in
load_dependency'
from /home/drewpotter/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:268:in load' from /home/drewpotter/.rbenv/versions/2.1.5/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in
require'
from /home/drewpotter/.rbenv/versions/2.1.5/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
I get the same issue as above. Would love to know where I'm going wrong.
Thanks!
You are using Rails 4 and those methods are no longer available in Rails 4. Koudoku works on Rails 3.2
Would recommend mentioning that in the Readme for future developers, would be very useful to know ahead of time.
Really love the idea of koudoku -- hope to be able to use it on projects in the future!
Feel free to add it and make a PR
Check out this answer: https://github.com/andrewculver/koudoku/issues/92#issuecomment-76759035
It seems you can make it work on Rails 4 - sorry, haven't tested that
@drewpotter @harismahmood89 @yas4891 I submitted a PR to fix the attr_accessible issue. #106
@boomshadow that results in an 'unexpected syntax' error.
@harismahmood89 Really? Where at? I just ran it on a fresh project again, and it worked just fine.
@harismahmood89 Just delete that line from your model.