Ruby under Cygwin problems

Sorry for the snark. Mostly, release a tarball without a dependency on
gems -- that helps a lot. Most linux distros use the FHS standard, so
being able to look for files in the locations it lays out is a Good
Thing.

On a development-of-gems perspective having gems be able to install into
FHS locations would rock.

Ari

···

On Thu, 2005-07-07 at 00:46 +0900, Chad Fowler wrote:

On 7/6/05, Aredridel <aredridel@nbtsc.org> wrote:
> On Wed, 2005-07-06 at 23:18 +0900, Christian Neukirchen wrote:
> > Lothar Scholz <mailinglists@scriptolutions.com> writes:
> >
> > > i don't have a problem with writing "require 'rubygems'" on the first
> > > line. I wouldn't add a rescue clause as i think it's a valid option to
> > > force a user to have rubygems installed as some of the requirements of
> > > your library.
> >
> > If you decide to go this way, please make sure you also publish your
> > software as a gem only, so they won't even have the slightest chance
> > to have a look at the code and determine whether it would be
> > reasonable to dig it out.
>
> Heartily, heartily seconded. That way, if someone who works on a linux
> distro like Fedora, PLD or Debian should want to package software that
> uses your library, or to package your library, so that it "Just works"
> for their users, they'll give up. That way nobody accidentally makes it
> easy to install.
>
> </snark>
>
>

What is your _suggestion_? Does anyone have anything productive to add?

Hello Christian,

And if there was a tar.gz not depending rubygems, I could just grab it
and look into it. If you automate your builds and shipping anyway,
come on, *this* can't be that hard to do.

If they add the path by hand to the RUBYLIB environment variable they
can still do so and try it out. I really like this much better. Then
you don't use the rubygems features of managing multiple version but
only the package manager features.

In case not everyone has noticed: There are people that don't want to
use Rubygems and therefore don't have it installed.

The only problem comes when the install of a gem terminates with an
error, like not being able to compile a binary extension. But as i
pointed out before binary extensions are still a general problem for
rubygems.

And not the only one, unfortunately...

Yes, but i think the idea is to not provide an alternative. IMHO the
way we should go is to enforce the use of rubygems as a primary
solution and so to force development on rubygems, its not that much
work that must be done, but it must be done sooner or later.

I think this is the way you get the best technology - unfortunately
it is not popular for many open source developers.

Rubygems could be a killer feature for ruby, so we should use it.

···

--
Best regards, emailto: scholz at scriptolutions dot com
Lothar Scholz http://www.ruby-ide.com
CTO Scriptolutions Ruby, PHP, Python IDE 's

> Seriously, gems are really hard to package into an RPM. Really, really
> hard. I end up un-packing them as tarballs, then patching them out to
> remove the require_gem lines, require 'rubygems', and then correcting
> the assumptions about the location of data files.

RubyGems are Ruby's package manager. If you want to install a gem, use
RubyGems.

While preserving the ability to repackage might not have been amongst
the priorities of your original concept, the current RubyGems team do
care about that:

"Specifically, it's important to hear of specific scenarios where
something is created as a RubyGem and it _hurt_ the ability to repackage
it." (Chad)

http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/115240

Trying to twist and turn and stuff the square peg into the round
hole to turn a gem into an RPM is outside the scope of the design of
RubyGems.

Some time ago, RubyGems' TODO noted:
  "* RPM, Mac OS dmg/pkg, Debian pkg, MSI, etc. conversion (at least one
  or two)"
  http://tinyurl.com/cujmp

If you take a look at the TODO nowadays, you'll see that
  "* Integration with platform-native packaging systems"
  http://tinyurl.com/7fvvo
is one of RubyGems' goals.

It is therefore clear that the RubyGems team do indeed care about making
Ruby software available in other formats besides RubyGems packages.
Also, the RubyGems team is committed to making RubyGems packages easy to
repackage:
  http://www.ruby-talk.org/cgi-bin/scat.rb/ruby/ruby-talk/121047
