koudoku icon indicating copy to clipboard operation
koudoku copied to clipboard

Newbie question, how to install

Open drewpotter opened this issue 9 years ago • 12 comments

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.

drewpotter avatar Mar 01 '15 16:03 drewpotter

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)

yas4891 avatar Mar 01 '15 17:03 yas4891

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?

drewpotter avatar Mar 01 '15 18:03 drewpotter

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:inmethod_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:inblock 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:inload_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:inload_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:instart' 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:inconsole' 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:inblock 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:inrequire' 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:inload' 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:inload_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:inrequire' from /home/drewpotter/.rbenv/versions/2.1.5/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'

drewpotter avatar Mar 01 '15 18:03 drewpotter

I get the same issue as above. Would love to know where I'm going wrong.

Thanks!

harisaurus avatar Mar 02 '15 00:03 harisaurus

You are using Rails 4 and those methods are no longer available in Rails 4. Koudoku works on Rails 3.2

yas4891 avatar Mar 02 '15 10:03 yas4891

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!

harisaurus avatar Mar 02 '15 14:03 harisaurus

Feel free to add it and make a PR

yas4891 avatar Mar 02 '15 14:03 yas4891

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

yas4891 avatar Mar 02 '15 17:03 yas4891

@drewpotter @harismahmood89 @yas4891 I submitted a PR to fix the attr_accessible issue. #106

boomshadow avatar Mar 20 '15 13:03 boomshadow

@boomshadow that results in an 'unexpected syntax' error.

harisaurus avatar Mar 21 '15 22:03 harisaurus

@harismahmood89 Really? Where at? I just ran it on a fresh project again, and it worked just fine.

boomshadow avatar Mar 22 '15 06:03 boomshadow

@harismahmood89 Just delete that line from your model.

razvanh avatar Mar 30 '15 13:03 razvanh