0
votes

I had setup rails 4.1.1 with ruby 2.1.2 using rvm. Now, on the same machine I have to configure a chef-workstation for my project purpose. I have a chef-client set up with following details : OS- ubuntu 14.04 Chef-client version - 11.12.8

But, if I try to use knife commands from inside my application's ruby code, I get rubygems dependencies error for rails . Following is the dependency error i keep getting :

/usr/lib/ruby/vendor_ruby/1.8/rubygems/dependency.rb:247:in to_specs': Could not find chef (>= 0) amongst [actionmailer-4.1.1, actionpack-4.1.1, actionview-4.1.1, activemodel-4.1.1, activerecord-4.1.1, activesupport-4.1.1, arel-5.0.1.20140414130214, builder-3.2.2, bundler-1.6.2, bundler-unload-1.0.2, coffee-rails-4.0.1, coffee-script-2.2.0, coffee-script-source-1.7.0, erubis-2.7.0, execjs-2.2.0, executable-hooks-1.3.2, gem-wrappers-1.2.4, hike-1.2.3, i18n-0.6.9, jbuilder-2.1.1, jbuilder-2.1.0, jquery-rails-3.1.0, libv8-3.16.14.3-x86_64-linux, mail-2.5.4, mime-types-1.25.1, minitest-5.3.5, minitest-5.3.4, multi_json-1.10.1, mysql2-0.3.16, polyglot-0.3.5, rack-1.5.2, rack-test-0.6.2, rails-4.1.1, railties-4.1.1, rake-10.3.2, rdoc-4.1.1, ref-1.0.5, rubygems-bundler-1.4.4, rvm-1.11.3.9, sass-3.2.19, sass-rails-4.0.3, sdoc-0.4.0, spring-1.1.3, sprockets-2.12.1, sprockets-2.11.0, sprockets-rails-2.1.3, sqlite3-1.3.9, therubyracer-0.12.1, thor-0.19.1, thread_safe-0.3.4, tilt-1.4.1, treetop-1.4.15, turbolinks-2.2.2, tzinfo-1.2.1, uglifier-2.5.1] (Gem::LoadError) from /usr/lib/ruby/vendor_ruby/1.8/rubygems/dependency.rb:256:into_spec' from /usr/lib/ruby/vendor_ruby/1.8/rubygems.rb:1208:in `gem' from /usr/local/bin/knife:18

Any workaround

2
Could you post the any log of the dependency error you get?Dimitri
@DimitriJorge updated the question.tortuga

2 Answers

0
votes

Use Bundler to separate the Gems installed for your different projects.

0
votes

To me, since it tries to use ruby 1.8, it seems that you have an issue with rvm.

Could you try this Stackoverflow answer and tell whether that fixes or not?