You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@buildr.apache.org by Alex Boisvert <al...@gmail.com> on 2010/06/21 20:05:20 UTC

Re: Buildr and Cucumber

The issue has to do with Gem initialization order...

Easiest would probably to edit the gemspec to allow this combination.  (On
my system, it's located under /usr/lib/ruby/gems/1.8/gems/buildr-1.4.0/;
your system may place gems elsewhere)

Index: buildr.gemspec
===================================================================
--- buildr.gemspec    (revision 954999)
+++ buildr.gemspec    (working copy)
@@ -48,12 +48,12 @@

   # Tested against these dependencies.
   spec.add_dependency 'rake',                 '0.8.7'
   spec.add_dependency 'builder',              '2.1.2'
   spec.add_dependency 'net-ssh',              '2.0.15'
   spec.add_dependency 'net-sftp',             '2.0.2'
   spec.add_dependency 'rubyzip',              '0.9.1'
   spec.add_dependency 'highline',             '1.5.1'
-  spec.add_dependency 'json_pure',            '1.4.0'
+  spec.add_dependency 'json_pure',            '>= 1.4.0'
   spec.add_dependency 'rubyforge',            '2.0.3'
   spec.add_dependency 'hoe',                  '2.3.3'
   spec.add_dependency 'rjb',                  '1.2.5' if spec.platform.to_s
== 'ruby'

alex

On Mon, Jun 21, 2010 at 10:25 AM, Duncan McGregor <du...@oneeyedmen.com>wrote:

> Hi
>
> I'm trying Buildr for a new project and very much liking what I find (usual
> ant / Maven refugee status applies).
>
> I'd like to run some Cucumber tests using Buildr under JRuby on MacOs. But
> when I
>
> require 'cucumber'
>
> in my buildfile, I get
>
> Gem::LoadError : can't activate json_pure (~> 1.4.3, runtime) for
> ["cucumber-0.8.3"], already activated json_pure-1.4.0 for
> ["buildr-1.4.0-java"]
>
> I've used Cucumber under Rake and 'normal' Ruby without incident, but
> obviously without such nice Java support. Can suggest how to persuade buildr
> to use a later version of json_pure?
>
> Cheers
>
> Duncan McGregor
>
>
>

Re: Buildr and Cucumber

Posted by Antoine Toulme <an...@gmail.com>.
It will load the highest version available.

Sent from my iPhone

On Jun 21, 2010, at 14:38, Duncan McGregor <du...@oneeyedmen.com>  
wrote:

> OK, notwithstanding edits to this file making no difference, I'm  
> confused. If I specify >=1.4.0 will this load 1.4.0 or 1.4.3 for  
> preference?
>
> D
>
> On 21 Jun 2010, at 19:05, Alex Boisvert wrote:
>
>> The issue has to do with Gem initialization order...
>>
>> Easiest would probably to edit the gemspec to allow this  
>> combination.  (On
>> my system, it's located under /usr/lib/ruby/gems/1.8/gems/ 
>> buildr-1.4.0/;
>> your system may place gems elsewhere)
>>
>> Index: buildr.gemspec
>> ===================================================================
>> --- buildr.gemspec    (revision 954999)
>> +++ buildr.gemspec    (working copy)
>> @@ -48,12 +48,12 @@
>>
>>  # Tested against these dependencies.
>>  spec.add_dependency 'rake',                 '0.8.7'
>>  spec.add_dependency 'builder',              '2.1.2'
>>  spec.add_dependency 'net-ssh',              '2.0.15'
>>  spec.add_dependency 'net-sftp',             '2.0.2'
>>  spec.add_dependency 'rubyzip',              '0.9.1'
>>  spec.add_dependency 'highline',             '1.5.1'
>> -  spec.add_dependency 'json_pure',            '1.4.0'
>> +  spec.add_dependency 'json_pure',            '>= 1.4.0'
>>  spec.add_dependency 'rubyforge',            '2.0.3'
>>  spec.add_dependency 'hoe',                  '2.3.3'
>>  spec.add_dependency 'rjb',                  '1.2.5' if  
>> spec.platform.to_s
>> == 'ruby'
>>
>> alex
>

Re: Buildr and Cucumber

Posted by Duncan McGregor <du...@oneeyedmen.com>.
OK, notwithstanding edits to this file making no difference, I'm confused. If I specify >=1.4.0 will this load 1.4.0 or 1.4.3 for preference?

