2017-05-04 39 views
1

我在我的工作站/本地機器上運行了「chef verify」並得到了這個錯誤結果。廚師:Addressable :: URI :: InvalidURIError

[email protected]:/opt/chefdk$ chef verify 
Running verification for component 'berkshelf' 
Running verification for component 'test-kitchen' 
Running verification for component 'tk-policyfile-provisioner' 
Running verification for component 'chef-client' 
Running verification for component 'chef-dk' 
Running verification for component 'chef-provisioning' 
Running verification for component 'chefspec' 
Running verification for component 'generated-cookbooks-pass-chefspec' 
Running verification for component 'rubocop' 
Running verification for component 'fauxhai' 
Running verification for component 'knife-spork' 
Running verification for component 'kitchen-vagrant' 
Running verification for component 'package installation' 
Running verification for component 'openssl' 
Running verification for component 'inspec' 
Running verification for component 'delivery-cli' 
Running verification for component 'git' 
Running verification for component 'opscode-pushy-client' 
Running verification for component 'chef-sugar' 
... 

An error occurred in a `before(:suite)` hook. 
Failure/Error: raise InvalidURIError, "Invalid scheme format: #{new_scheme}" 

Addressable::URI::InvalidURIError: 
    Invalid scheme format: 127.0.0.1 
# /home/mike-pc/.chefdk/gem/ruby/2.3.0/gems/berkshelf-5.6.4/lib/berkshelf/source.rb:58:in `build_universe' 
# /home/mike-pc/.chefdk/gem/ruby/2.3.0/gems/berkshelf-5.6.4/lib/berkshelf/installer.rb:21:in `block (2 levels) in build_universe' 


Finished in 0.25155 seconds (files took 1.57 seconds to load) 
0 examples, 0 failures 

我執行「廚房診斷,所有」,並發現我有無效的URI:

instances: 
    default-centos-72: 
    platform: 
     os_type: unix 
     shell_type: bourne 
    state_file: 
     hostname: 127.0.0.1 
     last_action: create 
     last_error: Addressable::URI::InvalidURIError 
     port: '2222' 

我怎樣才能解決這個問題?

+0

您可以在此問題上添加日誌或運行'kitchen diagnose --all' –

+0

hi @AnkurJyotiPhukan,謝謝。我更新了它。 – Michael

+0

你在廚房安裝了廚師嗎?因爲「廚房診斷」檢查正在運行的廚房實例的狀態。你能否用「gem environment」輸出更新日誌。 –

回答

0

的錯誤是很明顯的:

Addressable::URI::InvalidURIError: 
Invalid scheme format: 127.0.0.1 

我認爲你缺少的 「http://」 的 「127.0.0.1」 之前。

+0

hi @Draco Ater,我可以在哪裏設置它?謝謝 – Michael

+0

你的代碼中的某個地方可能是?! ''before(:suite)'鉤子發生錯誤。' –

+0

我還沒有編寫代碼,我只是在我的本地機器上安裝chefdk並使用「chef verify」進行測試。 – Michael

0

chef verify不是你應該運行的命令。這是ChefDK開發人員和發佈團隊的職責。