Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails console and Migrations can't run #73

Closed
MyklClason opened this issue Aug 30, 2018 · 2 comments
Closed

Rails console and Migrations can't run #73

MyklClason opened this issue Aug 30, 2018 · 2 comments

Comments

@MyklClason
Copy link

MyklClason commented Aug 30, 2018

Not sure if I'm missing something, but the Rails console and Migrations won't run (Server works though) with this gem installed

/usr/local/rvm/gems/ruby-2.4.0/gems/uploadcare-rails-1.2.0/lib/uploadcare/rails/settings.rb:54:in `initialize': Private or public key options were not provided (ArgumentError)
rails -v:  5.2.1
ruby -v: ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-linux]

The environment variables do return the correct values and it works fine when using the upload fields. Possible issue with the private key?

Config:

defaults: &defaults
  public_key: <%= ENV["UPLOADCARE_PUBLIC_KEY"] %> # replace it with your public key
  private_key: <%= ENV["UPLOADCARE_PRIVATE_KEY"] %> # replace it with your private key

  # instances of widget initialized for you on page load
  live: true

  # cache files json dumps to prevent calling to server if it posible
  cache_files: true

  # cache groups json dumps to prevent calling to server if it posible
  cache_groups: true

  # store file or group after model is created or updated
  store_after_save: true

  # deletes file or group after model object is deleted
  delete_after_destroy: true

  # Avaliable options are listed at https://uploadcare.com/documentation/widget/#advanced-configuration
  # please note, that for options marker as Global: N/A - there is no practical meaning
  # of putting this option here, as it will not have any effect.
  # But it also will not break anything.

  # for preview step use:
  # preview_step: false # true or false

  # for clearable option (allows user to remove uploaded file from widget) use:
  # clearable: false # true or false

  # for setting tabs use tabs option:
  # tabs: "url file facebook" # etc
  # read more here: https://uploadcare.com/documentation/widget/#tabs
  #
  #   Full list of tabs:
  # |----------------------------------------|
  # | Code       | File Source     | Default |
  # |------------|-----------------|---------|
  # | url        | Any URL         | On      |
  # | file       | Local disk      | On      |
  # | facebook   | Facebook        | On      |
  # | dropbox    | Dropbox         | Off     |
  # | gdrive     | Google Drive    | On      |
  # | box        | Box             | On      |
  # | skydrive   | SkyDrive        | On      |
  # | instagram  | Instagram       | On      |
  # | evernote   | Evernote        | On      |
  # | vk         | VK              | Off     |
  # |________________________________________|

  # for locale option use:
  # locale: "en"

  # for autostore option use:
  # autostore: true #true or false

  # for manual start (which means you will need to initialize uploaders yourself) use:
  # manual_start: false # true or false

  # for path value use:
  # path_value: true # true or false
  # (important for input values - see https://uploadcare.com/documentation/widget/#input-value)

development:
  <<: *defaults

test:
  <<: *defaults

production:
  <<: *defaults
@MyklClason
Copy link
Author

I got this to avoid errors by optionally using the demo keys instead.

  public_key: <%= ENV["UPLOADCARE_PUBLIC_KEY"] || "demopublickey" %>
  private_key: <%= ENV["UPLOADCARE_PRIVATE_KEY"] || "demoprivatekey" %>

@dmitrijivanchenko
Copy link
Contributor

@MyklClason, please, check the issue #82 with similar situation.

Thanks!

@rsedykh rsedykh closed this as completed Oct 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants