Skip to content
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

Fix for mail unable to load in a non-rubygems environment #71

Closed
cldwalker opened this issue Jun 12, 2010 · 3 comments
Closed

Fix for mail unable to load in a non-rubygems environment #71

cldwalker opened this issue Jun 12, 2010 · 3 comments

Comments

@cldwalker
Copy link

When trying to use mail in a non-rubygems environment i.e. with Rip:
$ ruby -r mail -e ''

 No such file or directory - /Users/bozo/.rip/irb/lib/mail/../../VERSION.yml (Errno::ENOENT)
 from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/yaml.rb:143:in `open'
 from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/yaml.rb:143:in `load_file'
 from /Users/bozo/.rip/irb/lib/mail/version.rb:6:in `version'

This happens because other non-rubygems environments can't find a VERSION.yml that exists in a project's top level directory. As explained in the ruby packaging standard, libraries must place all of their runtime code in its namespace under lib/. In the case of mail, all runtime code should be in mail.rb or lib/mail/.

My suggestion is to simply keep the versioning in lib/mail/version.rb and get rid of VERSION.yml. Here's a sample branch you could pull from to fix this: http://github.com/cldwalker/mail/tree/version I kept the versioning exactly how you like i.e. Mail::VERSION.version. To make it simpler, I would suggest just making it Mail::VERSION as I do with my projects.

I realize you have a number of tickets to look through but remember that until this gets fixed, mail won't work outside of rubygems and I'll have to maintain a functional fork for myself and others. Feel free to ask me to update the patch as you'd like and send a pull request.

Thanks for this gem,
Gabriel

@mikel
Copy link
Owner

mikel commented Sep 11, 2010

I think you will find this is fixed in 2.2.5.2

Please check and reopen if still a problem.

@cldwalker
Copy link
Author

Thanks for making the change. Works in rip now! I'd suggest in the future putting versioning within your namespace i.e. lib/mail/, as suggested by the ruby packaging standard. Rip follows this standard closely and thus unpacks gems in the same lib/. If two gems have a lib/VERSION, one gem ends up overwriting the other's.

@pboling
Copy link

pboling commented Jan 3, 2014

This has been reopened by the (non)fix to #566

/VERSION needs to go here => lib/mail/VERSION

This issue was closed.
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

No branches or pull requests

3 participants