Open jarthod opened 4 years ago
https://rubygems.org/gems/sqlite3-static
They did release it that is how I've been using it.
Oh ok, sorry I didn't find it as it was removed from the Readme
and I only looked for sqlite3-ruby-static
:facepalm:
In the end though I couldn't use this with Rails because of the hardcoded requirement for exact "sqlite3" gem with "~> 1.4" version in the sqlite3 adapter: https://github.com/rails/rails/blob/master/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
So I had to fork and change the gemspec to impersonate the official gem name and version: https://github.com/jarthod/sqlite3-ruby-static/commit/26d754f2d332bdcd2ee73cd5dba6f95a186546a8, with this I was able to use it with Rails. Maybe there is a better way to make this static gem work with Rails?
Hey @jarthod ,
I spent this weekend merging in the upstream code into my fork of this repo. So it looks like it works fine. Since Ruby on Rails has the hard-coded dependency on sqlite3 ~> 1.4. I made a branch to do the same thing you did with your fork but I just made it more verbose in its versioning ie 1.4.2.20200412165500.static.3.22. I was wondering if you could test that on rails and see if that works.
Sadly, because of the dependency in rails I think the only way to get around that is to impersonate the sqlite3 gem for rails. But if it likes my naming scheme hopefully that it is somewhat workable.
I have tested this gem on non-rails environments and it looks like it works ok.
@rangeroob I confirm your branch works well in my Rails 6 project!
@rangeroob would it be possible to have a release of this version by the way?
@jarthod
hey I am working on it. I tried to see if I could use github to host both gems: sqlite3 & sqlite3-ruby-static, but the github action that I am using seems to only want to build the sqlite3-ruby-static gem and not use the sqlite3 gem sadly. And I can't use rubygems.org because of sqlite3 name already being taken. I am looking into setting up a geminabox server on a VPS somewhere which will definitely work, but I just need time to get it setup correctly/securely. So hopefully by the weekend i should be able to get it up and running.
Oh that's right, I totally forgot about this name impersonation thing :/ Maybe we should actually just give some instructions on how to use with Rails in the readme (pointing at the github branch)? I don't know if the private gem repo would bring more value in the end?
In my case I used:
gem 'sqlite3', git: 'https://github.com/rangeroob/sqlite3-ruby-static', branch: 'Update-gemspec' # static build of sqlite instead of the official gem
Thanks for the info totally blanked on putting it within the gemfile like that. If that has been working for you then that works for me and it is less work overall. So right now I just finished up the documentation and tagged and released a new version. So let me know it if you run into any issues.
Looks good to me, thanks for your great work on this! I'm adding the link here for future readers looking to use a static sqlite3 gem with Rails: https://github.com/rangeroob/sqlite3-ruby-static#label-Use+with+Rails+ Hopefully we can get this merged upstream someday (with #2) but I don't have much hope ^^
Hi, this library is great! especially useful to use sqlite on heroku-like environements (dokku in my case) Why not releasing the gem on rubygems to make it easier/quicker to use it?
Thanks you anyway ☺