Skip to content

Add dev/setup binstubs to more easily setup and dev on local #3238

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

Merged
merged 4 commits into from
Sep 30, 2023

Conversation

murny
Copy link
Contributor

@murny murny commented Sep 21, 2023

Rails provides helpful bin/dev (in rails 7+) and bin/setup binstubs to help developers start their project and run their applications.

Let's update ours so they work with our stack

(note: bin/update is no longer a thing in latest verions of rails so we can remove this)

# Install JavaScript dependencies
# system('bin/yarn')
puts "\n== Install JavaScript dependencies =="
system('yarn check --check-files') || system!('yarn install')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use yarn and docker in our application, add them to our bin/setup

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the recommended way to setup? Should we update our README?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah good call out. Let's update the README. Can make a change for this in this PR 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added and cleanup sections in readme to reference these new binstubs instead

bin/update Outdated
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file has been removed in Rails. As bin/setup is idempotent, and you could just use this instead

@murny murny marked this pull request as ready for review September 25, 2023 16:50
@murny murny force-pushed the add-setup-dev-bin-stubs branch from 51a8ef8 to 9a025ea Compare September 28, 2023 00:45
@@ -1,3 +1,3 @@
app: bin/rails s -p 3000
web: env RUBY_DEBUG_OPEN=true bin/rails server
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't seen RUBY_DEBUG_OPEN before. How are you using it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe with foreman you can't access your debugger inside the process as you don't have proper TTY available. Overmind has ways around this, which is why I prefer it, amongst other reasons. But if we can get foreman working nicely too why not?

This came from the default Rails generator in version 7+ from these gems:
rails/jsbundling-rails#146
rails/cssbundling-rails#123

These PRs say:
"When running inside foreman the 'debug' gem will not have a proper TTY available. Running with the --open option enabled allows to start remote sessions and attach a debugger client with rdbg --attach.

More info: https://github.com/ruby/debug#invoke-as-a-remote-debuggee"

Copy link
Member

@pgwillia pgwillia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 LGTM! Thanks for simplifying our setup and running the dev environment.

@murny murny merged commit dd4558d into master Sep 30, 2023
@murny murny deleted the add-setup-dev-bin-stubs branch September 30, 2023 16:01
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

Successfully merging this pull request may close these issues.

2 participants