gem_package仍指向旧版本的Ruby [Chef]

时间:2018-10-17 17:00:46

标签: ruby-on-rails ruby chef passenger

我正在使用gem_package在厨师食谱中安装乘客宝石。

  gem_package 'passenger' do
    action     :install
    version    node['nginx']['passenger']['version']
    gem_binary "/home/local/.rvm/rubies/ruby-2.2.3/bin/gem"
   end

我已经提到gem_binary用作ruby 2.2.3,它也被设置为默认的ruby。但是,当我执行此操作时,出现错误

 STDERR: ERROR:  Error installing passenger:
            rake requires Ruby version >= 2.0.0.
       ---- End output of /home/local/.rvm/rubies/ruby-2.2.3/bin/gem install passenger -q --no-rdoc --no-ri -v "4.0.57" ----
       Ran /home/local/.rvm/rubies/ruby-2.2.3/bin/gem install passenger -q --no-rdoc --no-ri -v "4.0.57" returned 1

       Resource Declaration:
       ---------------------
       # In /tmp/kitchen/cache/cookbooks/nginx/recipes/passenger.rb

        39:   gem_package 'passenger' do
        40:     action     :install
        41:     version    node['nginx']['passenger']['version']
        42:     gem_binary "/home/local/.rvm/rubies/ruby-2.2.3/bin/gem"
        43:    end
        44:

       Compiled Resource:
       ------------------
       # Declared in /tmp/kitchen/cache/cookbooks/nginx/recipes/passenger.rb:39:in `from_file'

       gem_package("passenger") do
         package_name "passenger"
         action [:install]
         retries 0
         retry_delay 2
         default_guard_interpreter :default
         declared_type :gem_package
         cookbook_name "nginx"
         recipe_name "passenger"
         version "4.0.57"
         gem_binary "/home/local/.rvm/rubies/ruby-2.2.3/bin/gem"
       end

0 个答案:

没有答案