首页 文章

使用Chef 11和Rails 4

提问于
浏览
0

我使用rvm使用ruby 2.1.2设置了rails 4.1.1 . 现在,在同一台机器上,我必须为我的项目目的配置一个厨师工作站 . 我有一个厨师客户端,其中包含以下详细信息:OS- ubuntu 14.04 Chef-client version - 11.12.8

但是,如果我尝试从我的应用程序的ruby代码中使用knife命令,我会获得rails的rubygems依赖项错误 . 以下是我不断获得的依赖性错误:

/usr/lib/ruby/vendor_ruby/1.8/rubygems/dependency.rb:247:in to_specs':在[actionmailer-4.1.1,actionpack-4.1.1,actionview-4.1]中找不到chef(> = 0) .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)来自/usr/lib/ruby/vendor_ruby/1.8/rubygems/dependency.rb:256:into_spec'来自/usr/lib/ruby/vendor_ruby/1.8/rubygems.rb:1208:来自/ usr / local / bin / knife的'gem':18

任何解决方法

2 回答

  • 0

    使用Bundler分隔为不同项目安装的Gems .

  • 0

    对我来说,因为它试图使用 ruby 1.8 ,似乎你有 rvm 的问题 .

    你能试试这个Stackoverflow answer然后判断是否有修复?

相关问题