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

undefined method `to_sym' for nil:NilClass #102

Open
jaredmoody opened this issue Jul 19, 2022 · 3 comments
Open

undefined method `to_sym' for nil:NilClass #102

jaredmoody opened this issue Jul 19, 2022 · 3 comments

Comments

@jaredmoody
Copy link

Trying out the quickstart guide and hitting an error when trying to build:

kuby -e production build
error: undefined method `to_sym' for nil:NilClass

I'm sure I've missed something, but I don't know how to get kuby to print a backtrace or otherwise find out what the issue is.

@camertron
Copy link
Member

Hey @jaredmoody thanks for giving Kuby a spin! You can get a backtrace by prefixing the command with GLI_DEBUG=true. Can you try that and paste the output?

@jaredmoody
Copy link
Author

Perfect, thanks!

Here's the relevant line from the backtrace:

/Users/jaredmoody/.asdf/installs/ruby/2.7.6/lib/ruby/gems/2.7.0/gems/kuby-core-0.18.0/lib/kuby/plugins/rails_app/database.rb:40:in `adapter_name': undefined method `to_sym' for nil:NilClass (NoMethodError)

My production section of database.yml doesn't have an adapter because it uses a DATABASE_URL env variable, which wasn't present. However, when I added it, still has the same error - I would guess rails does some parsing of the protocol if the adapter isn't explicitly present? Anyway I added an explicit adapter: postgresql and no error, but it informed me postgres isn't supported.

Now I'm a little bit at a loss as how to use Kuby when I don't want to manage my database with k8s though. Any tips here?

At least, maybe improved error handling around the database adapter config would be a nice improvement :)

@camertron
Copy link
Member

Nice, thanks for the additional info! Yeah it sounds like there are some improvements to be made here, I'll look into it. Check out this area of the docs for instructions on how to manage the database yourself. Specifically you'll want to do this in your Kuby config:

Kuby.define('my-app') do
  environment(:production) do
    kubernetes do
      plugin :rails_app do
        manage_database false
      end
    end
  end
end

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

2 participants