osdir.com
mailing list archive F.A.Q. -since 2001!



Subject: Re: Easily build Portfiles from ruby gems -
msg#00039

List: os.apple.macports.user

Mail Archive Navigation:
by Date: Prev Next Date Index by Thread: Prev Next Thread Index


Le 7 nov. 06 à 01:39, John Labovitz a écrit :

On Nov 6, 2006, at 6:40am, Paul Guyot wrote:

With such a script, there's no reason to continue to use gem to install ruby gems. Using gem may yield in inconsistencies. I know that most ruby tutorial around say: get ruby with darwinports, then use gem. But I strongly disagree. At some point, we may rename gem binary and put a fake one that displays a warning message.

Please don't.

I've been using native Ruby gems for at least two years with MacPorts, and have had absolutely no trouble.

I don't have any problem with *providing* gem ports, especially for major/complex systems like ImageMagick and Rails. I use a select few rb-* gems, for their ease of installation (eg, rb- imagemagick). The combination of native and ported gems has never caused me grief; on the contrary, it's been a very pleasant experience. (Yes, I realize there could be dependency issues with a gem that required something installed as a port.)

Besides, there are currently over a thousand gems; only ~130 of those currently have ports. Do you really suggest that we make ports for every single one? And keep them up to date?

Perhaps if there are specific issues or conflicts, we could talk about those and try to find a solution or a workaround. (For example, I wonder whether a gem port could somehow be a wrapper around the gem command; that way the user would continue to use the ports system, but actually be installing native gems that were kept track of.)

This is exactly what happens for a while now. That's true that only 12 ports use this technology, but it's there and it works (including for rails).

If you look at rb-actionmailer, the ruby.setup line says:
ruby.setup actionmailer 1.2.3 gem {} rubyforge:11331

It means: use the gem mechanism, get it from rubyforge, the ID is 11331.

However, the trouble with this was to get the ID. I realized that gem itself doesn't know about it but download from another URL. So the new code (available only in svn now, forthcoming in 1.3.3) works like this:
ruby.setup mongrel 0.3.13.4 gem {} rubyforge_gem

I know that using gem and port at the same time is almost without any trouble. Gem is a good piece of code and it's behaving. The only issue is that gem is installing stuff in /opt/local and MacPorts doesn't know about it.

So from there, I think there are the following paths:
- port the one thousand or something gems to MacPorts using the script I wrote. It's just a matter of converting and testing.
- patch gem so it registers the files into MacPorts system.
- something between the two.

It is what FreeBSD does with CPAN as far as I know. CPAN can install stuff and what is installed is registered in FreeBSD database. Until then, it might be worth it when enough gems are made available through MacPorts to just rename gem command so it's still available and implement a fake warning one to convince ruby users to use the MacPort version or provides tickets so we update to the latest when there's a problem.

Paul
--
Ministre ultraplénipotentiaire en disponibilité.
Mobile. Sans baignoire fixe.
http://www.kallisys.com/
http://www-poleia.lip6.fr/~guyot/


Thread at a glance:

Previous Message by Date:

How can I get out of this annoying state?

Greetings, I am quite a new MacOS X user, and I happened to fall into a very annoying situation as follows... When I tried to remove a package, I got fukuda@quadra:~% sudo port -f uninstall perl5.8 ---> Unable to uninstall perl5.8 5.8.8_0+darwin_8, the following ports depend on it: ---> p5-xml-parser ---> autoconf ---> automake ---> gnome-mime-data ---> vnc Warning: Uninstall forced. Proceeding despite dependencies. ---> Uninstalling perl5.8 5.8.8_0+darwin_8 It seemed that the uninstall was successful, but when I tried to install it, I got fukuda@quadra:~% sudo port -f install perl5.8 ---> Installing perl5.8 5.8.8_0+darwin_8 Error: Target com.apple.install returned: Registry error: perl5.8 5.8.8_0+darwin_8 already registered as installed. Please uninstall it first. Error: Status 1 encountered during processing. fukuda@quadra:~% I repeated these commands with some other options, but none of them did not work. As a result, I cannot install or uninstall Perl, and this prohibits porting of many other packages. Could you show me how to get out of this situation? Thanks, -- -- Taka Fukuda -- fukuda at computer.org