D

On 21 Jun 2010, at 19:05, Alex Boisvert wrote:

> The issue has to do with Gem initialization order...
> 
> Easiest would probably to edit the gemspec to allow this combination.  (On
> my system, it's located under /usr/lib/ruby/gems/1.8/gems/buildr-1.4.0/;
> your system may place gems elsewhere)
> 
> Index: buildr.gemspec
> ===================================================================
> --- buildr.gemspec    (revision 954999)
> +++ buildr.gemspec    (working copy)
> @@ -48,12 +48,12 @@
> 
>   # Tested against these dependencies.
>   spec.add_dependency 'rake',                 '0.8.7'
>   spec.add_dependency 'builder',              '2.1.2'
>   spec.add_dependency 'net-ssh',              '2.0.15'
>   spec.add_dependency 'net-sftp',             '2.0.2'
>   spec.add_dependency 'rubyzip',              '0.9.1'
>   spec.add_dependency 'highline',             '1.5.1'
> -  spec.add_dependency 'json_pure',            '1.4.0'
> +  spec.add_dependency 'json_pure',            '>= 1.4.0'
>   spec.add_dependency 'rubyforge',            '2.0.3'
>   spec.add_dependency 'hoe',                  '2.3.3'
>   spec.add_dependency 'rjb',                  '1.2.5' if spec.platform.to_s
> == 'ruby'
> 
> alex


Re: Buildr and Cucumber

Posted by Duncan McGregor <du...@oneeyedmen.com>.
Thank you all for the speedy resolution here - its good to be sorted before I get back to work!

Now if only finding all my iPhone data after the update was so simple...

Duncan

On 22 Jun 2010, at 01:35, Alex Boisvert wrote:

> On Mon, Jun 21, 2010 at 12:02 PM, Rhett Sutphin
> <rh...@detailedbalance.net>wrote:
> 
>> For the buildr devs: this seems like another instance where having a
>> separate bugfix vs. features track for buildr would come in handy.  It would
>> be possible to update the dependencies as new versions are vetted to work
>> with buildr so that workarounds like this aren't necessary.
>> 
> 
> I agree, we should have frequent minor releases whenever there are important
> blocking bugs.   I think this one qualifies so we should plan on doing a
> bug-fix only release in 1-2 weeks.
> 
> BTW, I filed this issue: http://issues.apache.org/jira/browse/BUILDR-459
> 
> alex


Re: Buildr and Cucumber

Posted by Alex Boisvert <al...@gmail.com>.
On Mon, Jun 21, 2010 at 12:02 PM, Rhett Sutphin
<rh...@detailedbalance.net>wrote:

> For the buildr devs: this seems like another instance where having a
> separate bugfix vs. features track for buildr would come in handy.  It would
> be possible to update the dependencies as new versions are vetted to work
> with buildr so that workarounds like this aren't necessary.
>

I agree, we should have frequent minor releases whenever there are important
blocking bugs.   I think this one qualifies so we should plan on doing a
bug-fix only release in 1-2 weeks.

BTW, I filed this issue: http://issues.apache.org/jira/browse/BUILDR-459

alex

Re: Buildr and Cucumber

Posted by Duncan McGregor <du...@oneeyedmen.com>.
On 21 Jun 2010, at 23:34, Rhett Sutphin wrote:
> 
> I think the one that rubygems uses for dependency resolution is in the specifications directory, parallel to gems.  So in your case:
> 
> /usr/local/jruby-1.5.1/lib/ruby/gems/1.8/specifications/buildr-1.4.0-java.gemspec

Spot on, thanks. Interestingly that file is in a different format, but editing the 3 different places that the json gem version is given has me up and running, thank you.

Duncan

Re: Buildr and Cucumber

Posted by Rhett Sutphin <rh...@detailedbalance.net>.
Hi Duncan,

On Jun 21, 2010, at 4:20 PM, Duncan McGregor wrote:

