Traits question

How does one install traits 0.7?

I tried
  - ruby install.rb
and
  - ruby install.rb setup ...(etc.)

No error message in either case, but
    require 'traits'
still fails (no such file to load).

Thanks!

I'm guessing you're running on Windows.

If you look in your site_ruby directory
(C:\ruby\lib\ruby\site_ruby\1.8 on my machine), you'll find a file
called traits-0.7.0.rb. Copy it and/or rename to traits.rb.

Regards,

Sean

···

On 10/6/05, itsme213 <itsme213@hotmail.com> wrote:

How does one install traits 0.7?

hmmm. it shouldn't. all my packages install

   name-version.rb

and

   name.rb

so a

   require 'name-version'

gets a specific version and a

   require 'name'

gets whatever the latest.

'name' is always just a link to 'name-version.rb' may the link isn't working
under windows? when i install it looks like this:

   jib:~/eg/ruby/traits/traits-0.7.0 > ruby install.rb

   lib/traits-0.7.0.rb -> /dmsp/reference/ruby-1.8.1//lib/ruby/site_ruby/traits-0.7.0.rb
   chmod 0644 /dmsp/reference/ruby-1.8.1//lib/ruby/site_ruby/traits-0.7.0.rb

   lib/traits.rb -> /dmsp/reference/ruby-1.8.1//lib/ruby/site_ruby/traits.rb
   chmod 0644 /dmsp/reference/ruby-1.8.1//lib/ruby/site_ruby/traits.rb

so i see both files were copied. did that happen for you? if not simply cd
into the lib dir before installing and do

   lib > rm traits.rb
   lib > cp traits-0.7.0.rb traits.rb

and then run 'ruby install.rb'

if that fixes your problem i can assume that links are not working under
windows and i'd like to fix this - probably with a copy hack in the installer.

so, first question, when you unpack the tgz are both files in the lib dir? if
so are they both regular files?

cheers.

-a

···

On Thu, 6 Oct 2005, itsme213 wrote:

How does one install traits 0.7?

I tried
- ruby install.rb
and
- ruby install.rb setup ...(etc.)

No error message in either case, but
   require 'traits'
still fails (no such file to load).

Thanks!

--

email :: ara [dot] t [dot] howard [at] noaa [dot] gov
phone :: 303.497.6469
Your life dwells amoung the causes of death
Like a lamp standing in a strong breeze. --Nagarjuna

===============================================================================

Hi Ara,

hard links (File.link) work under Windows but soft links (File.symlink) don't.
What are you using?

This is the output of install.rb on my PC:

C:\setup\ruby\traits-0.7.0>ruby install.rb
lib/traits-0.7.0.rb -> c:/ruby/lib/ruby/site_ruby/1.8/traits-0.7.0.rb
chmod 0644 c:/ruby/lib/ruby/site_ruby/1.8/traits-0.7.0.rb

Sean

hard links (File.link) work under Windows but soft links (File.symlink)
don't. What are you using?

neither. the link exists in the lib directory when i tar up the package.
what does it unpack as then?

This is the output of install.rb on my PC:

C:\setup\ruby\traits-0.7.0>ruby install.rb
lib/traits-0.7.0.rb -> c:/ruby/lib/ruby/site_ruby/1.8/traits-0.7.0.rb
chmod 0644 c:/ruby/lib/ruby/site_ruby/1.8/traits-0.7.0.rb

so it does not see the link... what IS in lib for you?

thanks for helping me out with this.

-a

···

On Thu, 6 Oct 2005, Sean O'Halpin wrote:
--

email :: ara [dot] t [dot] howard [at] noaa [dot] gov
phone :: 303.497.6469
Your life dwells amoung the causes of death
Like a lamp standing in a strong breeze. --Nagarjuna

===============================================================================

neither. the link exists in the lib directory when i tar up the package.
what does it unpack as then?

Just the traits-0.7.0.rb file.

The traits.rb link isn't visible in Winzip (which I and I guess most
Windows users will be using to unpack tars). Actually, it's pretty
smart of Winzip to know that softlinks won't work.

tar.exe (from the UnixWin32 project on SourceForge) lists trait.rb but
fails when you try to extract it. (It attempts to do a hardlink but
fails).

I reckon the best way to handle this on Windows would be to copy the
file (and overwrite anything there with the same name). I'd be chary
about using hard links - they are available but a foreign concept to
most Windows users.

Regards,

Sean

cool. i tried cygwin and winrar and they both handle the link properly while
unpacking and the install works.

basically i need to tweak the install.rb script to do

   versioned = Dir[ 'lib/*-[0-9].[0-9].[0-9].rb' ]

   versioned.each{ |v| FileUtils::copy(v, v.gsub(%r/-\d+\.\d+\.\d+/,'')) }

and it should work.

i'll hack a fix and let you guys test.... gimmee 10 minutes or so.

-a

···

On Thu, 6 Oct 2005, Sean O'Halpin wrote:

neither. the link exists in the lib directory when i tar up the package.
what does it unpack as then?

Just the traits-0.7.0.rb file.

