[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

compile of Ruby fails on Ubuntu

Navjeet Chabbewal

8/15/2006 7:48:00 PM

I recently upgraded my Ubuntu to Dapper. I am trying to compile ruby on
it. After running configure I edit the ext/Setup file and uncomment the
following lines:

digest
digest/md5
openssl
readline
stringio
zlib


and then I run make which fails with following message

Quote:
SETUP=ext/Setup
EXTOBJS=ext/extinit.o ext/digest/digest.a ext/digest/md5/md5.a
ext/openssl/openssl.a ext/stringio/stringio.a ext/zlib/zlib.a
EXTLIBS=-lssl -lcrypto -lz
making ruby
make[1]: Entering directory `/home/navjeet/ruby-1.8.4'
gcc -g -O2 -DRUBY_EXPORT -rdynamic -Wl,-export-dynamic -L. main.o
ext/extinit.o ext/digest/digest.a ext/digest/md5/md5.a
ext/openssl/openssl.a ext/stringio/stringio.a ext/zlib/zlib.a
-lruby-static -ldl -lcrypt -lm -lssl -lcrypto -lz -o ruby
ext/digest/md5/md5.a(md5init.o).data.rel+0x: undefined reference to
`rb_Digest_MD5_Init'
ext/digest/md5/md5.a(md5init.o).data.rel+0xc): undefined reference to
`rb_Digest_MD5_Update'
ext/digest/md5/md5.a(md5init.o).data.rel+0x10): undefined reference to
`rb_Digest_MD5_End'
ext/digest/md5/md5.a(md5init.o).data.rel+0x14): undefined reference to
`rb_Digest_MD5_Final'
ext/digest/md5/md5.a(md5init.o).data.rel+0x1: undefined reference to
`rb_Digest_MD5_Equal'
collect2: ld returned 1 exit status
make[1]: *** [ruby] Error 1
make[1]: Leaving directory `/home/navjeet/ruby-1.8.4'
make: *** [all] Error 2

What could be the source of this error? Do you think I may not have some
library installed or something else?

-Jeet

--
Posted via http://www.ruby-....

9 Answers

Cam

8/15/2006 8:05:00 PM

0

I think if you just do "apt-get build-dep ruby" you should be able to
compile it.

cam

On 8/15/06, Navjeet Chabbewal <navjeetc@gmail.com> wrote:
> I recently upgraded my Ubuntu to Dapper. I am trying to compile ruby on
> it. After running configure I edit the ext/Setup file and uncomment the
> following lines:
>
> digest
> digest/md5
> openssl
> readline
> stringio
> zlib
>
>
> and then I run make which fails with following message
>
> Quote:
> SETUP=ext/Setup
> EXTOBJS=ext/extinit.o ext/digest/digest.a ext/digest/md5/md5.a
> ext/openssl/openssl.a ext/stringio/stringio.a ext/zlib/zlib.a
> EXTLIBS=-lssl -lcrypto -lz
> making ruby
> make[1]: Entering directory `/home/navjeet/ruby-1.8.4'
> gcc -g -O2 -DRUBY_EXPORT -rdynamic -Wl,-export-dynamic -L. main.o
> ext/extinit.o ext/digest/digest.a ext/digest/md5/md5.a
> ext/openssl/openssl.a ext/stringio/stringio.a ext/zlib/zlib.a
> -lruby-static -ldl -lcrypt -lm -lssl -lcrypto -lz -o ruby
> ext/digest/md5/md5.a(md5init.o).data.rel+0x: undefined reference to
> `rb_Digest_MD5_Init'
> ext/digest/md5/md5.a(md5init.o).data.rel+0xc): undefined reference to
> `rb_Digest_MD5_Update'
> ext/digest/md5/md5.a(md5init.o).data.rel+0x10): undefined reference to
> `rb_Digest_MD5_End'
> ext/digest/md5/md5.a(md5init.o).data.rel+0x14): undefined reference to
> `rb_Digest_MD5_Final'
> ext/digest/md5/md5.a(md5init.o).data.rel+0x1: undefined reference to
> `rb_Digest_MD5_Equal'
> collect2: ld returned 1 exit status
> make[1]: *** [ruby] Error 1
> make[1]: Leaving directory `/home/navjeet/ruby-1.8.4'
> make: *** [all] Error 2
>
> What could be the source of this error? Do you think I may not have some
> library installed or something else?
>
> -Jeet
>
> --
> Posted via http://www.ruby-....
>
>