Next Message by Date:

Re: Latest ruby 1.8.5_1

Le 7 nov. 06 à 03:06, Luc Heinrich a écrit : Greetings, The latest version of the ruby Portfile (dubbed 1.8.5_1) adds tcl and tk as dependencies. I suggest making them as a 'tk' variant instead, having to install tcl/tk to actually install ruby hurts my feelings pretty badly... :) The problem is that ruby uses tk and tcl during compilation. I don't know what exactly. I agree that it's a pain and it would actually be in favor of Jordan's position. http://article.gmane.org/gmane.os.opendarwin.darwinports/18644/ I don't know how to turn it into a variant in such a way that without this variant, ruby doesn't touch tk & tcl if they're available. Paul

Previous Message by Thread:

Re: Easily build Portfiles from ruby gems

On Nov 6, 2006, at 6:40am, Paul Guyot wrote: With such a script, there's no reason to continue to use gem to install ruby gems. Using gem may yield in inconsistencies. I know that most ruby tutorial around say: get ruby with darwinports, then use gem. But I strongly disagree. At some point, we may rename gem binary and put a fake one that displays a warning message. Please don't. I've been using native Ruby gems for at least two years with MacPorts, and have had absolutely no trouble. I don't have any problem with *providing* gem ports, especially for major/complex systems like ImageMagick and Rails. I use a select few rb-* gems, for their ease of installation (eg, rb-imagemagick). The combination of native and ported gems has never caused me grief; on the contrary, it's been a very pleasant experience. (Yes, I realize there could be dependency issues with a gem that required something installed as a port.) Besides, there are currently over a thousand gems; only ~130 of those currently have ports. Do you really suggest that we make ports for every single one? And keep them up to date? Perhaps if there are specific issues or conflicts, we could talk about those and try to find a solution or a workaround. (For example, I wonder whether a gem port could somehow be a wrapper around the gem command; that way the user would continue to use the ports system, but actually be installing native gems that were kept track of.) In the meantime, I'll be standing up for voice of the common gem. ;) --John

Next Message by Thread:

Re: Easily build Portfiles from ruby gems

On 11/6/06, Paul Guyot <pguyot-bpoUw9nU9rvk1uMJSBkQmQ@xxxxxxxxxxxxxxxx> wrote: With such a script, there's no reason to continue to use gem to install ruby gems. rubygems allows multiple version of a single package to be installed simultaneously and allows one to define a required package version: require_gem 'hpricot', '>= 0.4.59' 'no reason' might be a bit strong =) Using gem may yield in inconsistencies. what inconsistencies may arise? I know that most ruby tutorial around say: get ruby with darwinports, then use gem. But I strongly disagree. you have said this before, but i never caught why… At some point, we may rename gem binary and put a fake one that displays a warning message. is that really desirable? what problem is your script working to solve? it has been suggested that the omniscience of macports would be compromised when rubygems (or pear, cpan, or how about touch, cp, mv), is that it? why couldn't macports become more tolerant and able to handle foreign files? if my macports prefix was /usr/local would it be reasonable for macports to break just because i installed something by hand into the same prefix? i think my mirror world, constant lagging and unnecessarily fragile comments from august may still apply: http://article.gmane.org/gmane.os.opendarwin.darwinports/18853 i think it is great that there is a way to convert gems to ports and have them available to the macports audience, but i do not understand the motivation to discourage the use of and try and replicate some of the functionality of rubygems. cheers, jean-pierre
blog comments powered by Disqus

Home | News | Sitemap | FAQ | advertise | OSDir is an Inevitable website. GBiz is too!