-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add more specific instructions for working on this gem locally #15
Conversation
|
||
- If you don't already have ruby 3.2 installed locally, one option is using rbenv via the following: | ||
|
||
1. Install [rbenv](https://github.com/rbenv/rbenv?tab=readme-ov-file#homebrew) via homebrew |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why I have rbenv
locally, it may have been for another app that didn't use nix, but it seems to do the trick aside from the libyaml
issues (see note below)
|
||
2. Set a CONN_STR with the connection details: `set CONN_STR=DRIVER={PostgreSQL ANSI};SERVER=127.0.0.2;PORT=5432;DATABASE=foo_development;UID=USERNAME_HERE;password=PASSWORD_HERE` | ||
|
||
- Using `DSN` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have a ton of confidence in this approach because I used the CONN_STR
Tests do pass locally if I use the DSN
env var but I don't understand how because we're not providing credentials...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for me too.
@kevin-j-m Do you happen to know anything about how the bundler cache works here? I'm assuming clearing the cache would fix things because we can install things properly without the cache but I don't understand where that mythical cache exists |
README.md
Outdated
|
||
- Using `CONN_STR`: | ||
|
||
1. Create a postgres database to use or get the configuration details for an existing one |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we add instructions for how to do this?
|
||
2. Set a CONN_STR with the connection details: `set CONN_STR=DRIVER={PostgreSQL ANSI};SERVER=127.0.0.2;PORT=5432;DATABASE=foo_development;UID=USERNAME_HERE;password=PASSWORD_HERE` | ||
|
||
- Using `DSN` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for me too.
3. `rbenv local 3.2.0` | ||
|
||
- Note: if you are using nix for local development of other apps, the version of libyaml installed by this method can interfere with the building of native extensions for those apps. To fix that, you'll need to run `brew uninstall --ignore-dependencies libyaml` and re-run your bundle install inside of that nix shell. You'll then need to reinstall libyaml via homebrew if you want to work on this gem. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something else you need is unixodbc.
brew install unixodbc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah great, I knew there was something else but couldn't find it in my terminal history (or notes...)
README.md
Outdated
|
||
- Note: if you are using nix for local development of other apps, the version of libyaml installed by this method can interfere with the building of native extensions for those apps. To fix that, you'll need to run `brew uninstall --ignore-dependencies libyaml` and re-run your bundle install inside of that nix shell. You'll then need to reinstall libyaml via homebrew if you want to work on this gem. | ||
|
||
2. Run `bundle install` in this directory to install the relevant gems |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had some issues installing ruby-odbc. In order to resolve this, I used this answer.
brew list unixodbc
gem install ruby-odbc -- --with-odbc-dir=/opt/homebrew/Cellar/unixodbc/2.3.12
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't going to work verbatim because...OS differences, but...CI is seeing the same error I was locally that this resolves.
Weird that it wasn't happening before though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you happen to know anything about how the bundler cache works here?
Does this answer your questions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding CI, see #17.
7cff42e
to
e1ee35f
Compare
e1ee35f
to
e0866f7
Compare
This adds some instructions for getting tests running on this gem locally. There may be some gaps in the process we need to fill but this is the majority of the steps that I followed