Title: Ability to run ruby_bundle without gemfile_lock attribute · Issue #129 · bazelruby/rules_ruby · GitHub
Open Graph Title: Ability to run ruby_bundle without gemfile_lock attribute · Issue #129 · bazelruby/rules_ruby
X Title: Ability to run ruby_bundle without gemfile_lock attribute · Issue #129 · bazelruby/rules_ruby
Description: Currently when running a ruby_bundle without the gemfile_lock attribute results in the following error ERROR: An error occurred during the fetch of repository 'vagrant_bundle': Traceback (most recent call last): File "/private/var/tmp/_b...
Open Graph Description: Currently when running a ruby_bundle without the gemfile_lock attribute results in the following error ERROR: An error occurred during the fetch of repository 'vagrant_bundle': Traceback (most rece...
X Description: Currently when running a ruby_bundle without the gemfile_lock attribute results in the following error ERROR: An error occurred during the fetch of repository 'vagrant_bundle': Traceback (m...
Opengraph URL: https://github.com/bazelruby/rules_ruby/issues/129
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Ability to run ruby_bundle without gemfile_lock attribute","articleBody":"Currently when running a `ruby_bundle` without the `gemfile_lock` attribute results in the following error\r\n\r\n```\r\nERROR: An error occurred during the fetch of repository 'vagrant_bundle':\r\n Traceback (most recent call last):\r\n\tFile \"/private/var/tmp/_bazel_maarten/8c4bfcd606c4d7b95cf418885251b08c/external/bazelruby_rules_ruby/ruby/private/bundle/def.bzl\", line 198, column 28, in _ruby_bundle_impl\r\n\t\tresult = bundle_install(runtime_ctx, result)\r\n\tFile \"/private/var/tmp/_bazel_maarten/8c4bfcd606c4d7b95cf418885251b08c/external/bazelruby_rules_ruby/ruby/private/bundle/def.bzl\", line 138, column 13, in bundle_install\r\n\t\tfail(\"bundle install failed: %s%s\" % (result.stdout, result.stderr))\r\nError in fail: bundle install failed: The deployment setting requires a Gemfile.lock. Please make sure you have\r\nchecked your Gemfile.lock into version control before deploying\r\n```\r\n\r\nThe documentation (https://github.com/bazelruby/rules_ruby#54-ruby_bundle) suggests that it's possible to run `ruby_bundle` without passing the `gemfile_lock` attribute. This is backed-up by the conditional in the code which checks for the presence of the `gemfile_lock` attribute https://github.com/bazelruby/rules_ruby/blob/master/ruby/private/bundle/def.bzl#L125-L126.\r\n\r\nThe problem is that the `set_bundler_config` hardcodes the deployment and frozen settings to true (https://github.com/bazelruby/rules_ruby/blob/master/ruby/private/bundle/def.bzl#L56-L58) which enforces that any bundle install command requires a Gemfile.lock file.\r\n\r\nDisabling these settings as follows seems to help in the case of no Gemfile.lock:\r\n```starlark\r\n bundler_config = {\r\n # \"deployment\": \"false\",\r\n \"standalone\": \"true\",\r\n \"force\": \"false\",\r\n \"redownload\": \"false\",\r\n # \"frozen\": \"true\",\r\n \"path\": BUNDLE_PATH,\r\n \"jobs\": \"20\",\r\n \"shebang\": runtime_ctx.interpreter,\r\n }\r\n```\r\n\r\n\r\n","author":{"url":"https://github.com/mvgijssel","@type":"Person","name":"mvgijssel"},"datePublished":"2022-04-10T06:08:35.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/129/rules_ruby/issues/129"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:b8e0a7ec-c56e-ecc6-3070-1503db0673ed |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DB92:239A7F:581913F:778E597:6973305E |
| html-safe-nonce | 166382a846ae20d822ea4bf75c2757315050b837d9aaf5946845abcbbf9a3fdc |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQjkyOjIzOUE3Rjo1ODE5MTNGOjc3OEU1OTc6Njk3MzMwNUUiLCJ2aXNpdG9yX2lkIjoiMjYzNDk0NTc5NDg2Njg4NDcwMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | eb22e25e15abb65a5014628afc942b40ad619fa4d99d23d19785b99459cb2555 |
| hovercard-subject-tag | issue:1198897875 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/bazelruby/rules_ruby/129/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c325153dfb117105e0364002e46669a4b8b0a1ad1d199c0cfaf013f4aa13778b/bazelruby/rules_ruby/issues/129 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c325153dfb117105e0364002e46669a4b8b0a1ad1d199c0cfaf013f4aa13778b/bazelruby/rules_ruby/issues/129 |
| og:image:alt | Currently when running a ruby_bundle without the gemfile_lock attribute results in the following error ERROR: An error occurred during the fetch of repository 'vagrant_bundle': Traceback (most rece... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mvgijssel |
| hostname | github.com |
| expected-hostname | github.com |
| None | 44ab3188c1dcfe3be0f9c3feca2e04e14fb79f120939ce2395e4f15ab96ec1d4 |
| turbo-cache-control | no-preview |
| go-import | github.com/bazelruby/rules_ruby git https://github.com/bazelruby/rules_ruby.git |
| octolytics-dimension-user_id | 57414752 |
| octolytics-dimension-user_login | bazelruby |
| octolytics-dimension-repository_id | 220572018 |
| octolytics-dimension-repository_nwo | bazelruby/rules_ruby |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 220572018 |
| octolytics-dimension-repository_network_root_nwo | bazelruby/rules_ruby |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | a5e2b48bd1260476599758f5d253b5d24092ab84 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width