Closed ipatovanton closed 3 years ago
have you set your config settings? e.g.:
# your_config_initializer_file.rb
Uploadcare.config.public_key = 'demopublickey'
Uploadcare.config.secret_key = 'demoprivatekey'
If that's so, I agree that we need a more human friendly error message in this case.
Having the same issue, having set my config keys! Thanks for taking a look!
Sorry, you've set the keys and still get the error. Correct?
Having the same issue, having set my config keys! Thanks for taking a look!
Yes, I have set the keys @dmitry-mukhin
Edit: If it's helpful context, this is happening after upgrading from v2 to v3 in Ruby 2.6.3 and Rails 5.2.5.
I am having the same problem
@dmitry-mukhin @rudietuesdays I've figured it out, you have to add this gem: https://github.com/rubygarage/api_struct/
@shyankashani uploadcare-ruby
already depends on api_struct
, so not sure how that could help.
maybe you bundler wasn't run properly?
@rudietuesdays could you also check that you run bundler after gem version upgrade? thanks!
@dmitry-mukhin Huh, I'm not sure! I think it was, but it may not have been. Let's see if that works for @rudietuesdays
@shyankashani
bundle
run should install all explicit and implicit dependencies, and api-struct
is a dependency
setting ENV variables should be enough and running Uploadcare.config.public_key
in the console causes error.
something is not right
You should place require 'uploadcare'
in a file where you use this gem. Problem with unitialized constant ApiStruct
must be fixed in the branch feature/1-new-entity-attrs
. We are working on a new version. It is coming soon. For now, you can use the branch feature/1-new-entity-attrs
.
I had the same problem but fixed it by explicitly requiring 'uploadcare' in my initializer.
config/initializers/uploadcare.rb
require 'uploadcare'
Uploadcare.config.public_key = ENV["UPLOADCARE_PUBLIC_KEY"]
Uploadcare.config.secret_key = ENV["UPLOADCARE_SECRET_KEY"]
We fixed this issue in the version 3.1.0. Please, check
When I try to upload image
Uploadcare::Uploader.upload('https://placekitten.com/96/139')
I get an error:
uninitialized constant Uploadcare
Also when I try to add: require 'uploadcare'
I get an error: