Andrew Vathana

Joined

70 Experience
0 Lessons Completed
0 Questions Solved

Activity

Posted in Stripe Elements Javascript Discussion

The below error is thrown in the console from the code in your repo. It looks like its being called on other pages as well.
```Uncaught Error: The selector you specified (#card-element) applies to no DOM elements that are currently on the page.
Make sure the element exists on the page before calling mount().```

Posted in NameError: uninitialized constant Stripe

It looks like I have my Stripe gem configured correctly, when I start my server my app can hit Stripe's api correctly it just doesn't seem to work on the console. I am wondering if it has anything to do with the warnings I get when I start rails c

Posted in NameError: uninitialized constant Stripe

Hello,

I am receiving the following error "NameError: uninitialized constant Stripe" when I ran Stripe::Customer.all in the rails console. This was from following along on your class Stripe Subscription class. I got it to work with your code examples, but as I am applying what I learned to my codebase I am getting the NameError, is there something I am missing?

config/initializers/stripe.rb

Stripe.api_key = Rails.application.secrets.stripe_private_key

Gemfile

gem 'stripe', '~> 3.3', '>= 3.3.1'

config/secrets.yml

development:
  secret_key_base: <my keys are inserted here>
  stripe_public_key: <my keys are inserted here>
  stripe_private_key: <my keys are inserted here>

test:
  secret_key_base: <my keys are inserted here>
  stripe_public_key: <my keys are inserted here>
  stripe_private_key: <my keys are inserted here>
    ....

Here is the full stack trace:

Running via Spring preloader in process 26483
Loading development environment (Rails 5.0.3)
cannot load such file -- awesome_print
irb: warn: can't alias context from irb_context.
2.4.1 :001 > Stripe::Customer.all
NameError: uninitialized constant Stripe
    from (irb):1
    from /Users/portatlas/.rvm/gems/ruby-2.4.1/gems/railties-5.0.3/lib/rails/commands/console.rb:65:in `start'
    from /Users/portatlas/.rvm/gems/ruby-2.4.1/gems/railties-5.0.3/lib/rails/commands/console_helper.rb:9:in `start'
    from /Users/portatlas/.rvm/gems/ruby-2.4.1/gems/railties-5.0.3/lib/rails/commands/commands_tasks.rb:78:in `console'
    from /Users/portatlas/.rvm/gems/ruby-2.4.1/gems/railties-5.0.3/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
    from /Users/portatlas/.rvm/gems/ruby-2.4.1/gems/railties-5.0.3/lib/rails/commands.rb:18:in `<top (required)>'
    from /Users/portatlas/Desktop/canobie_films/testsubscriptionsite/bin/rails:9:in `<top (required)>'
    from /Users/portatlas/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Users/portatlas/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from -e:1:in `<main>'
    ```

    Thank you,