C compiler cannot create executables

Asked by hero1971

Try to install Ruby on Linux. However, when i try to run following, it gives me erro

laptop:~/Desktop/ruby-1.8.5$ sudo ./configure && make && make install
Password:
checking build system type... i686-pc-linux-gnulibc1
checking host system type... i686-pc-linux-gnulibc1
checking target system type... i686-pc-linux-gnulibc1
checking for gcc... gcc
checking for C compiler default output file name... configure: error: C compiler cannot create executables

Anybody has idea about that, thanks

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu firefox Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Utkarshraj Atmaram (utcursch) said :
#1

You need to install some development tools that are not installed by default. This should help:

sudo apt-get install build-essential

Revision history for this message
hero1971 (jihengbai) said :
#2

Thank you for your help. But when i try to continute to install. the message is like following, it seem like 'mkdir' permission denied

mkdir -p -m 755 /usr/local/lib/ruby/1.8 /usr/local/lib/ruby/1.8/i686-linux /usr/local/lib/ruby/site_ruby/1.8 /usr/local/lib/ruby/site_ruby/1.8/i686-linux
/home/jihengb/Desktop/ruby-1.8.4/lib/fileutils.rb:240:in `mkdir': Permission denied - /usr/local/lib/ruby (Errno::EACCES)
        from /home/jihengb/Desktop/ruby-1.8.4/lib/fileutils.rb:240:in `fu_mkdir'
        from /home/jihengb/Desktop/ruby-1.8.4/lib/fileutils.rb:217:in `makedirs'
        from /home/jihengb/Desktop/ruby-1.8.4/lib/fileutils.rb:215:in `makedirs'
        from /home/jihengb/Desktop/ruby-1.8.4/lib/fileutils.rb:201:in `makedirs'
        from /home/jihengb/Desktop/ruby-1.8.4/lib/fileutils.rb:1508:in `makedirs'
        from ./instruby.rb:81:in `makedirs'
        from ./instruby.rb:109
make: *** [do-install-local] Error 1

Revision history for this message
Utkarshraj Atmaram (utcursch) said :
#3

Are you using sudo before ./configure && make && make install?

From the above message, it seems that your make was successful, but make install failed, because you don't have write permissions for /usr/local/

By the way, if you are using Feisty, and want to install ruby 1.8.5 through apt-get, do sudo apt-get ruby1.8
Doing sudo apt-get ruby will install ruby 1.8.2-1, and doing sudo apt-get ruby1.9 will install ruby 1.9

Revision history for this message
hero1971 (jihengbai) said :
#4

Yes. I use command like following:
sudo ./configure && make && make install.

Still give me the wrong message. i am installing ruby 1.8.4. do you mean try sudo apt-get install ruby1.8. it is not working. How do i solve the write permissions for /us/local/ ??? it is still same erro after running?.

Thanks a lot!!!

Revision history for this message
Hanusz leszek (leszek-skynet) said :
#5

Hello,
If you want to install ruby on ubuntu, the easiest method is to use a precompiled package, try:
sudo apt-get install ruby

If you really want to compile ruby from source, then the correct command is:
./configure && make && sudo make install

Revision history for this message
hero1971 (jihengbai) said :
#6

sudo apt-get install ruby works fine !!! Thanks a lot !!! One question,

when I type ruby -v, it shows: ruby 1.8.4 (2005-12-24) [i486-linux]

I guess that's mean ruby already install ??

Revision history for this message
Utkarshraj Atmaram (utcursch) said :
#7

Yup, you have ruby installed now :-)

Revision history for this message
hero1971 (jihengbai) said :
#8

Thank You!!!!!

What commands for install : RubyGems and Rail ??? Please help. i need to get this done

In fact, this is my first time using Linux. I just follow the book to install. But Can not be sucessful until you guys direct me.

Revision history for this message
Utkarshraj Atmaram (utcursch) said :
#9

For installing Ruby on Rails and RubyGems, use this:
sudo apt-get install rails rubygems

Here are the package details:
http://packages.ubuntu.com/feisty/web/rails
http://packages.ubuntu.com/feisty/interpreters/rubygems

Revision history for this message
hero1971 (jihengbai) said :
#10

Sorry, it still shows some mistakes

:~/Desktop$ sudo apt-get install rails rubygems
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package rails

Also, for some reason, even though i have ruby install, why i can not find any directory and file for ruby 1.8.4

Thanks a lot!!

Revision history for this message
Hanusz leszek (leszek-skynet) said :
#11

Hello,

to install rails, you have to add the universe repository,
howto here: https://help.ubuntu.com/community/Repositories/Ubuntu#head-5bbef89639d9a7d93fe38f6356dc17847d373096

Revision history for this message
Hanusz leszek (leszek-skynet) said :
#12

hmm in fact this howto is not really up-to-date,

you can add the universe repository with:
System->Administration->Software sources

Revision history for this message
Hanusz leszek (leszek-skynet) said :
#13

And if you want to know which files are installed for the ruby package,
go to synaptic: System->Administration->Synaptic Package Manager
Search for ruby
right-click on ruby -> Properties
Go to 'installed Files' tab

Revision history for this message
hero1971 (jihengbai) said :
#14

I try to use following link to install rubygems:
http://packages.ubuntu.com/feisty/interpreters/rubygems

it gave me message "Error:Dependency is not satisfiable : libgems-ruby1.8

Also, when itry to command:sudo apt-get install rails rubygems

E: Couldn't find package rubygems

FYI:I already add universe repository

Thank for your help !!!

Revision history for this message
Hanusz leszek (leszek-skynet) said :
#15

Hello,

What is the result of this command ? :
sudo apt-cache madison libgems-ruby1.8 rubygems

Does running "sudo apt-get update" solve this ?

What is the content of /etc/apt/sources.list file ? :
cat /etc/apt/sources.list

Revision history for this message
hero1971 (jihengbai) said :
#16

after run : sudo apt-cache madison libgems-ruby1.8 rubygems .
I still have the same problem: E: Couldn't find package rubygems

After run "sudo apt-get update" , The erro message is below:

E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

i tired to cat sources.lst. no such directory. I used synaptic package manage found there is no cotents in source.lst but in source:

Revision history for this message
Hanusz leszek (leszek-skynet) said :
#17

You made a typo, it is "cat /etc/apt.sources.list" NOT "cat /source.lst"

about the error with sudo apt-get update, it means that a update program is open and is blocking access to other update programs, closing the update program or rebooting the computer should fix this problem.

Revision history for this message
hero1971 (jihengbai) said :
#18

Ok. I will try that soon and will let you know about it.

By the way, what is command for install MYsql database.

could you give me the steps for downlaon ruby,rails, rubygems and mySQl. I saw some sites have by click one to download for whole package. I don't know know if there is one click to donwload everything for Linux. Please give me the steps.

Revision history for this message
hero1971 (jihengbai) said :
#19

still not work. Can somebody help to install that thing !!! i was so painful.

Right now . I ma try to install ubygems. after i run ruby setup.rb
give me the erro:

/usr/local/lib/ruby/site_ruby/1.8/rubygems/remote_fetcher.rb:4:in `require': no such file to load -- zlib (LoadError)
        from /usr/local/lib/ruby/site_ruby/1.8/rubygems/remote_fetcher.rb:4
        from /usr/local/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:8
        from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:504
        from /home/jiheng/Desktop/rubygems-0.9.4/./post-install.rb:81:in `install_sources'
        from /home/jiheng/Desktop/rubygems-0.9.4/./post-install.rb:116:in `run_hook'
        from setup.rb:1526:in `exec_task_traverse'
        from setup.rb:1342:in `exec_install'
        from setup.rb:1000:in `exec_install'
        from setup.rb:814:in `invoke'
        from setup.rb:773:in `invoke'
        from setup.rb:1578

Please help. I don't understand why just install this to Linux are so difficult???

Revision history for this message
Hanusz leszek (leszek-skynet) said :
#20

Hello again,

You still didn't answer my question, what is the content of the /etc/apt/sources.list file ?
please type the following in a terminal (without errors) and report the output here:
cat /etc/apt/sources.list

Revision history for this message
hero1971 (jihengbai) said :
#21

PLEASE SEE BELOW REPORT:

:~/rubygems-0.9.0$ cat /etc/apt/sources.list

deb cdrom:[Ubuntu 6.10 _Edgy Eft_ - Release i386 (20061025)]/ edgy main restricted

deb http://us.archive.ubuntu.com/ubuntu/ edgy main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ edgy main restricted universe multiverse

## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.archive.ubuntu.com/ubuntu/ edgy-updates main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ edgy-updates main restricted universe multiverse

## Uncomment the following two lines to add software from the 'universe'
## repository.
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## universe WILL NOT receive any review or updates from the Ubuntu security
## team.
# deb http://us.archive.ubuntu.com/ubuntu/ edgy universe
# deb-src http://us.archive.ubuntu.com/ubuntu/ edgy universe

## Uncomment the following two lines to add software from the 'backports'
## repository.
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
# deb http://us.archive.ubuntu.com/ubuntu/ edgy-backports main restricted universe multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ edgy-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu edgy-security main restricted universe multiverse
deb-src http://security.ubuntu.com/ubuntu edgy-security main restricted universe multiverse
# deb http://security.ubuntu.com/ubuntu edgy-security universe
deb http://archive.ubuntu.com/ubuntu/ edgy-proposed restricted main multiverse universe
deb-src http://archive.ubuntu.com/ubuntu/ edgy-proposed restricted main multiverse universe
deb http://archive.ubuntu.com/ubuntu/ edgy-backports restricted main multiverse universe
deb-src http://archive.ubuntu.com/ubuntu/ edgy-backports restricted main multiverse universe
# deb-src http://security.ubuntu.com/ubuntu edgy-security universe

Revision history for this message
Hanusz leszek (leszek-skynet) said :
#22

ahhhhhhh

You should have told us you are still using ubuntu edgy.
Please upgrade to feisty.
more information here:
http://www.ubuntu.com/getubuntu/upgrading

Revision history for this message
hero1971 (jihengbai) said :
#23

Taje so long to upgrade. what's wrong with this software. i almost given up. Would you just tell how to uninstalll the linx. I don't want to install anymore. I feel really sad. so many mistakes. i could not figure out. I know i am using the old version. however, why it is so many problems.....I could not understand !!! i also try to donwload 7.04 v to my live cd. It takes so long to download (15% only but already 4 hours)

But thank you for your help !!!

Revision history for this message
hero1971 (jihengbai) said :
#24

one question:

do i have to download 7.04 desktop eidition or server edition ? i need to post my site in public

Thanks

Revision history for this message
Ralph Janke (txwikinger) said :
#25

The desktop edition automatically installs a graphical desktop (gnome for ubuntu, kde for kubuntu, xfce for xubuntu). The server edition does not, but instead installs automatically some server software (i.e. webserver, database etc.)

In general you can start with either edition since you can always install all software later. However, it makes sense to use the one that is from the beginning closer to what you want to do.

Revision history for this message
hero1971 (jihengbai) said :
#26

if i want to install ruby on rails. so i need to install server edidtion or desktop edition. Please advise

thanks

Revision history for this message
hero1971 (jihengbai) said :
#27

when i trird to run :sudo apt-get install ruby ri rdoc libmysql-ruby

E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

Revision history for this message
Markus Thielmann (thielmann) said :
#28

Thanks for your question.

Please close Synaptic Package Manager before calling that command.

Revision history for this message
Utkarshraj Atmaram (utcursch) said :
#29

You can install ruby on rails on the server edition as well as the desktop edition. Since, the desktop edition automatically installs a graphical desktop, I'd recommend desktop edition for you. (though you can also install a graphical desktop on server edition as well).

Can you help with this problem?

Provide an answer of your own, or ask hero1971 for more information if necessary.

To post a message you must log in.