Advertise here: Contact FM.


I don't pretend to be a unix or any kind of expert
January 14, 2006 4:26 PM   RSS feed for this thread Subscribe

Dumb question about curl and setting up Ruby on Rails from an extreme novice.

Here's the question, and I'll follow with some more background information: is curl supposed to just stop when it's done? I am using curl to download readline. Curl says it has downloaded everything, but keeps running. I quit out of curl and attempt to unzip readline. I get the following error:


gzip: stdin: unexpected end of file
tar: Read 1655 bytes from readline-5.1.tar.gz
tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now


What am I doing wrong?

Background information: I have been doing marketing and (lately) technical writing for the Web for a long time. I have enough html knowledge to build a basic site, but was kind of curious to see if I could do any programming, sort of as a lark. Since everyone is talking about Ruby and AJAX and all that nifty stuff, I decided to try with that program. But I am stuck setting it up (see this tutorial).
posted by lackutrol to computers & internet (16 comments total)
The file is truncated, or is not what you think it is. What do the commands

file readline-5.1.tar.gz
ls -l readline-5.1.tar.gz

return?
posted by mendel at 4:48 PM on January 14, 2006


curl should quit on its own when it's done. I tried downloading it and curl exited normally for me after the file was finished. I then ran tar xzvf and it uncompressed just fine.

I don't know why curl wouldn't be exiting on its own. You could always try downloading the files with a different app.
posted by epugachev at 4:50 PM on January 14, 2006


Try with wget.
posted by orthogonality at 4:59 PM on January 14, 2006


mendel, your first command returns:

readline-5.1.tar.gz: gzip compressed data, was "readline-5.1.tar", from Unix

Your second returns:

-rw-r--r-- 1 jeffreyd jeffreyd 2027520 Jan 14 18:22 readline-5.1.tar.gz

Is that helpful?

Orthagonality, would that just mean using "wget" rather than "curl" in the command?
posted by lackutrol at 5:21 PM on January 14, 2006


"Orthgonality," sorry.
posted by lackutrol at 5:22 PM on January 14, 2006


I dunno, because you didn't show us you initial command line. But probably. I'm assuming you did: curl url, and suggesting you try wget url
posted by orthogonality at 5:24 PM on January 14, 2006


Looking at that tutorial, I assume you did

curl -O ftp://ftp.gnu.org/gnu/readline/readline-5.1.tar.gz

What orthogonality means is, try

wget ftp://ftp.gnu.org/gnu/readline/readline-5.1.tar.gz

instead.
posted by epugachev at 5:41 PM on January 14, 2006


I have had the *exact* same problem. Installing readline using curl from ftp.gnu.org -- curl hangs before finishing. I had to use wget instead. I think actually I couldn't get anything to download from ftp.gnu.org using curl (but a manual ftp worked.)

As wget doesn't come standard with OSX, try ftp.

# ftp ftp.gnu.org
Connected to ftp.gnu.org.
220 GNU FTP server ready.
Name (ftp.gnu.org:username): anonymous
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> cd gnu/readline
250 Directory successfully changed.
ftp> get readline-5.1.tar.gz
local: readline-5.1.tar.gz remote: readline-5.1.tar.gz
229 Entering Extended Passive Mode (|||35877|)
150 Opening BINARY mode data connection for readline-5.1.tar.gz (2030276 bytes).
2030276 bytes received in 00:05 (346.12 KB/s)
ftp> quit
221 Goodbye.
# tar zxvf ...

posted by neustile at 5:41 PM on January 14, 2006


or just paste the url into your web browser.
posted by epugachev at 5:42 PM on January 14, 2006


Incidentally, I've had some dealings with curl's author. He's a smart guy and will appreciate a thorough bug report.
posted by orthogonality at 5:54 PM on January 14, 2006


OK, using neustile's directions, I got the download to work properly. Thanks! But, if I may, I'd like to ask about another error message. When I enter:

./configure --prefix=/usr/local

I get the following:

checking whether make sets $(MAKE)... no
checking for gcc... no
checking for cc... no
checking for cc... no
checking for cl... no
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.


Can anyone tell me what's up with that?
posted by lackutrol at 6:41 PM on January 14, 2006


Oh, and I'll definitely send the curl author whatever information I can. It seems like a cool program, judging from the documentation I have found.
posted by lackutrol at 6:42 PM on January 14, 2006


Note that curl -v will show you the transaction as it happens. If you don't see the 2XX series code after the transfer, it wasn't successful.

That error that quick implies that the file is corrupt -- it's over 2MB, yet gzip is claiming EOF after little more than 1K of data. My first thought was "ASCII mode transfer of a binary file", but curl defaults to binary mode. If you're using a -B switch, don't -- (-B is ASCII -- yes, this isn't exactly the most intuitive switch.)

Normally, curl outputs to standard out. You use either the -o filename, or -O switch, to download directly to a file. -O will default to the remote name

So, if you could, try....

curl -v -O ftp://www.wherever.com/path/to/filename.gz
posted by eriko at 6:43 PM on January 14, 2006


Oops, crossed over.

Your new error means you don't have a c compiler installed. Presuming that you're using linux, you'll want to get GCC installed. Your distro should have a simple means of doing so.
posted by eriko at 6:45 PM on January 14, 2006


And if you're on OSX, you want to download and install Xcode, as this will install the gnu c compiler (gcc) and lots of other goodies you probably don't have but are going to need.
posted by epugachev at 7:05 PM on January 14, 2006


Yes, download XCode. You need that before doing any sort of development. It's a free download, and most likely it came with your Mac (but perhaps an older version.) Look in the "Optional Installs" or "Installers" folder in your Applications folder, if you have one, for it. If not, download it from the link epugachev gave, but you need to register for a free ADC account first.
posted by neustile at 10:24 PM on January 14, 2006


« Older I am going to Miami / Disney W...   |   Is there a way I can send a pi... Newer »
This thread is closed to new comments.


Related Questions
Help me AJAXify a portion of my project without... January 8, 2008
Where do the experienced Javascript / AJAX... April 6, 2007
Looking for web-dev book suggestions February 8, 2007
What's the step BEFORE "newbie" called? January 4, 2007
So I know HTML. What to learn next? December 10, 2006