> 
> On 21 Jun 2010, at 21:59, Alex Boisvert wrote:
> 
>> On Mon, Jun 21, 2010 at 1:32 PM, Duncan McGregor <du...@oneeyedmen.com>wrote:
>>> I'd found the gemspec, but editing it doesn't work. 
>>> 
>> 
>> This is probably an indication that you're editing the wrong file.   There
>> may be multiple rubygems installs on your machine (e.g. different versions
>> of Ruby, etc.)
> 
> Hmmm, the error gives 
> 
> /usr/local/jruby-1.5.1/lib/ruby/gems/1.8/gems/buildr-1.4.0-java/lib/buildr/core/application.rb:398:in `raw_load_buildfile'
> 
> and I'm editing 
> 
> /usr/local/jruby-1.5.1/lib/ruby/gems/1.8/gems/buildr-1.4.0-java/buildr.gemspec
> 
> so I reckon I'm close!

I think the one that rubygems uses for dependency resolution is in the specifications directory, parallel to gems.  So in your case:

/usr/local/jruby-1.5.1/lib/ruby/gems/1.8/specifications/buildr-1.4.0-java.gemspec

Rhett

Re: Buildr and Cucumber

Posted by Duncan McGregor <du...@oneeyedmen.com>.
On 21 Jun 2010, at 21:59, Alex Boisvert wrote:

> On Mon, Jun 21, 2010 at 1:32 PM, Duncan McGregor <du...@oneeyedmen.com>wrote:
>> I'd found the gemspec, but editing it doesn't work. 
>> 
> 
> This is probably an indication that you're editing the wrong file.   There
> may be multiple rubygems installs on your machine (e.g. different versions
> of Ruby, etc.)

Hmmm, the error gives 

/usr/local/jruby-1.5.1/lib/ruby/gems/1.8/gems/buildr-1.4.0-java/lib/buildr/core/application.rb:398:in `raw_load_buildfile'

and I'm editing 

/usr/local/jruby-1.5.1/lib/ruby/gems/1.8/gems/buildr-1.4.0-java/buildr.gemspec

so I reckon I'm close!



Re: Buildr and Cucumber

Posted by Alex Boisvert <al...@gmail.com>.
On Mon, Jun 21, 2010 at 1:32 PM, Duncan McGregor <du...@oneeyedmen.com>wrote:

> Thanks all
>
> I'd found the gemspec, but editing it doesn't work. In fact I can edit that
> line to be syntactically invalid and it still works, or rather doesn't work
> in the same way - so I guess that I need to do something to update a cache
> somewhere?
>

This is probably an indication that you're editing the wrong file.   There
may be multiple rubygems installs on your machine (e.g. different versions
of Ruby, etc.)

alex

Re: Buildr and Cucumber

Posted by Duncan McGregor <du...@oneeyedmen.com>.
Thanks all

I'd found the gemspec, but editing it doesn't work. In fact I can edit that line to be syntactically invalid and it still works, or rather doesn't work in the same way - so I guess that I need to do something to update a cache somewhere?

In the meantime I've had some success pre-loading the gem with 

jruby --1.9 -r json -S buildr

but I'm not sure that 1.9 is reliable enough, and json isn't recognized as a gem with 1.8

D

On 21 Jun 2010, at 20:02, Rhett Sutphin wrote:

> Hi,
> 
> On Jun 21, 2010, at 1:05 PM, Alex Boisvert wrote:
> 
>> The issue has to do with Gem initialization order...
>> 
>> Easiest would probably to edit the gemspec to allow this combination.  (On
>> my system, it's located under /usr/lib/ruby/gems/1.8/gems/buildr-1.4.0/;
>> your system may place gems elsewhere)
> 
> Another option which I will note for completeness is to use cucumber 0.7.3, which depends on json_pure 1.2.4 or later only.  If you don't need any cucumber 0.8.x features this will allow you to use a stock version of buildr.
> 
> For the buildr devs: this seems like another instance where having a separate bugfix vs. features track for buildr would come in handy.  It would be possible to update the dependencies as new versions are vetted to work with buildr so that workarounds like this aren't necessary.
> 
> Rhett
> 
>> 
>> Index: buildr.gemspec
>> ===================================================================
>> --- buildr.gemspec    (revision 954999)
>> +++ buildr.gemspec    (working copy)
>> @@ -48,12 +48,12 @@
>> 
>>  # Tested against these dependencies.
>>  spec.add_dependency 'rake',                 '0.8.7'
>>  spec.add_dependency 'builder',              '2.1.2'
>>  spec.add_dependency 'net-ssh',              '2.0.15'
>>  spec.add_dependency 'net-sftp',             '2.0.2'
>>  spec.add_dependency 'rubyzip',              '0.9.1'
>>  spec.add_dependency 'highline',             '1.5.1'
>> -  spec.add_dependency 'json_pure',            '1.4.0'
>> +  spec.add_dependency 'json_pure',            '>= 1.4.0'
>>  spec.add_dependency 'rubyforge',            '2.0.3'
>>  spec.add_dependency 'hoe',                  '2.3.3'
>>  spec.add_dependency 'rjb',                  '1.2.5' if spec.platform.to_s
>> == 'ruby'
>> 
>> alex
>> 
>> On Mon, Jun 21, 2010 at 10:25 AM, Duncan McGregor <du...@oneeyedmen.com>wrote:
>> 
>>> Hi
>>> 
>>> I'm trying Buildr for a new project and very much liking what I find (usual
>>> ant / Maven refugee status applies).
>>> 
>>> I'd like to run some Cucumber tests using Buildr under JRuby on MacOs. But
>>> when I
>>> 
>>> require 'cucumber'
>>> 
>>> in my buildfile, I get
>>> 
>>> Gem::LoadError : can't activate json_pure (~> 1.4.3, runtime) for
>>> ["cucumber-0.8.3"], already activated json_pure-1.4.0 for
>>> ["buildr-1.4.0-java"]
>>> 
>>> I've used Cucumber under Rake and 'normal' Ruby without incident, but
>>> obviously without such nice Java support. Can suggest how to persuade buildr
>>> to use a later version of json_pure?
>>> 
>>> Cheers
>>> 
>>> Duncan McGregor
>>> 
>>> 
>>> 
> 