(it is unfortunate that #ruby-lang only began to be logged recently)

If you and a sufficiently large number of other end users feel
that it should be easy to turn gems into RPMs or one of the other Linux
package formats then that should become a new requirement of the system.
But I imagine it would require a lot of work and probably negative
compromises, so there had better be a lot of good reasons to do it beyond
"it allows me to install rails with one command."

There are good reasons to require that a standard upstream format allow
several repackagers to operate (I could try to expand on that in another
message if you wish but I want to keep this one short). Repackagers do
a worthy (and often not sufficiently appreciated) contribution to Ruby
users by making Ruby software available to them in forms best suited for
their systems. And they have done so for a long time.

It'd instead think that there must be a really, really good reason[1] to
make their life harder by making Ruby software nearly unpackageable. And
there is no reason to alienate them, as you do when you imply that their
work is irrelevant. It would have been much more polite to contact them
before.

After all these people know the most about (re)packaging.

> And before you say "... just use gems", let me point out something:
>
> To run, say, Rails, with gems:
>
> 1) manually install ruby
> 2) manually install rubygems
> 3) gem install rails

As others have said, steps 1 and 2 only have to be done once for you to
use any current gem. To use RPMs you need RedHat or SuSE or one of the
other RPM distros, yet you left that out of your second shorter example.

What about this example... On my system,

apt-get install librdf-ruby

installs, amongst others,

libcurl3, libdb4.2, libidn11, libmysqlclient12, libraptor1, librasqal0, librdf0,
libsqlite3-0, libssl0.9.7, libxml2, libxslt1.1, zlib1g, liblog4r-ruby1.8

This is something RubyGems cannot (and will not be able to) do.
And it's OK, the Debian developers know how to package it and their toolchain
supports it. That's why you definitely do not want to make librdf-ruby hard to
repackage, for the opposite would lead to a net loss of functionality, and
deploying librdf-ruby would become substantially more difficult for a lot of
people.

[1] the fact that there's a lot of work to be done means that the problem is
    a bit more complex than reflected by RubyGems' current model. Being a lazy
    programmer is good (I'm also trying to improve in that regard), but this
    is not good enough a reason to alienate repackagers and ignore their work
    and experience.

···

On Thu, Jul 07, 2005 at 01:04:37AM +0900, Ryan Leavengood wrote:

--
Mauricio Fernandez

Well said. I agree 100%.

James Edward Gray II

···

On Jul 6, 2005, at 1:20 PM, Lothar Scholz wrote:

Yes, but i think the idea is to not provide an alternative. IMHO the
way we should go is to enforce the use of rubygems as a primary
solution and so to force development on rubygems, its not that much
work that must be done, but it must be done sooner or later.

I think this is the way you get the best technology - unfortunately
it is not popular for many open source developers.

Rubygems could be a killer feature for ruby, so we should use it.

Hi All,

The Pickaxe (2e) gives an example of drawing on a TkCanvas. The code is published on the book's website here:

http://www.pragmaticprogrammer.com/titles/ruby/code/smp262.html

I run this with no changes. When I click on the canvas, the script crashes with this message:

/usr/local/lib/ruby/1.8/tk.rb:1383: [BUG] cross-thread violation on ip_ruby_cmd()
ruby 1.8.2 (2004-12-25) [i686-linux]

The offending line is simply the mainloop method:
  def mainloop(check_root = true)
    TclTkLib.mainloop(check_root)
  end

I find nothing in the errata for the book about this script not working, so I assume the problem is with my ruby installation or my linux setup. Any ideas where I can begin looking?

I am running Ruby 1.8.2 with KDE 3.4 on Kubuntu 5.0.4.

Thanks!

-dB

···

--
David Brady
ruby-talk@shinybit.com
I'm having a really surreal day... OR AM I?

David Brady wrote:

Hi All,

The Pickaxe (2e) gives an example of drawing on a TkCanvas. The code is
published on the book's website here:

http://www.pragmaticprogrammer.com/titles/ruby/code/smp262.html

I run this with no changes. When I click on the canvas, the script
crashes with this message:

/usr/local/lib/ruby/1.8/tk.rb:1383: [BUG] cross-thread violation on
ip_ruby_cmd()
ruby 1.8.2 (2004-12-25) [i686-linux]

The offending line is simply the mainloop method:
def mainloop(check_root = true)
   TclTkLib.mainloop(check_root)
end

I find nothing in the errata for the book about this script not working,
so I assume the problem is with my ruby installation or my linux setup.
Any ideas where I can begin looking?

I am running Ruby 1.8.2 with KDE 3.4 on Kubuntu 5.0.4.

Works find for me, also with ruby 1.8.2, KDE3.4, Kubuntu 5.0.4. However,
I built Tcl/Tk from scratch with pthread disabled (the default). This
was instead of using the ubuntu packages which seem to have pthread
enabled. See:

http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/147279

Message-ID: <42CD5404.6060203@shinybit.com>

/usr/local/lib/ruby/1.8/tk.rb:1383: [BUG] cross-thread violation on
ip_ruby_cmd()
ruby 1.8.2 (2004-12-25) [i686-linux]

Please check pthread support status of Ruby and Tcl/Tk on your
environment.
The following table shows that the combination works or not.

                   Tcl/Tk libraries

···

From: David Brady <ruby_talk@shinybit.com>
Subject: cross-thread violation in TkCanvas when clicked
Date: Fri, 8 Jul 2005 01:10:54 +0900
                +----------+------------
        pthread | enable | disable
      +---------+----------+------------
      > enable | OK | maybe work
Ruby +---------+----------+------------
      > disable | SEGV | OK

If both of Ruby and Tcl/Tk libraries are enabled pthread,
please try the latest version (on CVS) of tcltklib.c.
Maybe your trouble is fixed, because some changes were applied
to tcltklib.c to avoid SEGV after 1.8.2 release.
At least, I cannot reproduce the trouble on my environment.

Vine Linux 2.6r4
ruby 1.8.3 (2005-07-05) [i686-linux] (--enable-pthread --enable-tcltk-stubs)
TclTkLib::RELEASE_DATE == "2005-07-05"
Tk::TK_PATCHLEVEL == "8.5a3" (--enable-thread)

--
Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)