The traits.rb link isn't visible in Winzip (which I and I guess most
Windows users will be using to unpack tars). Actually, it's pretty
smart of Winzip to know that softlinks won't work.

tar.exe (from the UnixWin32 project on SourceForge) lists trait.rb but
fails when you try to extract it. (It attempts to do a hardlink but
fails).

I reckon the best way to handle this on Windows would be to copy the
file (and overwrite anything there with the same name). I'd be chary
about using hard links - they are available but a foreign concept to
most Windows users.

--

email :: ara [dot] t [dot] howard [at] noaa [dot] gov
phone :: 303.497.6469
Your life dwells amoung the causes of death
Like a lamp standing in a strong breeze. --Nagarjuna

===============================================================================

can you try again (download again)? i tweaked the installer to make the copy
for you so it should work on windows and unix.

regards.

-a

···

On Thu, 6 Oct 2005, Sean O'Halpin wrote:

neither. the link exists in the lib directory when i tar up the package.
what does it unpack as then?

Just the traits-0.7.0.rb file.

The traits.rb link isn't visible in Winzip (which I and I guess most
Windows users will be using to unpack tars). Actually, it's pretty
smart of Winzip to know that softlinks won't work.

tar.exe (from the UnixWin32 project on SourceForge) lists trait.rb but
fails when you try to extract it. (It attempts to do a hardlink but
fails).

I reckon the best way to handle this on Windows would be to copy the
file (and overwrite anything there with the same name). I'd be chary
about using hard links - they are available but a foreign concept to
most Windows users.

Regards,

Sean

--

email :: ara [dot] t [dot] howard [at] noaa [dot] gov
phone :: 303.497.6469
Your life dwells amoung the causes of death
Like a lamp standing in a strong breeze. --Nagarjuna

===============================================================================

Hi Ara - well, the good news is that the new install.rb creates both a
traits-0.7.0.rb and a traits.rb file.

The bad news is that they are both zero length.

Almost there... :slight_smile:

Sean

···

On 10/6/05, Ara.T.Howard <Ara.T.Howard@noaa.gov> wrote:

can you try again (download again)? i tweaked the installer to make the copy
for you so it should work on windows and unix.

no bugs in them though eh?

:wink:

that's really odd. it works on this win box - i'll look into it...

-a

···

On Fri, 7 Oct 2005, Sean O'Halpin wrote:

On 10/6/05, Ara.T.Howard <Ara.T.Howard@noaa.gov> wrote:

can you try again (download again)? i tweaked the installer to make the copy
for you so it should work on windows and unix.

Hi Ara - well, the good news is that the new install.rb creates both a
traits-0.7.0.rb and a traits.rb file.

The bad news is that they are both zero length.

--

email :: ara [dot] t [dot] howard [at] noaa [dot] gov
phone :: 303.497.6469
Your life dwells amoung the causes of death
Like a lamp standing in a strong breeze. --Nagarjuna

===============================================================================

that's really odd. it works on this win box - i'll look into it...

I just noticed that traits-0.7.0.rb is zero length in the tar.

no bugs in them though eh?

It's certainly the best way to avoid them :wink:

Sean

o.k. - it __should__ be good now - i had too dang many logins going on at once
and was on the wrong machine. the code should be longer than zero lines now
and thus, not bug free.

it should install though.

-a

···

On Fri, 7 Oct 2005, Sean O'Halpin wrote:

that's really odd. it works on this win box - i'll look into it...

I just noticed that traits-0.7.0.rb is zero length in the tar.

no bugs in them though eh?

It's certainly the best way to avoid them :wink:

--

email :: ara [dot] t [dot] howard [at] noaa [dot] gov
phone :: 303.497.6469
Your life dwells amoung the causes of death
Like a lamp standing in a strong breeze. --Nagarjuna

===============================================================================

o.k. - it __should__ be good now - i had too dang many logins going on at once
and was on the wrong machine.

oh yeah - that old one :wink:

the code should be longer than zero lines now

it is

and thus, not bug free.

this seems to be an inescapable law of programming

it should install though.

it does!

Sean

P.S. I never got the hang of this new-fangled gem stuff either :wink:
P.P.S. Hope nobody heard that

works now, thanks a bunch!

"Ara.T.Howard" <Ara.T.Howard@noaa.gov> wrote in message
news:Pine.LNX.4.62.0510061504220.24345@harp.ngdc.noaa.gov...

>> that's really odd. it works on this win box - i'll look into it...
>
> I just noticed that traits-0.7.0.rb is zero length in the tar.
>
>> no bugs in them though eh?
>
> It's certainly the best way to avoid them :wink:

o.k. - it __should__ be good now - i had too dang many logins going on at

once

and was on the wrong machine. the code should be longer than zero lines

now

···

On Fri, 7 Oct 2005, Sean O'Halpin wrote:
and thus, not bug free.

it should install though.

-a
--

============================================================================

> email :: ara [dot] t [dot] howard [at] noaa [dot] gov
> phone :: 303.497.6469
> Your life dwells amoung the causes of death
> Like a lamp standing in a strong breeze. --Nagarjuna

============================================================================