Re: Buildr and Cucumber

Posted by Rhett Sutphin <rh...@detailedbalance.net>.
Hi,

On Jun 21, 2010, at 1:05 PM, Alex Boisvert wrote:

> The issue has to do with Gem initialization order...
> 
> Easiest would probably to edit the gemspec to allow this combination.  (On
> my system, it's located under /usr/lib/ruby/gems/1.8/gems/buildr-1.4.0/;
> your system may place gems elsewhere)

Another option which I will note for completeness is to use cucumber 0.7.3, which depends on json_pure 1.2.4 or later only.  If you don't need any cucumber 0.8.x features this will allow you to use a stock version of buildr.

For the buildr devs: this seems like another instance where having a separate bugfix vs. features track for buildr would come in handy.  It would be possible to update the dependencies as new versions are vetted to work with buildr so that workarounds like this aren't necessary.

Rhett

> 
> Index: buildr.gemspec
> ===================================================================
> --- buildr.gemspec    (revision 954999)
> +++ buildr.gemspec    (working copy)
> @@ -48,12 +48,12 @@
> 
>   # Tested against these dependencies.
>   spec.add_dependency 'rake',                 '0.8.7'
>   spec.add_dependency 'builder',              '2.1.2'
>   spec.add_dependency 'net-ssh',              '2.0.15'
>   spec.add_dependency 'net-sftp',             '2.0.2'
>   spec.add_dependency 'rubyzip',              '0.9.1'
>   spec.add_dependency 'highline',             '1.5.1'
> -  spec.add_dependency 'json_pure',            '1.4.0'
> +  spec.add_dependency 'json_pure',            '>= 1.4.0'
>   spec.add_dependency 'rubyforge',            '2.0.3'
>   spec.add_dependency 'hoe',                  '2.3.3'
>   spec.add_dependency 'rjb',                  '1.2.5' if spec.platform.to_s
> == 'ruby'
> 
> alex
> 
> On Mon, Jun 21, 2010 at 10:25 AM, Duncan McGregor <du...@oneeyedmen.com>wrote:
> 
>> Hi
>> 
>> I'm trying Buildr for a new project and very much liking what I find (usual
>> ant / Maven refugee status applies).
>> 
>> I'd like to run some Cucumber tests using Buildr under JRuby on MacOs. But
>> when I
>> 
>> require 'cucumber'
>> 
>> in my buildfile, I get
>> 
>> Gem::LoadError : can't activate json_pure (~> 1.4.3, runtime) for
>> ["cucumber-0.8.3"], already activated json_pure-1.4.0 for
>> ["buildr-1.4.0-java"]
>> 
>> I've used Cucumber under Rake and 'normal' Ruby without incident, but
>> obviously without such nice Java support. Can suggest how to persuade buildr
>> to use a later version of json_pure?
>> 
>> Cheers
>> 
>> Duncan McGregor
>> 
>> 
>>