Cliff Cyphers

8/15/2006 8:07:00 PM

0

Navjeet Chabbewal wrote:
> I recently upgraded my Ubuntu to Dapper. I am trying to compile ruby on
> it. After running configure I edit the ext/Setup file and uncomment the
> following lines:
>
> digest
> digest/md5
> openssl
> readline
> stringio
> zlib
>

Maybe you want to use --disable-FEATURE as options to configure.sh
instead of updating setup?


Navjeet Chabbewal

8/15/2006 8:14:00 PM

0

shawn bright wrote:
> there are some libs that ubuntu requires. something about yaml and
> something
> else, dont remember.
> i used this guide
> http://weblog.freeopinion.org/articles/2005/11/17/setting-up-ruby...
>
> and it seemed to work.
>

That did not help.

> any reason you are not using apt? i actually got ruby on dapper by
> apt-get install ruby1.8
> then made a symlink to /usr/bin/ruby
>
> hope this helps

Well I did that finally which took care of ruby but now I have similar
9if not same) problem when running ruby setup.rb to build rubygems as
shown below:

/usr/local/lib/ruby/1.8/i686-linux/digest/md5.so:
/usr/local/lib/ruby/1.8/i686-linux/digest/md5.so: undefined symbol:
rb_Digest_MD5_Init - /usr/local/lib/ruby/1.8/i686-linux/digest/md5.so
(LoadError)
from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/package.rb:10
from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/builder.rb:7
from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:93:in
`manage_gems'
from /home/navjeet/rubygems-0.9.0/./post-install.rb:70:in
`install_sources'
from /home/navjeet/rubygems-0.9.0/./post-install.rb:81:in
`try_run_hook'
from setup.rb:577:in `run_hook'
from setup.rb:1315:in `exec_task_traverse'
from setup.rb:1168:in `exec_install'
from setup.rb:887:in `exec_install'
from setup.rb:705:in `invoke'
from setup.rb:674:in `invoke'


--
Posted via http://www.ruby-....

Navjeet Chabbewal

8/15/2006 8:15:00 PM

0

Cameron Matheson wrote:
> I think if you just do "apt-get build-dep ruby" you should be able to
> compile it.
>
> cam

Cameron,


See my previous response about rubygems problem.



--
Posted via http://www.ruby-....

Cliff Cyphers

8/15/2006 8:37:00 PM

0

Navjeet Chabbewal wrote:
> Cameron Matheson wrote:
>> I think if you just do "apt-get build-dep ruby" you should be able to
>> compile it.
>>
>> cam
>
> Cameron,
>
>
> See my previous response about rubygems problem.
>
>
>
The above will install all dependencies (libs) that are required to
build ruby from source.

Navjeet Chabbewal

8/15/2006 9:23:00 PM

0

Cliff Cyphers wrote:
> Navjeet Chabbewal wrote:
>>
>>
>>
> The above will install all dependencies (libs) that are required to
> build ruby from source.

Cliff,

The ruby has been installed now using apt-get, but similar issue is
there running ruby setup.rb in rubygems source code as I mention above.




--
Posted via http://www.ruby-....

Cam

8/15/2006 9:38:00 PM

0

Hey,

> The ruby has been installed now using apt-get, but similar issue is
> there running ruby setup.rb in rubygems source code as I mention above.

If i understand you correctly, you have installed the ubuntu packages
of ruby? In that case, the errors you are getting from setup.rb
indicate that it is trying to use the stuff that you compiled yourself
in /usr/local/lib/ ... maybe you should delete that stuff and try
again.

cam

Navjeet Chabbewal

8/15/2006 10:30:00 PM

0

Cameron Matheson wrote:
> Hey,
>
>> The ruby has been installed now using apt-get, but similar issue is
>> there running ruby setup.rb in rubygems source code as I mention above.
>
> If i understand you correctly, you have installed the ubuntu packages
> of ruby? In that case, the errors you are getting from setup.rb
> indicate that it is trying to use the stuff that you compiled yourself
> in /usr/local/lib/ ... maybe you should delete that stuff and try
> again.
>
> cam

Well thanks for that clue Cameron. I did the ultimate, blew away
/user/local/lib/ruby and started with a fresh install using apt-get and
so far ruby, gems and rails are up and running.

Thanks to all who responded to my message.


--
Posted via http://www.ruby-....

Lionel H

10/1/2008 9:39:00 PM

0


"Joel" wrote:

> The code you posted ... was too hard to fix so I rewrote the code

I did the same thing, but not so quickly.
Thefollowing produces the result you are looking for with the data you
provided, but does it without using a third column. It also takes account of
your later info about three workbooks.

Sub Call_CompareAndShift()
Application.ScreenUpdating = False
Workbooks.Add
ActiveWorkbook.SaveAs "c:\bookc.xls"
Workbooks.Open "c:\booka.xls"
Workbooks("booka.xls").Worksheets(1).Range("A:A").Copy
Workbooks("bookc.xls").Activate
Sheets(1).Cells(1, 1).Select
Workbooks("bookc.xls").Sheets(1).Paste
Application.CutCopyMode = False
Application.DisplayAlerts = False
Workbooks("booka.xls").Close
Application.DisplayAlerts = True
Workbooks.Open "c:\bookb.xls"
Workbooks("bookb.xls").Worksheets(1).Range("A:A").Copy
Workbooks("bookc.xls").Activate
Sheets(1).Cells(1, 2).Select
Workbooks("bookc.xls").Sheets(1).Paste
Application.CutCopyMode = False
Application.DisplayAlerts = False
Workbooks("bookb.xls").Close
Application.DisplayAlerts = True
CompareAndShift "A:A", "B:B"
Application.ScreenUpdating = True
End Sub

Sub CompareAndShift(LRange As String, Rrange As String)
Dim aRow As Integer, bRow As Integer
Dim ShortCol As String
Dim LastRowL As Integer, LastRowR As Integer
Dim LCol As String, RCol As String

LCol = Left(LRange, 1)
RCol = Left(Rrange, 1)

Columns(LRange).Sort Key1:=Range(LCol & 1), Order1:=xlAscending
Columns(Rrange).Sort Key1:=Range(RCol & 1), Order1:=xlAscending

LastRowL = Cells(Rows.Count, LCol).End(xlUp).Row
LastRowR = Cells(Rows.Count, RCol).End(xlUp).Row

If LastRowL > LastRowR Then
bRow = LastRowL
ShortCol = RCol
Else
bRow = LastRowR
ShortCol = LCol
End If

For aRow = bRow To 1 Step -1
If Cells(aRow, LCol) = Cells(bRow, RCol) Or Cells(bRow, ShortCol) = ""
Then
'do nothing
ElseIf Cells(aRow, LCol) < Cells(bRow, RCol) Then
ShiftIt bRow, RCol, aRow, LCol
Else
ShiftIt aRow, LCol, bRow, RCol
End If
bRow = bRow - 1
Next aRow
End Sub

Sub ShiftIt(PrimaryShift As Integer, PSCol As String, SecondaryShift As
Integer, SSCol As String)
Cells(PrimaryShift, PSCol).Insert shift:=xlDown
If Cells(SecondaryShift + 1, SSCol) <> Cells(PrimaryShift + 1, PSCol) Then
Cells(SecondaryShift + 1, SSCol).Insert shift:=xlDown
Else
Cells(PrimaryShift + 2, PSCol).Delete shift:=xlUp
End If
End Sub