-
Notifications
You must be signed in to change notification settings - Fork 101
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
Don't require/use Bundler at runtime #3
Conversation
Bundler is designed for use for managing an application's dependencies while gemspecs manage gem dependencies. You can see how the built-in Bundler rubygem generators setup using Bundler for development of a rubygem but not using it at runtime. http://gembundler.com/rubygems.html |
Here's an article written almost 2 years ago about not requiring rubygems in library code. https://gist.github.com/54177 There's also work in Bundler to support an application itself to not need to use Bundler at runtime for compatibility reasons. rubygems/bundler@9278bf5 |
I'm still hoping to see this change made in this gem. Without it, I'm unable to use the gem directly. Here is additional information on using Bundler for application vs gem development. |
Hi C, Sorry for the delay. I attempted an updated. Can you let me know if if looks good? Thanks, Alan |
This was causing us problems [1] in an application which uses Bundler when we upgraded to Bundler >= v1.13.0. I think the right solution is something along the lines of adacosta#3, but I'm trying this as a temporary quick fix. [1]: alphagov/manuals-publisher#816
* This is an attempt to fix the problem described in #816. It uses a forked version of mongoid_rails_migrations. The branch in that fork was branched off the v1.0.0 tag, which is the version of the gem that was specified in our `Gemfile`. This is so that we keep the changes to our app to a minimum. * This fix is a bit of a bodge - the proper fix would be along the lines of adacosta/mongoid_rails_migrations#3, but given that the failing build is a significant blocker, it feels as if this is worth a try. If it works OK, we can work on getting the proper fix in place. * I installed v1.14.5 of Bundler which is the version now specified in govuk-puppet [1] for Ruby v2.2.4. Hence the change to `BUNDLED WITH` in the `Gemfile`. * I've run a migration locally to ensure that the gem still works OK even with this patch in place. [1]: https://github.com/alphagov/govuk-puppet/blob/e2d61705aaf6da180a781b6f46f83235fd890df0/modules/govuk_rbenv/manifests/all.pp#L46
This was causing us problems [1] in an application which uses Bundler when we upgraded to Bundler >= v1.13.0. I think the right solution is something along the lines of adacosta#3, but I'm trying this as a temporary quick fix. Note that this branch is based off the v1.0.0 tag which is the version of the gem that we are currently using in our app. [1]: alphagov/manuals-publisher#816
* This is an attempt to fix the problem described in #816. It uses a forked version of mongoid_rails_migrations. The branch in that fork was branched off the v1.0.0 tag, which is the version of the gem that was specified in our `Gemfile`. This is so that we keep the changes to our app to a minimum. * This fix is a bit of a bodge - the proper fix would be along the lines of adacosta/mongoid_rails_migrations#3, but given that the failing build is a significant blocker, it feels as if this is worth a try. If it works OK, we can work on getting the proper fix in place. * I installed v1.14.5 of Bundler which is the version now specified in govuk-puppet [1] for Ruby v2.2.4. Hence the change to `BUNDLED WITH` in the `Gemfile`. * I've run a migration locally to ensure that the gem still works OK even with this patch in place. [1]: https://github.com/alphagov/govuk-puppet/blob/e2d61705aaf6da180a781b6f46f83235fd890df0/modules/govuk_rbenv/manifests/all.pp#L46
This was causing us problems [1] in an application which uses Bundler when we upgraded to Bundler >= v1.13.0. I think the right solution is something along the lines of adacosta#3, but I'm trying this as a temporary quick fix. Note that this branch is based off the v1.0.0 tag which is the version of the gem that we are currently using in our app. [1]: alphagov/manuals-publisher#816
This was causing us problems [1] in an application which uses Bundler when we upgraded to Bundler >= v1.13.0. I think the right solution is something along the lines of these pull requests [2,3], but since these haven't been merged by the maintainer, I'm using this commit as a temporary fix. [1]: alphagov/manuals-publisher#816 [2]: adacosta#3 [3]: adacosta#40
This was causing us problems [1] in an application which uses Bundler when we upgraded to Bundler >= v1.13.0. I think the right solution is something along the lines of these pull requests [2,3], but since these haven't been merged by the maintainer, I'm using this commit as a temporary fix. [1]: alphagov/manuals-publisher#816 [2]: adacosta#3 [3]: adacosta#40
This upgrade from v1.0.0 includes a few changes to improve compatibility with more recent versions of Mongoid and Rails. However, I haven't been able to use the v1.1.0 release version of the gem for three reasons: * Since we're now on Mongoid v6, we need the fix [1] in the latest commit on master in the canonical repo in order for `Mongoid::Migration.connection` method to work. I've incorporated this commit in the new branch in the alphagov fork. * Since we're now on Rails v5, we need a fix [2] for the absence of `alias_method_chain`. I've incorporated the commit from this PR [3] into the new branch in the alphagov fork. * The problem described in #816 still exists. The maintainer of the gem still hasn't fixed the problem. This earlier suggested fix [4] has been closed without explanation. A new fix [5] has been proposed and I've added a comment to explain why I think it should be merged. Therefore I've incorporated my original fix as the last commit in the new branch in the alphagov fork. I've checked that I can generate and run the following migration: class Foo < Mongoid::Migration def self.up p SectionEdition.count p SectionEdition.collection p connection.database.collection_names end def self.down end end I've also updated the existing migration so that I think they would work. However, I haven't tested them. [1]: adacosta/mongoid_rails_migrations@0074dbf [2]: stormz/mongoid_rails_migrations@b9158cd [3]: adacosta/mongoid_rails_migrations#44 [4]: adacosta/mongoid_rails_migrations#3 [5]: adacosta/mongoid_rails_migrations#40
Our application already uses Bundler and relies on the gemspec to control dependencies.