Rbplusplus gem problem

A

Axel Etzold

Dear all,

I am having some trouble getting the Rbplusplus gem
http://rbplusplus.rubyforge.org/rbplusplus/
to work ...
I get an uninitialized constant error, which I suspect has something
to do with the sequence of requiring the gems. But I can't fix it,
since I need the Extension class from the rbplusplus gem:

------------------------------------------
Ruby code:

require "rubygems"
require 'rbplusplus'
include RbPlusPlus

working_dir = File.expand_path(File.dirname(__FILE__) + "/generated")
p working_dir
Extension.new "first" do |e|
e.sources "one.cpp"
e.working_dir = working_dir
end

-------------------------------------------
C++ code one.cpp:

#include <stdio.h>

int main()
{
printf("This is output from my first program!\n");
return 0;
}

-------------------------------------------
Output:

$ruby rb.rb
"/home/axel/rbpp/generated"
/var/lib/gems/1.8/gems/rbplusplus-0.1/lib/rbplusplus/extension.rb:173:in `prepare_working_dir': uninitialized constant RbPlusPlus::Extension::FileUtils (NameError)
from /var/lib/gems/1.8/gems/rbplusplus-0.1/lib/rbplusplus/extension.rb:143:in `write'
from /var/lib/gems/1.8/gems/rbplusplus-0.1/lib/rbplusplus/extension.rb:72:in `initialize'
from rb.rb:8:in `new'
from rb.rb:8

Thank you for your help,

Best regards,

Axel
 
T

Thorsten Hater

Hello,

I've got the same bug.
This is resolved by requiring the 'fileutils' in extension.rb.

Best regards,
Thorsten

Am 10.05.2008 um 22:49 schrieb Axel Etzold:
 
A

Axel Etzold

-------- Original-Nachricht --------
Datum: Sun, 11 May 2008 07:17:20 +0900
Von: Thorsten Hater <[email protected]>
An: (e-mail address removed)
Betreff: Re: Rbplusplus gem problem
Hello,

I've got the same bug.
This is resolved by requiring the 'fileutils' in extension.rb.

Best regards,
Thorsten

Am 10.05.2008 um 22:49 schrieb Axel Etzold:
Dear all,

I am having some trouble getting the Rbplusplus gem
http://rbplusplus.rubyforge.org/rbplusplus/
to work ...
I get an uninitialized constant error, which I suspect has something
to do with the sequence of requiring the gems. But I can't fix it,
since I need the Extension class from the rbplusplus gem:

------------------------------------------
Ruby code:

require "rubygems"
require 'rbplusplus'
include RbPlusPlus

working_dir = File.expand_path(File.dirname(__FILE__) + "/generated")
p working_dir
Extension.new "first" do |e|
e.sources "one.cpp"
e.working_dir = working_dir
end

-------------------------------------------
C++ code one.cpp:

#include <stdio.h>

int main()
{
printf("This is output from my first program!\n");
return 0;
}

-------------------------------------------
Output:

$ruby rb.rb
"/home/axel/rbpp/generated"
/var/lib/gems/1.8/gems/rbplusplus-0.1/lib/rbplusplus/extension.rb:
173:in `prepare_working_dir': uninitialized constant
RbPlusPlus::Extension::FileUtils (NameError)
from /var/lib/gems/1.8/gems/rbplusplus-0.1/lib/rbplusplus/
extension.rb:143:in `write'
from /var/lib/gems/1.8/gems/rbplusplus-0.1/lib/rbplusplus/
extension.rb:72:in `initialize'
from rb.rb:8:in `new'
from rb.rb:8

Thank you for your help,

Best regards,

Axel

Thorsten,

thank you very much!

Best regards,

Axel
 

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

Members online

Forum statistics

Threads
473,786
Messages
2,569,626
Members
45,328
Latest member
66Teonna9

Latest Threads

Top