installing extmath on MAC OS X

V

Van Jacques

MAC OS X comes with ruby installed (v.1.6.7), which is nice.
I am trying to install Jupp's extmath package on my machine,
and am having some problems.
(Note that even if you are the system admin. for your MAC(s),
you must use sudo to install anything.)

After installing extmath successfully, I tried to run test.rb,
and got the following error message:

test.rb:1:in `require': No such file to load -- runit/testcase (LoadError)
from ./test.rb:1

The first line of test.rb is

require 'runit/testcase'

Suggestions?

Van
 
S

Samuel Kvarnbrink

MAC OS X comes with ruby installed (v.1.6.7), which is nice.
I am trying to install Jupp's extmath package on my machine,
and am having some problems.
(Note that even if you are the system admin. for your MAC(s),
you must use sudo to install anything.)

<OT>OS X has a root account just like any other *nix, but root login is
disabled by default. Running "sudo passwd root" will enable root login,
so that you won't need to run sudo. said:
After installing extmath successfully, I tried to run test.rb,
and got the following error message:

test.rb:1:in `require': No such file to load -- runit/testcase
(LoadError)
from ./test.rb:1

The first line of test.rb is

require 'runit/testcase'

Suggestions?

The Ruby installation that comes with OS X is a bit crippled when it
comes to libraries, and runit/testcase is one of the things that's
missing. My suggestion is that you download and compile the Ruby 1.8
source so that you get a complete and up-to-date Ruby installation.
Also, I'm sure that there is a binary Ruby 1.8 installer for OS X
available somewhere (although compiling Ruby from source actually is
very easy).

cheers
//samuel
 
J

Josef 'Jupp' SCHUGT

Hi!

* Van Jacques; 2003-12-13, 15:37 UTC:
[Ruby 1.6.7 on Mac OS X fails to run testcase]
Suggestions?

Install RubyUnit.

Note to myself: Add information that for running testcases either Ruby
1.8 or installation of RubyUnit is required.

Josef 'Jupp' SCHUGT
 
V

Van Jacques

' SCHUGT said:
* Van Jacques; 2003-12-13, 15:37 UTC:
[Ruby 1.6.7 on Mac OS X fails to run testcase]
Suggestions?

Install RubyUnit.

Note to myself: Add information that for running testcases either Ruby
1.8 or installation of RubyUnit is required.

Josef 'Jupp' SCHUGT

Please bear with me, as my UNIX is extremely basic, and this
is the first time I have installed anything. I would
like to upgrade to 1.8 when I am competent enough.

A couple of questions.
--------
Here is my output from running test.rb from the
extmath-2.3 package.

---------------
[jacques-computer:~/ruby/extmath-2.3] sylvanjacques% ls -l
total 184
-rwxr-xr-x 1 sylvanja staff 36 Aug 25 23:25 ChangeLog
-rwxr-xr-x 1 sylvanja staff 18092 Aug 26 12:11 GPL.txt
-rwxr-xr-x 1 sylvanja staff 2506 Aug 20 15:24 INSTALL
-rw-r--r-- 1 root staff 40 Dec 12 22:47 InstalledFiles
-rwxr-xr-x 1 sylvanja staff 446 Aug 29 22:12 README
-rw-r--r-- 1 sylvanja staff 322 Dec 12 22:42 config.save
drwxr-xr-x 6 sylvanja staff 204 Aug 26 13:50 doc
-rwxr-xr-x 1 sylvanja staff 23667 Aug 28 19:12 install.rb
drwxr-xr-x 3 sylvanja staff 102 Aug 29 22:12 lib
-rwxr-xr-x 1 sylvanja staff 28173 Dec 12 23:06 test.rb
[jacques-computer:~/ruby/extmath-2.3] sylvanjacques% ruby test.rb

