2013-10-04 41 views
1

搜索高低...發現類似問題,但沒有任何修復幫助...有沒有人知道接下來要做什麼?找不到gem'bootstrap-sass(= 2.3.2.0)ruby'(步驟5.1.2在railtutorial.org中)

我下面Railstutorial.org 5.1.2和安裝引導,薩斯寶石後,我得到的重啓動Apache後,以下內容:安裝

Could not find bootstrap-sass-2.3.2.2 in any of the sources (Bundler::GemNotFound) 
    /home/bart/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/spec_set.rb:92:in `block in materialize' 
    /home/bart/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/spec_set.rb:85:in `map!' 
    /home/bart/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/spec_set.rb:85:in `materialize' 
    /home/bart/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/definition.rb:114:in `specs' 
    /home/bart/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/definition.rb:159:in `specs_for' 
    /home/bart/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/definition.rb:148:in `requested_specs' 
    /home/bart/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/environment.rb:18:in `requested_specs' 
    /home/bart/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:13:in `setup' 
    /home/bart/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler.rb:120:in `setup' 
    /home/bart/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/setup.rb:17:in `<top (required)>' 
    /home/bart/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:133:in `require' 
    /home/bart/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:133:in `rescue in require' 
    /home/bart/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:142:in `require' 
    /home/bart/.rvm/gems/ruby-2.0.0-p247/gems/passenger-4.0.19/lib/phusion_passenger/loader_shared_helpers.rb:212:in `run_load_path_setup_code' 
    /home/bart/.rvm/gems/ruby-2.0.0-p247/gems/passenger-4.0.19/helper-scripts/rack-preloader.rb:96:in `preload_app' 
    /home/bart/.rvm/gems/ruby-2.0.0-p247/gems/passenger-4.0.19/helper-scripts/rack-preloader.rb:150:in `<module:App>' 
    /home/bart/.rvm/gems/ruby-2.0.0-p247/gems/passenger-4.0.19/helper-scripts/rack-preloader.rb:29:in `<module:PhusionPassenger>' 
    /home/bart/.rvm/gems/ruby-2.0.0-p247/gems/passenger-4.0.19/helper-scripts/rack-preloader.rb:28:in `<main>' 

引導。(試過版本2.3.2.0以及)

bart:/var/www/sample_app$ bundle | grep bootstrap 
Using bootstrap-sass (2.3.2.2) 

bart:/var/www/sample_app$ bundle show bootstrap 
/home/bart/.rvm/gems/[email protected]_rails_4_0/gems/bootstrap-sass-2.3.2.2 

類似的問題已經解決了與PU將gem bootstrap-sass放入Gemfile中的資產組中 - 這沒有幫助。 (例如,almost exact same thing

group :assets do 
    gem 'sass-rails', '4.0.0' 
    gem 'uglifier', '2.1.1' 
    gem 'coffee-rails', '4.0.0' 
    gem 'bootstrap-sass', '2.3.2.0' 
end 

我其實只是添加了bcrypt-紅寶石3.1.2寶石早些時候在Gemfile中,這給了同樣的問題...

我跳過Ch3的結束(所有3.6)其中有更多關於測試的內容,所以也許我錯過了某個地方的某個步驟,但其中的任何內容都是可選的。

其他何況做

rake gem 

或 耙gemspec 但我得到這樣兩個:

bart:/var/www/sample_app$ bundle exec rake gemspec --trace 
rake aborted! 
Don't know how to build task 'gemspec' 

和還沒有想出什麼確切含義呢。

更多細節:

bart:/var/www/sample_app$ rvm info 
[email protected]_rails_4_0: 

    system: 
    uname:  "Linux 452422 3.2.0-38-generiC#61-Ubuntu SMP Tue Feb 19 12:18:21 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux" 
    system:  "ubuntu/12.04/x86_64" 
    bash:  "/bin/bash => GNU bash, version 4.2.24(1)-release (x86_64-pc-linux-gnu)" 
    zsh:   " => not installed" 

    rvm: 
    version:  "rvm 1.22.15 (stable) by Wayne E. Seguin <[email protected]>, Michal Papis <[email protected]> [https://rvm.io/]" 
    updated:  "1 day 6 hours 36 minutes 3 seconds ago" 
    path:   "/home/bart/.rvm" 

    ruby: 
    interpreter: "ruby" 
    version:  "2.0.0p247" 
    date:   "2013-06-27" 
    platform:  "x86_64-linux" 
    patchlevel: "2013-06-27 revision 41674" 
    full_version: "ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux]" 

    homes: 
    gem:   "/home/bart/.rvm/gems/[email protected]_rails_4_0" 
    ruby:   "/home/bart/.rvm/rubies/ruby-2.0.0-p247" 

    binaries: 
    ruby:   "/home/bart/.rvm/rubies/ruby-2.0.0-p247/bin/ruby" 
    irb:   "/home/bart/.rvm/rubies/ruby-2.0.0-p247/bin/irb" 
    gem:   "/home/bart/.rvm/rubies/ruby-2.0.0-p247/bin/gem" 
    rake:   "/home/bart/.rvm/gems/[email protected]/bin/rake" 

    environment: 
    PATH:   "/home/bart/.rvm/gems/[email protected]_rails_4_0/bin:/home/bart/.rvm/gems/[email protected]/bin:/home/bart/.rvm/rubies/ruby-2.0.0-p247/bin:/home/bart/.rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" 
    GEM_HOME:  "/home/bart/.rvm/gems/[email protected]_rails_4_0" 
    GEM_PATH:  "/home/bart/.rvm/gems/[email protected]_rails_4_0:/home/bart/.rvm/gems/[email protected]" 
    MY_RUBY_HOME: "/home/bart/.rvm/rubies/ruby-2.0.0-p247" 
    IRBRC:  "/home/bart/.rvm/rubies/ruby-2.0.0-p247/.irbrc" 
    RUBYOPT:  "" 
    gemset:  "railstutorial_rails_4_0" 
+0

不確定。但是,你可以嘗試刪除你的gemfile.lock,重啓服務器,然後再試一次嗎? – franchez

+0

嗯......誰的聰明想法是將它命名爲Gemfile和Gemfile.lock? :)感謝天堂git :)仍然沒有工作。感謝您的建議(儘管在每一次嘗試中都加入了這一步驟)。 –

