This project is archived and is in readonly mode.
Problem with gem dependency detection of frozen gems
Reported by Tiago Macedo | July 1st, 2008 @ 06:12 PM | in 2.x
There is a problem with gem dependency in rails 2.1 and head.
If you specify your gem dependency with a <= or >= version string, the gem dependency won't detect if you have a frozen gem that isn't the specified version even if it satisfies the requirement.
Example:
config.gem "ruby-openid", :lib => "openid", :version => ">=2.0.4"
If you have ruby-openid-2.1.2 installed and type rake gems:unpack it'll freeze in vendor/gems.
However if you type rake:gems afterwards, it'll tell that it is installed and not frozen because it is looking for it under vendor/gems/ruby-openid-2.0.4 instead of vendor/gems/ruby-openid-2.1.2
What the patch does is:
Search vendor/gems for gems that match the required gem name and satisfy the required version. If more than one matching gem is found, the gem with the biggest version number is loaded.
Comments and changes to this ticket
-
Tiago Macedo July 1st, 2008 @ 06:13 PM
I didn't write any tests because this is only verifiable with frozen gems.
-
Lee Marlow July 10th, 2008 @ 06:58 PM
+1
This patch correctly detects my unpacked gems when using the ~> gem requirement syntax.
-
Lee Marlow July 17th, 2008 @ 11:21 PM
Modified the patch to not depend on ActiveSupport's String#starts_with? method
This allows starting the server via mongrel_rails, etc. instead of just through script/server
-
Pratik July 18th, 2008 @ 12:01 AM
- Assigned user set to Rick
-
Matt Jones February 18th, 2009 @ 01:23 AM
- State changed from new to resolved
- Assigned user changed from Rick to Matt Jones
This shouldn't be an issue with the current gem code (as of 2.2.2) - please reopen if it is.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Tags
Referenced by
- 227 complex versions in config.gem fails This patch (http://rails.lighthouseapp.com/p... addresse...
- 1128 Fix config.gem bugs and add more tests incorporates, via using the gem loader for frozen gems, f...