最近vagrant不知道什麼緣由沒法啓動,日誌以下:laravel
Bringing machine 'default' up with 'virtualbox' provider...
/Vagrant/embedded/gems/2.2.1/gems/vagrant-2.2.1/lib/vagrant/util/io.rb:32:in `encode': "x8B" followed by "x02" on GBK (Encoding::InvalidByteSequenceError)git
from /Vagrant/embedded/gems/2.2.1/gems/vagrant-2.2.1/lib/vagrant/util/io.rb:32:in `read_until_block' from /Vagrant/embedded/gems/2.2.1/gems/vagrant-2.2.1/lib/vagrant/util/subprocess.rb:194:in `block in execute' from /Vagrant/embedded/gems/2.2.1/gems/vagrant-2.2.1/lib/vagrant/util/subprocess.rb:192:in `each' from /Vagrant/embedded/gems/2.2.1/gems/vagrant-2.2.1/lib/vagrant/util/subprocess.rb:192:in `execute' from /Vagrant/embedded/gems/2.2.1/gems/vagrant-2.2.1/lib/vagrant/util/subprocess.rb:22:in `execute' from /Vagrant/embedded/gems/2.2.1/gems/vagrant-2.2.1/lib/vagrant/util/powershell.rb:174:in `version' from /Vagrant/embedded/gems/2.2.1/gems/vagrant-2.2.1/lib/vagrant/util/powershell.rb:195:in `validate_install!' from /Vagrant/embedded/gems/2.2.1/gems/vagrant-2.2.1/lib/vagrant/util/powershell.rb:96:in `execute_cmd' from /Vagrant/embedded/gems/2.2.1/gems/vagrant-2.2.1/lib/vagrant/util/platform.rb:145:in `block (2 levels) in windows_hyperv_enabled?' from /Vagrant/embedded/gems/2.2.1/gems/vagrant-2.2.1/lib/vagrant/util/platform.rb:142:in `each' from /Vagrant/embedded/gems/2.2.1/gems/vagrant-2.2.1/lib/vagrant/util/platform.rb:142:in `block in windows_hyperv_enabled?' from /Vagrant/embedded/gems/2.2.1/gems/vagrant-2.2.1/lib/vagrant/util/platform.rb:153:in `windows_hyperv_enabled?' from /Vagrant/embedded/gems/2.2.1/gems/vagrant-2.2.1/plugins/providers/virtualbox/action/check_virtualbox.rb:19:in `call' from /Vagrant/embedded/gems/2.2.1/gems/vagrant-2.2.1/lib/vagrant/action/warden.rb:34:in `call' from /Vagrant/embedded/gems/2.2.1/gems/vagrant-2.2.1/lib/vagrant/action/builder.rb:116:in `call' from /Vagrant/embedded/gems/2.2.1/gems/vagrant-2.2.1/lib/vagrant/action/runner.rb:66:in `block in run' from /Vagrant/embedded/gems/2.2.1/gems/vagrant-2.2.1/lib/vagrant/util/busy.rb:19:in `busy' from /Vagrant/embedded/gems/2.2.1/gems/vagrant-2.2.1/lib/vagrant/action/runner.rb:66:in `run' from /Vagrant/embedded/gems/2.2.1/gems/vagrant-2.2.1/lib/vagrant/machine.rb:239:in `action_raw' from /Vagrant/embedded/gems/2.2.1/gems/vagrant-2.2.1/lib/vagrant/machine.rb:208:in `block in action' from /Vagrant/embedded/gems/2.2.1/gems/vagrant-2.2.1/lib/vagrant/environment.rb:614:in `lock' from /Vagrant/embedded/gems/2.2.1/gems/vagrant-2.2.1/lib/vagrant/machine.rb:194:in `call' from /Vagrant/embedded/gems/2.2.1/gems/vagrant-2.2.1/lib/vagrant/machine.rb:194:in `action' from /Vagrant/embedded/gems/2.2.1/gems/vagrant-2.2.1/lib/vagrant/batch_action.rb:82:in `block (2 levels) in run'
參考了兩篇網上找到文章,沒法解決問題github
1 日文網站的解決方案(**認爲是編碼問題**):https://github.com/NetCommons3/NetCommons3/issues/50 対策 「C:\opscode\chefdk\bin\berks」 を開き、3行目に Encoding.default_external = 'utf-8' 2 laravel-china上的一篇文章(**認爲是中文問題**),很類似,但是問題緣由不一樣。但也給瞭解決思路 https://laravel-china.org/articles/4082/a-wonderful-problem-encountered-in-the-use-of-vagrant
隨後本身仔細看了下ruby的日誌及相關源碼,發現裏面描述了powershell的問題,因而嘗試啓動windows的powershell果真是啓動失敗。
這樣的話問題就好說了,解決了powershell的問題就好了。(是.netFramework的問題,原來是本身以前因爲visio安裝不上,升級了.netFramework)。降級.netFramework便可shell
以後Vagrant啓動正常windows
總結:遇到問題注意看日誌,儘管是本身不熟悉的語言。ruby
文章結尾奶一下ruby:ide
借用《Programming Ruby》推薦序中的一段話: 事實上,執行性能與開發效率是軟件開發中的一對矛盾,全部的程序設計語言都必須面對這個矛盾,做出本身的選擇。 在當時,大多數新語言的選擇是上下通吃。它們一方面提供了豐富多彩的高級抽象,另外一方面又提供了強有力的底層操做能力,但願由此實現高性能與高效率的統一。 C++、Java、C#和Delphi都是走的這條路線,甚至VB從5.0開始也強化了底層操做機制,並提供了編譯模型,不落人後。 Ruby實現了最純粹意義上的面向對象,讓Smalltalk、Perl和Lisp的靈魂在新的軀殼裏高歌。 相比於Python,Ruby的思想更加清晰一致,形式更加靈活; 相比於Perl,Ruby更簡單質樸,絕少光怪陸離之舉; 相比於Smalltalk和Lisp,Ruby更富有現代感和實幹氣質; 相比於廟堂之上的「工業語言」,Ruby自由揮灑、輕快銳利; 而相比於JavaScript和PHP,Ruby從Smalltalk繼承而來的深厚底蘊又大佔優點。 面對執行性能與開發效率的謎題,Ruby堅決果斷地選擇了開發效率,選擇了對人腦的友好。
Created by suyaqiang (sueeing@126.com) on 2019/1/20.性能