2014-01-23 198 views
0

在清除我的寶石與rvm gemset empty後,我重新安裝rails(3.2.13),然後刪除我的Gemfile.lock並運行bundle install。 Bundler沒有安裝寶石,它只是說它正在「使用」它們,就好像它們已經安裝一樣。所以當我嘗試運行應用程序時,我被告知「無法在任何源代碼中找到[gem namne](Bundler :: GemNotFound)」。寶石未安裝捆綁安裝

編輯:我正在運行sudo bundle install,因爲其中一個寶石是從本地源安裝的。使用sudo時,未安裝寶石。當運行bundle install時,Bundler會嘗試安裝缺失的寶石,但它不能安裝來自本地源的bootstrap-sass寶石。

的Gemfile

source "https://rubygems.org" 

gem "rails", "~> 3.2.13" 
gem "mysql2", "~> 0.3.13" 
gem "json", "~> 1.8.0" 

group :assets do 
    gem "guard-rails-assets", "~> 0.1.3" 
    gem "sass-rails", "~> 3.2.6" 
    gem "coffee-rails", "~> 3.2.2" 
    gem "uglifier", "~> 1.0.3" 
end 

gem "jquery-rails", "~> 3.0.4" 
gem "simple_form", "~> 2.1.0" 
gem "bootstrap-sass", :path => "gems/bootstrap-sass-c0e12a90ba3e" 
gem "client_side_validations", "~> 3.2.6" 
gem "client_side_validations-simple_form", "~> 2.1.0" 
gem "therubyracer", :platform => :ruby 
gem "require_relative", "~> 1.0.3" 
gem "icalendar", "~> 1.4.3" 
gem "whenever", "~> 0.8.4", :require => false 
gem "jquery-cookie-rails", "~> 1.3.1" 
gem "hominid", "~> 3.0.5" 

gem list

*** LOCAL GEMS *** 

actionmailer (3.2.13) 
actionpack (3.2.13) 
activemodel (3.2.13) 
activerecord (3.2.13) 
activeresource (3.2.13) 
activesupport (3.2.13) 
arel (3.0.3) 
builder (3.0.4) 
bundler (1.5.2) 
bundler-unload (1.0.2) 
daemon_controller (1.1.8) 
erubis (2.7.0) 
executable-hooks (1.3.1) 
gem-wrappers (1.2.4) 
hike (1.2.3) 
i18n (0.6.1) 
journey (1.0.4) 
json (1.8.1) 
mail (2.5.4) 
mime-types (1.25.1) 
multi_json (1.8.4) 
passenger (4.0.35) 
polyglot (0.3.3) 
rack (1.4.5) 
rack-cache (1.2) 
rack-ssl (1.3.3) 
rack-test (0.6.2) 
rails (3.2.13) 
railties (3.2.13) 
rake (10.1.1) 
rdoc (3.12.2) 
rubygems-bundler (1.4.2) 
rvm (1.11.3.8) 
sprockets (2.2.2) 
thor (0.18.1) 
tilt (1.4.1) 
treetop (1.4.15) 
tzinfo (0.3.38) 

爲什麼不bundle安裝在我的Gemfile寶石?

+0

您正在使用哪個'bundle'?我的意思是,'哪個包'返回? –

+0

@MarekLipka - '/ home/ubuntu/.rvm/gems/ruby​​-1.8.7-p374 @ global/bin/bundle' –

回答

2

當你運行你可能使用捆綁的不同實例sudo bundle install(或者你在RVM的另一個實例全球安裝系統,或者你僅僅使用系統默認的紅寶石)

結果,它會爲該系統的ruby安裝寶石。如果以後打開服務器而不使用sudo,它會在本地RVM中尋找寶石,但沒有安裝 正確的方法是使用``bundle install進行安裝。你應該做的是修復bootstrap-sass的路徑錯誤。順便說一下,這可能是因爲同樣的問題而發生的 您的系統可能有一個路徑"gems/bootstrap-sass-c0e12a90ba3e"而不是您本地的RVM

+0

有道理,謝謝。 –

1

我想你應該把你的版本bootstrap-sass gem放在沒有root權限的目錄下。

相關問題