回答

2

解決了它。

非常感謝所有的建議 - 嘗試他們幫助我不斷推動不同的原因。

rails s(應用程序內)產生良好結果時,線索出現了,但碰到apache沒有。找到了我錯過的地方Apache/Passenger setup docs(RoR的noob,所以實際上「不知道」)將PassengerRuby設置爲虛擬主機配置。

根據/home/bart/.rvm/wrappers/[email protected]_rails_4_0

在/ etc/apache2的/ MODS的可用/客我創造了寶石 「railstutorial_rails_4_0」 教程。conf

PassengerRoot /home/bart/.rvm/gems/ruby-2.0.0-p247/gems/passenger-4.0.19 
PassengerDefaultRuby /home/bart/.rvm/wrappers/ruby-2.0.0-p247/ruby 

這是偉大的,直到bundle install把東西放在教程gemset。

我在虛擬主機的定義缺少這樣的:

PassengerRuby /home/bart/.rvm/wrappers/[email protected]_rails_4_0/ruby 

重啓Apache。

現在,它完美的工作!

0

你在你的Gemfile指定gem 'bootstrap-sass', '2.3.2.0'但已加載您的計算機上2.3.2.2。嘗試卸載gem並重新運行bundle命令。

bundle exec gem uninstall GEM_NAME 
bundle install 

我也仔細閱讀過本教程。查看我的代碼,我從來沒有爲bootstrap-sass指定一個版本。你也可以嘗試一下。

+0

我實際上安裝了兩個版本。 'bundle exec gem ...'不起作用,但只是'gem卸載...'而已。刪除所有並重新安裝,沒有指定版本。然後我得到關於multi_json的相同錯誤,所以我卸載/重新安裝multi_json。然後我再次得到bootstrap錯誤。我應該卸載所有的寶石,並重新開始? –

+0

是的,現在當我從Gemfile註釋掉bootstrap-sass行時,出現multi_json錯誤。因此,如果沒有引導程序,''gem卸載multi_json'(是),'rm Gemfile.lock','bundle install'(並重新安裝multi_json),重新啓動apache,同樣的錯誤:「無法找到任何multi_json-1.8.1來源(Bundler :: GemNotFound)「 –

+0

這是一個'gem install ...'沒有把寶石放在gemset中的情況嗎?所以我嘗試了'bundle exec gem install multi_json'(殺死了Gemfile.lock,重啓了apache'並且它運行了,但是用bootstrap-sass做同樣的工作似乎並不奏效,看起來如果我做了一個'bundle install',那麼我我回到了我開始的地方...... –