# Bundler picking up wrong version of Ruby with Rails 3 ( possible bundler bug )

**URL:** <https://www.ruby-forum.com/t/bundler-picking-up-wrong-version-of-ruby-with-rails-3-possible-bundler-bug/195378>\
**Category:** Rails\
**Created:** [September 22, 2010, 11:53am UTC](https://www.ruby-forum.com/t/bundler-picking-up-wrong-version-of-ruby-with-rails-3-possible-bundler-bug/195378 "2010-09-22T11:53:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![manishchaks](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e9a140/32.png) [@manishchaks](https://www.ruby-forum.com/u/manishchaks)\
**Post date:** [September 22, 2010, 11:53am UTC](https://www.ruby-forum.com/t/bundler-picking-up-wrong-version-of-ruby-with-rails-3-possible-bundler-bug/195378/1 "2010-09-22T11:53:14Z")

</div>

Hello All,

I am developing a JRuby on Rails 3 application. Standard stuff.

I am facing problems getting autotest to run.

Here’s the trace:

% autotest  
loading autotest/rails\_rspec2  
bundle exec  
/Users/manish/Foo/Foo-Server/jruby-1.5.2/lib/ruby/gems/1.8/gems/rspec-core-2.0.0.beta.22/bin/rspec  
‘/Users/manish/Foo/Foo-Server/FooInsight/spec/controllers/users\_controller\_spec.rb’  
‘/Users/manish/Foo/Foo-Server/FooInsight/spec/helpers/home\_helper\_spec.rb’  
‘/Users/manish/Foo/Foo-Server/FooInsight/spec/helpers/install\_helper\_spec.rb’  
‘/Users/manish/Foo/Foo-Server/FooInsight/spec/models/user\_spec.rb’  
\*  
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/dependency.rb:52  
\*:in `initialize': Valid types are [:development, :runtime], not nil (ArgumentError) from /Users/manish/Foo/Foo-Server/jruby-1.5.2/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/resolver.rb:355:in `new’  
from  
/Users/manish/Foo/Foo-Server/jruby-1.5.2/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/resolver.rb:355:in  
`search' from /Users/manish/Foo/Foo-Server/jruby-1.5.2/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/resolver.rb:181:in `resolve’  
from  
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/source\_index.rb:95:in  
`sort_by' from /Users/manish/Foo/Foo-Server/jruby-1.5.2/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/resolver.rb:177:in `each’  
from  
/Users/manish/Foo/Foo-Server/jruby-1.5.2/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/resolver.rb:177:in  
`sort_by' from /Users/manish/Foo/Foo-Server/jruby-1.5.2/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/resolver.rb:177:in `resolve’  
from  
/Users/manish/Foo/Foo-Server/jruby-1.5.2/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/resolver.rb:162:in  
`start' from /Users/manish/Foo/Foo-Server/jruby-1.5.2/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/resolver.rb:131:in `resolve’  
from  
/Users/manish/Foo/Foo-Server/jruby-1.5.2/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/resolver.rb:130:in  
`catch' from /Users/manish/Foo/Foo-Server/jruby-1.5.2/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/resolver.rb:130:in `resolve’  
from  
/Users/manish/Foo/Foo-Server/jruby-1.5.2/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/definition.rb:153:in  
`resolve' from /Users/manish/Foo/Foo-Server/jruby-1.5.2/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/definition.rb:93:in `specs’  
from  
/Users/manish/Foo/Foo-Server/jruby-1.5.2/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/definition.rb:137:in  
`specs_for' from /Users/manish/Foo/Foo-Server/jruby-1.5.2/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/definition.rb:126:in `requested\_specs’  
from  
/Users/manish/Foo/Foo-Server/jruby-1.5.2/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/environment.rb:23:in  
`requested_specs' from /Users/manish/Foo/Foo-Server/jruby-1.5.2/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:11:in `setup’  
from  
/Users/manish/Foo/Foo-Server/jruby-1.5.2/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler.rb:100:in  
`setup’  
from  
/Users/manish/Foo/Foo-Server/jruby-1.5.2/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/setup.rb:6

This is my PATH →   
/Users/manish/Foo/Twist-Server/jruby-1.5.2/bin:/Users/manish/Foo/Foo-Server/jruby-1.5.2/lib/ruby/gems/1.8/bin:/opt/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin

As you can see that ruby is picked up from \*  
/System/Library/Frameworks/Ruby.Framework\* instead of \*  
/Users/manish/Foo/Twist-Server/jruby-1.5.2/bin\* which is ahead in the  
PATH.

I am on Snow Leopard 10.6.4 with jruby 1.5.2 (ruby 1.8.7 patchlevel 249)  
(2010-08-20 1c5e29d) (Java HotSpot™ 64-Bit Server VM 1.6.0\_20)  
[x86\_64-java]

Is this a bug? Any pointers?

–  
Best,  
Manish Chakravarty  
[twitter.com/ManishChaks](http://twitter.com/ManishChaks)

---

<div class="post-metadata">

**Author:** ![manishchaks](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e9a140/32.png) [@manishchaks](https://www.ruby-forum.com/u/manishchaks)\
**Post date:** [September 22, 2010, 5:07pm UTC](https://www.ruby-forum.com/t/bundler-picking-up-wrong-version-of-ruby-with-rails-3-possible-bundler-bug/195378/2 "2010-09-22T17:07:42Z")

</div>

On Wed, Sep 22, 2010 at 4:51 AM, Manish Chakravarty  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)wrote:

> bundle exec  
> /Users/manish/Foo/Foo-Server/jruby-1.5.2/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/resolver.rb:355:in  
> from  
> `start’  
> /Users/manish/Foo/Foo-Server/jruby-1.5.2/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/definition.rb:153:in  
> from
> 
> (2010-08-20 1c5e29d) (Java HotSpot™ 64-Bit Server VM 1.6.0\_20)  
> Best,  
> Manish Chakravarty

It looks like autotest is executing with a different environment than  
yours.  
Does it run as a different user (su, maybe), or as a cron job? Either of  
those would be using a different environment. Try % env PATH=$PATH  
autotest

Adam S.
