You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@buildr.apache.org by Olivier Poppon <op...@gmail.com> on 2008/05/04 14:12:43 UTC

problems with scala

Hi,

I am new to scala and buildr...so I guess there are things I have done  
wrong.
I am running OS X Leopard, just downloaded buildr 1.3

Before the complaints, I want to say that I like what I have seen from  
this tool. I am fed up with all the xml everywhere   beyond its main  
purpose. So it is refreshing to see people getting rid of this.

The complaints:
1) buildr alone : I was under the impression from the doc, that when  
you type "buildr" on the command line it should display 2 options and  
a prompt line. That is not the case for me. Buildr displays : "No  
projects defined for directory /Users/olivier/Documents/Projects"  
twice, in red.

2) I have created a little buildfile, for a project with the  
recommended structure. It works fine for a java project. But if I  
duplicate the structure and adapt it for scala, it does not work and I  
have the following error:
Building toto
Compiling toto
rake aborted!
scala/tools/nsc/Main

Here is a bit of the trace:
/Library/Ruby/Gems/1.8/gems/buildr-1.3.0/lib/buildr/java/rjb.rb:69:in  
`import'
/Library/Ruby/Gems/1.8/gems/buildr-1.3.0/lib/buildr/java/rjb.rb:69:in  
`method_missing'
/Library/Ruby/Gems/1.8/gems/buildr-1.3.0/lib/buildr/java/compilers.rb: 
154:in `compile'
/Library/Ruby/Gems/1.8/gems/buildr-1.3.0/lib/buildr/core/compile.rb: 
227:in `initialize'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:544:in `call'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:544:in `execute'

The strange thing is that if I use the scalac command displayed when  
using the --trace option, and run it alone, it works fine and create  
the classes.

Any recommandation is welcome.

Thanks,
Olivier






Re: problems with scala

Posted by n8han <na...@technically.us>.

Olivier Poppon wrote:
> 
> I am not to familiar with the gem package manager (it shows :)
> 

I'm no expert either. I did have a ton of problems with it at first, mostly
having to do with me not noticing which ruby was runnning, which gem, which
buildr, and where the gems were being installed. If all of those are what
you want them to be, it tends to work. If it doesn't I've been known to rm
-rf a gem repo and start over. ;)

Nathan
-- 
View this message in context: http://www.nabble.com/problems-with-scala-tp17045732p17069472.html
Sent from the Buildr - User mailing list archive at Nabble.com.


Re: problems with scala

Posted by Olivier POPPON <op...@gmail.com>.
got it to work. at last

I tried mac ports but didn't really made a difference (so I removed it  
in the end)

So I removed all the gems from the Mac (the standard installation)

The I did:
sudo update_rubygems

then
sudo env JAVA_HOME=$JAVA_HOME gem install buildr

Thanks to the both of you for your help

Now just need to find some Flex plugin :)

On 5 mai 08, at 17:36, Assaf Arkin wrote:

> try sudo update_rubygems
>
> Assaf
>
> On Mon, May 5, 2008 at 1:12 AM, Olivier POPPON <op...@gmail.com>  
> wrote:
>
>> At the office, here is what I did (I am on OS X as well)
>>
>>> buildr -- version
>> ==> 1.2.0
>> I tried to type buildr (only) and I have the 2 questions with the  
>> prompt
>> (perfect !)
>>
>> So I decide to upgrade it:
>>> sudo gem update buildr
>> ==> the process starts and finish properly. Tells me that 1.3.0 is
>> installed
>>
>> Now I type buildr
>> ==> error. Rake is not high enough (version) ???? I thought the gem  
>> update
>> was suppose to get all dependencies for me...
>>
>> So I update rake
>>> sudo gem update rake
>>
>> and I had to do the same for: Antwrap, hoe and finally RubyGem
>>
>> For RubyGem I did:
>>> sudo gem update --system
>>
>> now everything is broken.
>> I can't type rails, or buildr.
>>
>> I have this error : Could not find RubyGem rubyforge (>= 0.4.4)
>> (Gem::LoadError)
>>
>> Again sorry to bother you with all these...I am not to familiar  
>> with the
>> gem package manager (it shows :)
>>
>>
>> On 4 mai 08, at 22:00, n8han wrote:
>>
>>
>>> I don't have any GEM_* variables in my env. As long as you are  
>>> getting the
>>> right macports executables (under /opt/local/bin) when you run  
>>> `which
>>> ruby`
>>> and `which gem` you should be fine to `gem install buildr` into  
>>> the new
>>> gem
>>> repository. `gem env` is also a nice sanity check.
>>>
>>> Nathan
>>> --
>>> View this message in context:
>>> http://www.nabble.com/problems-with-scala-tp17045732p17050669.html
>>> Sent from the Buildr - User mailing list archive at Nabble.com.
>>>
>>>
>>
>
>
> -- 
> CTO, Intalio
> http://www.intalio.com


Re: problems with scala

Posted by Assaf Arkin <ar...@intalio.com>.
try sudo update_rubygems

Assaf

On Mon, May 5, 2008 at 1:12 AM, Olivier POPPON <op...@gmail.com> wrote:

> At the office, here is what I did (I am on OS X as well)
>
> >buildr -- version
> ==> 1.2.0
> I tried to type buildr (only) and I have the 2 questions with the prompt
> (perfect !)
>
> So I decide to upgrade it:
> >sudo gem update buildr
> ==> the process starts and finish properly. Tells me that 1.3.0 is
> installed
>
> Now I type buildr
> ==> error. Rake is not high enough (version) ???? I thought the gem update
> was suppose to get all dependencies for me...
>
> So I update rake
> > sudo gem update rake
>
> and I had to do the same for: Antwrap, hoe and finally RubyGem
>
> For RubyGem I did:
> >sudo gem update --system
>
> now everything is broken.
> I can't type rails, or buildr.
>
> I have this error : Could not find RubyGem rubyforge (>= 0.4.4)
> (Gem::LoadError)
>
> Again sorry to bother you with all these...I am not to familiar with the
> gem package manager (it shows :)
>
>
> On 4 mai 08, at 22:00, n8han wrote:
>
>
>> I don't have any GEM_* variables in my env. As long as you are getting the
>> right macports executables (under /opt/local/bin) when you run `which
>> ruby`
>> and `which gem` you should be fine to `gem install buildr` into the new
>> gem
>> repository. `gem env` is also a nice sanity check.
>>
>> Nathan
>> --
>> View this message in context:
>> http://www.nabble.com/problems-with-scala-tp17045732p17050669.html
>> Sent from the Buildr - User mailing list archive at Nabble.com.
>>
>>
>


-- 
CTO, Intalio
http://www.intalio.com

Re: problems with scala

Posted by Olivier POPPON <op...@gmail.com>.
At the office, here is what I did (I am on OS X as well)

 >buildr -- version
==> 1.2.0
I tried to type buildr (only) and I have the 2 questions with the  
prompt (perfect !)

So I decide to upgrade it:
 >sudo gem update buildr
==> the process starts and finish properly. Tells me that 1.3.0 is  
installed

Now I type buildr
==> error. Rake is not high enough (version) ???? I thought the gem  
update was suppose to get all dependencies for me...

So I update rake
 > sudo gem update rake

and I had to do the same for: Antwrap, hoe and finally RubyGem

For RubyGem I did:
 >sudo gem update --system

now everything is broken.
I can't type rails, or buildr.

I have this error : Could not find RubyGem rubyforge (>= 0.4.4)  
(Gem::LoadError)

Again sorry to bother you with all these...I am not to familiar with  
the gem package manager (it shows :)

On 4 mai 08, at 22:00, n8han wrote:

>
> I don't have any GEM_* variables in my env. As long as you are  
> getting the
> right macports executables (under /opt/local/bin) when you run  
> `which ruby`
> and `which gem` you should be fine to `gem install buildr` into the  
> new gem
> repository. `gem env` is also a nice sanity check.
>
> Nathan
> -- 
> View this message in context: http://www.nabble.com/problems-with-scala-tp17045732p17050669.html
> Sent from the Buildr - User mailing list archive at Nabble.com.
>


Re: problems with scala

Posted by Olivier Poppon <op...@gmail.com>.
Here is the current environment, with macports installed

co2:olivier:~ $ gem env
RubyGems Environment:
   - RUBYGEMS VERSION: 1.1.1
   - RUBY VERSION: 1.8.6 (2008-03-03 patchlevel 114) [i686-darwin9.2.2]
   - INSTALLATION DIRECTORY:
   - RUBY EXECUTABLE: /opt/local/bin/ruby
   - RUBYGEMS PLATFORMS:
     - ruby
     - x86-darwin-9
   - GEM PATHS:
      -
   - GEM CONFIGURATION:
      - :update_sources => true
      - :verbose => true
      - :benchmark => false
      - :backtrace => false
      - :bulk_threshold => 1000
   - REMOTE SOURCES:
      - http://gems.rubyforge.org

Don't know why GEM PATHS and INSTALLATION DIRECTORY show  
nothing...that could explain the problem I face now:
It refuses to install any gem:

co2:olivier:~ $ gem install buildr
Bulk updating Gem source index for: http://gems.rubyforge.org/
ERROR:  Error installing buildr:
	net-ssh requires needle (>= 1.2.0)

Looking into /opt/local/lib/ruby/gems/1.8/gems, I have : (I may have  
tried to install rails using : port install rb-rails to test, but why  
is it not downloading version 2 ?
actionmailer-1.3.3	actionwebservice-1.2.3	activesupport-1.4.2	rake-0.7.3
actionpack-1.13.3	activerecord-1.15.3	rails-1.2.3

Sorry to bother you with this. Going to bed so you will have peace for  
a while :)

Thanks for your help

Olivier



On 4 mai 08, at 22:00, n8han wrote:

>
> I don't have any GEM_* variables in my env. As long as you are  
> getting the
> right macports executables (under /opt/local/bin) when you run  
> `which ruby`
> and `which gem` you should be fine to `gem install buildr` into the  
> new gem
> repository. `gem env` is also a nice sanity check.
>
> Nathan
> -- 
> View this message in context: http://www.nabble.com/problems-with-scala-tp17045732p17050669.html
> Sent from the Buildr - User mailing list archive at Nabble.com.
>


Re: problems with scala

Posted by n8han <na...@technically.us>.
I don't have any GEM_* variables in my env. As long as you are getting the
right macports executables (under /opt/local/bin) when you run `which ruby`
and `which gem` you should be fine to `gem install buildr` into the new gem
repository. `gem env` is also a nice sanity check.

Nathan
-- 
View this message in context: http://www.nabble.com/problems-with-scala-tp17045732p17050669.html
Sent from the Buildr - User mailing list archive at Nabble.com.


Re: problems with scala

Posted by Olivier Poppon <op...@gmail.com>.
@Nathan
sorry to be a pain.
I have installed ruby and rubygems from macports. I wanted to install  
buildr, but it does not seem to exist.
Do I need to setup GEM_PATH and GEM_HOME (if you could give a hint on  
the path :)

@Assaf
The directory have changed between scala 2.7 and 2.6. There is no  
share anymore.
But my scala environment is fine, it is working fine so far.


On 4 mai 08, at 19:21, n8han wrote:

>
> Okay. I think they changed the directory layout going from 2.6 to  
> 2.7. My
> 2.7.0 SCALA_HOME is /opt/local/share/scala/ and under that I have  
> "bin lib
> meta misc src". Could be the problem.
>
> Macports cohabits with no issues in my exp. Everything goes under
> /opt/local, with its bin dir at the front of your path. When you  
> build up a
> gem repo it goes under that as well.
>
> Nathan
> -- 
> View this message in context: http://www.nabble.com/problems-with-scala-tp17045732p17048958.html
> Sent from the Buildr - User mailing list archive at Nabble.com.
>


Re: problems with scala

Posted by n8han <na...@technically.us>.
Okay. I think they changed the directory layout going from 2.6 to 2.7. My
2.7.0 SCALA_HOME is /opt/local/share/scala/ and under that I have "bin lib
meta misc src". Could be the problem.

Macports cohabits with no issues in my exp. Everything goes under
/opt/local, with its bin dir at the front of your path. When you build up a
gem repo it goes under that as well.

Nathan
-- 
View this message in context: http://www.nabble.com/problems-with-scala-tp17045732p17048958.html
Sent from the Buildr - User mailing list archive at Nabble.com.


Re: problems with scala

Posted by Assaf Arkin <ar...@intalio.com>.
On Sun, May 4, 2008 at 9:50 AM, Olivier Poppon <op...@gmail.com> wrote:

> I just did the cleanup (it removed a previous version), but I still don't
> get the prompt.
> Scala is 2.6.0-final
> SCALA_HOME is pointing to where I installed scala (so a ls displays bin and
> share directory)


can you look into the share directory?  I think that's the one holding bin
and lib, and the one SCALA_HOME should point into.


>
>
> You might be right that it could be more something in my ruby configuration
> (standard leopard).
>
> Is it not a problem to have 2 ruby systems (standard and macports ?)


buildr -v will tell you which version of Buildr you're running, and which
buildr would return /usr/bin/buildr if installed for the standard Ruby,
/opt/local/bin if installed with MacPorts Ruby.

If you have both, only one gets used when you run commands like ruby or gem,
depending on the path, and MacPorts puts itself first on the path.  But if
you installed Buildr on standard Ruby first, that's the one it will pick up
from /usr/bin so you need to gem install buildr again.

Assaf


>
> On 4 mai 08, at 18:35, n8han wrote:
>
>
>> I do get the two options for creating a buildfile in an empty dir. Do you
>> have any older version of buildr also installed? "gem cleanup buildr" ?
>> Generally the OS X built-in ruby is cursed. I use macports ruby,
>> rb-rubgems,
>> and scala packages and everything works. What version Scala do you have
>> installed, and what's SCALA_HOME set to?
>>
>> Nathan
>> --
>> View this message in context:
>> http://www.nabble.com/problems-with-scala-tp17045732p17048472.html
>> Sent from the Buildr - User mailing list archive at Nabble.com.
>>
>>
>

Re: problems with scala

Posted by Olivier Poppon <op...@gmail.com>.
I just did the cleanup (it removed a previous version), but I still  
don't get the prompt.
Scala is 2.6.0-final
SCALA_HOME is pointing to where I installed scala (so a ls displays  
bin and share directory)

You might be right that it could be more something in my ruby  
configuration (standard leopard).

Is it not a problem to have 2 ruby systems (standard and macports ?)

On 4 mai 08, at 18:35, n8han wrote:

>
> I do get the two options for creating a buildfile in an empty dir.  
> Do you
> have any older version of buildr also installed? "gem cleanup  
> buildr" ?
> Generally the OS X built-in ruby is cursed. I use macports ruby, rb- 
> rubgems,
> and scala packages and everything works. What version Scala do you  
> have
> installed, and what's SCALA_HOME set to?
>
> Nathan
> -- 
> View this message in context: http://www.nabble.com/problems-with-scala-tp17045732p17048472.html
> Sent from the Buildr - User mailing list archive at Nabble.com.
>


Re: problems with scala

Posted by n8han <na...@technically.us>.
I do get the two options for creating a buildfile in an empty dir. Do you
have any older version of buildr also installed? "gem cleanup buildr" ?
Generally the OS X built-in ruby is cursed. I use macports ruby, rb-rubgems,
and scala packages and everything works. What version Scala do you have
installed, and what's SCALA_HOME set to?

Nathan
-- 
View this message in context: http://www.nabble.com/problems-with-scala-tp17045732p17048472.html
Sent from the Buildr - User mailing list archive at Nabble.com.