arkana: Failed to load command: arkana - Undefined method capitalize_first_letter

I added arkana to my gem file: gem 'arkana'

And installed with bundle install

It appears to be a success. However, when I try to run “bundle exec arkana” in my command line, I get the following error:

bundler: failed to load command: arkana (/Users/jean-baptistebolh/.rbenv/versions/2.7.3/bin/arkana)
NoMethodError: undefined method `capitalize_first_letter' for #<Array:0x0000000155b08f00>
  /Users/jean-baptistebolh/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/arkana-2.0.0/lib/arkana/models/config.rb:47:in `each'
  /Users/jean-baptistebolh/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/arkana-2.0.0/lib/arkana/models/config.rb:47:in `map'
  /Users/jean-baptistebolh/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/arkana-2.0.0/lib/arkana/models/config.rb:47:in `initialize'
  /Users/jean-baptistebolh/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/arkana-2.0.0/lib/arkana/config_parser.rb:14:in `new'
  /Users/jean-baptistebolh/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/arkana-2.0.0/lib/arkana/config_parser.rb:14:in `parse'
  /Users/jean-baptistebolh/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/arkana-2.0.0/lib/arkana.rb:16:in `run'
  /Users/jean-baptistebolh/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/arkana-2.0.0/bin/arkana:8:in `<top (required)>'
  /Users/jean-baptistebolh/.rbenv/versions/2.7.3/bin/arkana:23:in `load'
  /Users/jean-baptistebolh/.rbenv/versions/2.7.3/bin/arkana:23:in `<top (required)>'

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Comments: 15 (6 by maintainers)

Most upvoted comments

I also noticed that your local ruby version is set to be below 3. I believe that Arkana needs ruby to be above version 3

Hi @rogerluan thanks for checking in! Apologies for not getting back quickly, been a busy day at work…

I think I figured it out since my command just ran successfully so first of all, THANK YOU!

For the README improvements, I’ll try to spell out instructions as I would tell them to someone else after going through this experience. I’ll admit this may be more verbose than what you will end up with, but here we go.

Example: Lets image a situation where you have the following for an API called “SomeAPI”: production key: “ABCDEFG1234” debug key: “XYZLMNO1234”

  1. We may want to access these from two variables within our app called “SomeAPIDebug” and “SomeAPIRelease”. We will define a naming scheme (in other words our ‘environments’) in a yaml file called .arkana.yml at the root of our project. We will put our actual api keys in a .env file, also at the root of our project. In our case the files will look like this: .arkana.yml
environments:
  - Debug
  - Release

environment_secrets:
  - OpenAPIKey

.env

OpenAPIKeyRelease: "ABCDEFG1234"
OpenAPIKeyDebug: "XYZLMNO1234"
  1. Notice how arkana needs you to name the variables in .env as the environment_secret followed by the environment name.

  2. If using bundle run bundle exec arkana


That’s how it works in my brain… let me know if I’m not thinking about this correctly and thank you again for the help 😃

@JeanBaptisteBolh please let me know if the info above resolves the issues you were seeing 😃 Looking forward to hearing back from you! 🙇

Thank you so much for the feedback @alexspurlock25 ! I’ll make sure the documentation is more clear 🙇

I’m glad to hear you enjoy using Arkana! ❤️

@alexspurlock25

There isn’t really an onboarding process.

We have [what I believed to be] an extensive documentation in the project’s README, would you be able to point out areas we could improve it? And/or perhaps @JeanBaptisteBolh could contribute too with some fresh ideas? 😃 I’d love to hear them all!

Right, so when I started using Arkana - works great by the way - I wasn’t told that I HAD to create two files. Maybe I missed that somewhere, but I did get lost initially. I hope this helps someway.

I love the library by the way.

@alexspurlock25

There isn’t really an onboarding process.

We have [what I believed to be] an extensive documentation in the project’s README, would you be able to point out areas we could improve it? And/or perhaps @JeanBaptisteBolh could contribute too with some fresh ideas? 😃 I’d love to hear them all!

Hey everyone! Sorry I’m late for the party 😄

I really appreciate your input here @alexspurlock25, I love to see this community engagement ❤️

@JeanBaptisteBolh it seems like you’re struggling with setting Arkana up for the first time. I suggest reading the Usage section of the README: https://github.com/rogerluan/arkana?tab=readme-ov-file#usage — it points to a template .yml file you could be using as your starting point for your .arkana.yml file 😊

I don’t know where/how you came up with the syntax for that yaml file you wrote, but it should be like this instead:

# here don't forget to set all the other settings related to the project, e.g. spm vs cocoapods, swift vs kotlin, etc…

environments: # Optional. List of environments that will be used to generate secret keys when you have keys that are different between environments (e.g. debug/staging/prod). Defaults to empty.
  - Debug
  - Release
environment_secrets: # Optional. List of secrets that are the same regardless of which environment is being built. Defaults to empty.
  - OpenAPIKey

I hope this helps! Let me know if you still have issues 🤗

@JeanBaptisteBolh have you initialized your .arkana.yml file for Arkana? There isn’t really an onboarding process. But I remember getting this error as well. Somewhere in the documentation, you will find a template for this file.