Way too ironic to see a hijacked thread with the subject line 'cross
thread violation' :slight_smile: Seriously, please do start a new thread rather than
hit 'reply to' and change the subject.

martin

···

David Brady <ruby_talk@shinybit.com> wrote:

Hi All,

The Pickaxe (2e) gives an example of drawing on a TkCanvas. The code is
published on the book's website here:

Hidetoshi NAGAI wrote:

please try the latest version (on CVS) of tcltklib.c.

THANK YOU!

That worked.

I rebuilt Tcl/Tk but could not find any way to disable pthread. It comes with the option --enable-thread, but I tried both with no success. (enable-thread != enable-pthread, perhaps?)

I got Ruby 1.9.0 from CVS and built it. THANK YOU to the authors: I built it without enable-pthread and there was a test in the makefile that warned me that tcl/tk had pthreads enabled, but ruby did not, and I should start over.

Once I did, Tk is working fine, threads and all.

Thank you again!

-dB

···

--

David Brady
ruby-talk@shinybit.com
I'm having a really surreal day... OR AM I?

Martin DeMello wrote:

Way too ironic to see a hijacked thread with the subject line 'cross
thread violation' :slight_smile: Seriously, please do start a new thread rather than
hit 'reply to' and change the subject.

I haven't been on a mailing list in years, and have forgotten my list manners: I forgot that reply to preserves the thread id.

My apologies. I'll get back in the habit of typing to: lines. :slight_smile:

-dB

···

--

David Brady
ruby-talk@shinybit.com
I'm having a really surreal day... OR AM I?

Message-ID: <42CE02B1.3010200@shinybit.com>

I rebuilt Tcl/Tk but could not find any way to disable pthread. It
comes with the option --enable-thread, but I tried both with no
success. (enable-thread != enable-pthread, perhaps?)

Ah, sorry.
On Tcl/Tk, enable option of native thread (pthread) is
"--enable-threads" (require "s" at last).
So, if you want to disable pthread, you must do "configure"
without "--enable-threads" or with "--disable-threads".

···

From: David Brady <ruby_talk@shinybit.com>
Subject: Re: cross-thread violation in TkCanvas when clicked
Date: Fri, 8 Jul 2005 13:36:16 +0900
--
Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)