2014-01-12 80 views
28

我似乎無法使用this Vagrantfile獲得有關Vagrant的指南針。請參閱bash腳本的其餘使用權利 這裏 (已刪除的回購)(如果要配置Vagrant Ubuntu Box,請參閱Vaprobash!)。安裝後無法使用指南針

因此,當我不得不使用grunt server時,我正在休學gruntjs課程。唯一的問題是它需要一個更新的ruby版本(1.9+我相信而不是1.8),它需要指南針。所以我通過安裝RVM和安裝最新的穩定版本解決了ruby部分。指南針應該很容易得到gem install compass,它似乎已被安裝。但是,當我在compass -v型我得到的休耕錯誤:

/home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- sass/script/node (LoadError) 
    from /home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require' 
    from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches/browser_support.rb:1:in `<top (required)>' 
    from /home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require' 
    from /home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require' 
    from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:2:in `block in <top (required)>' 
    from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:1:in `each' 
    from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:1:in `<top (required)>' 
    from /home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require' 
    from /home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require' 
    from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/lib/compass/sass_extensions.rb:9:in `<top (required)>' 
    from /home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require' 
    from /home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require' 
    from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/lib/compass.rb:5:in `block in <top (required)>' 
    from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/lib/compass.rb:4:in `each' 
    from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/lib/compass.rb:4:in `<top (required)>' 
    from /home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require' 
    from /home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require' 
    from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/bin/compass:20:in `block in <top (required)>' 
    from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/bin/compass:8:in `fallback_load_path' 
    from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/bin/compass:19:in `<top (required)>' 
    from /home/vagrant/.rvm/gems/ruby-2.1.0/bin/compass:23:in `load' 
    from /home/vagrant/.rvm/gems/ruby-2.1.0/bin/compass:23:in `<main>' 
    from /home/vagrant/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `eval' 
    from /home/vagrant/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `<main>' 

所以我不知道除了錯誤告訴我它的文件丟失了什麼錯誤。任何人都可以得到一些提示,可能是什麼問題?

.bash_profile中包含的路徑信息:

[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile 

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function* 

rvm -vruby -v工作得很好,安裝gem install compasssass -v後似乎正常工作。

您可以使用Vagrant和VirtualBox複製所有內容。只需從我上面提到的github和vagrant up下載Vagrantfile。

回答

85

我在官方指南針Github問題的頁面上尋求幫助,並得到了這個問題的答案。

GitHub問題是正確的here

如何解決這個問題:

當安裝指南針(v0.12.2),它會下載最新的SASS v3.3.0.rc3(因爲它是一個依賴),但是指南針不會與上海社會科學院最新工作。您可以將指南針升級到最新的alpha版本(0.13。*)或將sass降級到3.2。*。我選擇最後一個:

gem uninstall sass --version 3.3.0.rc.3 
gem install sass --version 3.2.18 
compass -v # Working :) 

請確保您使用的是您安裝的版本。找出通過鍵入以下:

sass --version 
+0

當我嘗試在股票紅寶石上安裝Mac OS X Mavericks時,我遇到了一個非常類似的問題,並且這些步驟解決了它,謝謝! – jeromegamez

+1

太棒了!我一直在尋找一段時間。順便說一句,我在Ubuntu上! – knibals

+0

這也適用於Centos 5.8 –

1

看到這個答案https://stackoverflow.com/a/21082978/497756 - 這是爲了別的問題,但應該解決你的問題。

+0

好了,我休耕新鮮流浪箱配置後的每一步和'LS $ GEM_HOME /包裝/ compass' ='/home/vagrant/.rvm/gems/輸出紅寶石2.1.0 /包裝/ compass'。不知道如何處理結果。在使用'compass -v'時,我仍然會遇到同樣的錯誤.BTW,如果那是您的想法,我不使用Codekit? – Ilyes512

+0

嘗試'/home/vagrant/.rvm/gems/ruby-2.1.0/wrappers/compass -v' – mpapis

+0

是的,我也試過,並得到了同樣的東西。我也想說,我沒有使用任何'sudo',但是如果我做'sudo gem list'和'gem list',我得到2個不同的列表。指南針,但我只安裝在沒有'sudo'的列表中,所以看起來是正確的。 – Ilyes512