Testing_class#test_constants .
Testing_class#test_conversions .
Testing_class#test_explog_consistency .
Testing_class#test_explog_functions .
Testing_class#test_hyperbolic_consistency E.
Testing_class#test_hyperbolic_functions E.
Testing_class#test_misc_consistency E.
Testing_class#test_misc_functions E.
Testing_class#test_pwr_consistency .
Testing_class#test_pwr_functions .
Testing_class#test_rounding_functions .
Testing_class#test_sign_consistency .
Testing_class#test_sign_functions .
Testing_class#test_solvers .
Testing_class#test_tensors .
Testing_class#test_trigonometric_consistency E.
Testing_class#test_trigonometric_functions E.
Time: 0.141849
FAILURES!!!
Test Results:
Run: 17/17(213 asserts) Failures: 0 Errors: 6
Errors: 6
../lib/extmath.rb:275:in `csch'(Testing_class): undefined method `sinh'
for Math:Module (NameError)
from ./test.rb:513:in `test_hyperbolic_consistency'
from ./test.rb:622
../test.rb:100:in `test_hyperbolic_functions'(Testing_class): undefined
method `acosh' for Math:Module (NameError)
from ./test.rb:622
../lib/extmath.rb:327:in `erf'(Testing_class): undefined method `erf'
for Math:Module (NameError)
from ./test.rb:613:in `test_misc_consistency'
from ./test.rb:622
../lib/extmath.rb:327:in `erf'(Testing_class): undefined method `erf'
for Math:Module (NameError)
from ./test.rb:386:in `test_misc_functions'
from ./test.rb:622
../lib/extmath.rb:113:in `acos'(Testing_class): undefined method `acos'
for Math:Module (NameError)
from ./test.rb:453:in `test_trigonometric_consistency'
from ./test.rb:622
../test.rb:34:in `test_trigonometric_functions'(Testing_class):
undefined method `asin' for Math:Module (NameError)
from ./test.rb:622
[jacques-computer:~/ruby/extmath-2.3] sylvanjacques%
---------
When I look at the InstalledFiles in extmath-2.3, I get

[jacques-computer:~/ruby/extmath-2.3] sylvanjacques% cat
InstalledFiles
/usr/lib/ruby/site_ruby/1.6//extmath.rb

What does the double // mean in the path name?
------
Here is the config.save file;

[jacques-computer:~/ruby/extmath-2.3] sylvanjacques% more config.save
bin-dir=$prefix/bin
site-ruby=$prefix/lib/ruby/site_ruby/1.6
prefix=/usr
ruby-path=/usr/bin/ruby
make-prog=make
rb-dir=$site-ruby
without-ext=no
ruby-prog=/usr/bin/ruby
site-ruby-common=$prefix/lib/ruby/site_ruby
std-ruby=$prefix/lib/ruby/1.6
data-dir=$prefix/share
so-dir=$prefix/lib/ruby/site_ruby/1.6/powerpc-darwin6.0
-----
Here are the files on my MAC;

[jacques-computer:ruby/site_ruby/1.6] sylvanjacques% pwd
/usr/lib/ruby/site_ruby/1.6
[jacques-computer:ruby/site_ruby/1.6] sylvanjacques% ls -l
total 56
-rw-r--r-- 1 root wheel 21008 Dec 12 22:47 extmath.rb
drwxr-xr-x 2 root wheel 68 Jan 14 2003 powerpc-darwin6.0
-rw-r--r-- 1 root wheel 785 Dec 14 03:00 rubyunit.rb
drwxr-xr-x 16 root wheel 544 Dec 14 03:00 runit
-------
the so-dir is
/usr/lib/ruby/site_ruby/1.6/powerpc-darwin6.0
It's an empty directory.
The INSTALL doc from extmath-2.3 says that so-dir
is the directory for ruby extentions. Does this mean
that extmath.rb and rubyunit.rb (and runit) should be in the
powerpc-darwin6.0 dir? Or are they in the right place.
If so, why the error messages when running test.rb
from extmath-2.3?

Van
 
V

Van Jacques

Samuel Kvarnbrink said:
<OT>OS X has a root account just like any other *nix, but root login is
disabled by default. Running "sudo passwd root" will enable root login,
so that you won't need to run sudo. <OT>
The Ruby installation that comes with OS X is a bit crippled when it
comes to libraries, and runit/testcase is one of the things that's
missing. My suggestion is that you download and compile the Ruby 1.8
source so that you get a complete and up-to-date Ruby installation.
Also, I'm sure that there is a binary Ruby 1.8 installer for OS X
available somewhere (although compiling Ruby from source actually is
very easy).

cheers
//samuel

Maybe this is the source of my latest problems (see the other thread on this).
And thanks for the info on sudo. I think you are right about ruby 1.8
for OS X--I'll post here if I find it, and I will install the complete
1.8 version and see what happens.

I just tried "sudo passwd root"

and got

[jacques-computer:~] sylvanjacques% sudo passwd root
Password:
root: No such file or directory
0.00 real 0.00 user 0.00 sys
---
where passwd was my password. I then did it with the word "passwd"
and got

[jacques-computer:~] sylvanjacques% sudo passwd root
Changing password for root.
New password:
Password must be at least 5 characters long.
New password:
Retype new password:

So I changed my password--my old one was only 4 characters long.
I don't know if this enable root login though. I will find out later.
BTW, I have OS 10.2.8.
Van
 
J

Josef 'Jupp' SCHUGT

Hi!

* Van Jacques:
FAILURES!!!
Test Results:
Run: 17/17(213 asserts) Failures: 0 Errors: 6
Errors: 6
../lib/extmath.rb:275:in `csch'(Testing_class): undefined method `sinh'
for Math:Module (NameError)
from ./test.rb:513:in `test_hyperbolic_consistency'
from ./test.rb:622
../test.rb:100:in `test_hyperbolic_functions'(Testing_class): undefined
method `acosh' for Math:Module (NameError)
from ./test.rb:622
../lib/extmath.rb:327:in `erf'(Testing_class): undefined method `erf'
for Math:Module (NameError)
from ./test.rb:613:in `test_misc_consistency'
from ./test.rb:622
../lib/extmath.rb:327:in `erf'(Testing_class): undefined method `erf'
for Math:Module (NameError)
from ./test.rb:386:in `test_misc_functions'
from ./test.rb:622
../lib/extmath.rb:113:in `acos'(Testing_class): undefined method `acos'
for Math:Module (NameError)
from ./test.rb:453:in `test_trigonometric_consistency'
from ./test.rb:622
../test.rb:34:in `test_trigonometric_functions'(Testing_class):
undefined method `asin' for Math:Module (NameError)
from ./test.rb:622

Mince alors !

You are right. There are several functions new in 1.8 that I use. I
don't have 1.6 so I didn't notice that :-|

Sorry, you will have to upgrade to 1.8 to use extmath (which in any
case makes sense because 1.6.7 not even the most recent 1.6 branch
version).
What does the double // mean in the path name?

Nothing. It is equivalent to just having one slash.

Josef 'Jupp' SCHUGT
 
S

Samuel Kvarnbrink

Maybe this is the source of my latest problems (see the other thread
on this).
And thanks for the info on sudo. I think you are right about ruby 1.8
for OS X--I'll post here if I find it, and I will install the complete
1.8 version and see what happens.

Rich Kilmer has a very good step-by-step guide on how to retrieve the
latest cvs version of Ruby and compile it. Even though it's focused on
10.3, it should apply just fine on 10.2.x as well.

http://richkilmer.blogs.com/ether/2003/10/building_ruby_1.html

cheers
//samuel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
474,141
Messages
2,570,817
Members
47,361
Latest member
eitamoro

Latest Threads

Top