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

Strange failure with a Rails 8 app #185

Open
zerobearing2 opened this issue Nov 17, 2024 · 3 comments
Open

Strange failure with a Rails 8 app #185

zerobearing2 opened this issue Nov 17, 2024 · 3 comments

Comments

@zerobearing2
Copy link

Trying to configure a secondary database to clickhouse. Getting a strange error after installing the gem and configuring the database.yml.

database.yml

development:
  primary:
    ...
  clickhouse:
    adapter: clickhouse
    database: default
    host: localhost
    port: 8123
    database_tasks: false

Rails console:

app(dev)> User.first
(app):1:in `<main>': wrong number of arguments (given 2, expected 0..1) (ArgumentError)

Without the gem installed, this AR loads just fine.

app(dev)> User.first
  User Load (0.6ms)  SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT $1  [["LIMIT", 1]]
=> 
#<User:0x000073476e0a2fe8
 id: "05ab38c7-7008-4fc2-b68e-6e5c49d9c4ca",
 email: "[FILTERED]",
 ...>

Is Rails 8 support planned soon-ish? Would like to test drive clickhouse with our Rails app.

@PNixx
Copy link
Owner

PNixx commented Nov 17, 2024

Need your ruby and rails version

@zerobearing2
Copy link
Author

ruby 3.3.5 (2024-09-03 revision ef084cc8f4) [x86_64-linux]
Rails 8.0.0

@jjdinho
Copy link

jjdinho commented Jan 21, 2025

I am also experiencing issues with this gem and Rails 8.
Ruby 3.4.1
Rails 8.0.1

When I add latest version of the clickhouse-activerecord gem to the gemfile and run bundle
gem "clickhouse-activerecord", "~> 1.2.1"
I get this error:

Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Could not find compatible versions

Because clickhouse-activerecord >= 1.1.1 depends on activerecord ~> 7.1
  and rails >= 8.0.1 depends on activerecord = 8.0.1,
  clickhouse-activerecord >= 1.1.1 is incompatible with rails >= 8.0.1.
So, because Gemfile depends on rails ~> 8.0.1
  and Gemfile depends on clickhouse-activerecord ~> 1.2.1,
  version solving has failed.

So it isn't exactly the same issue, but choosing an explicit version of the clickhouse-activerecor reveals conflicts with activerecord.

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