我已經使用紅寶石版本管理器(rvm
)安裝新版本的紅寶石。運行命令rvm rubies
將顯示安裝的所有紅寶石版本。列表如下。安裝捆綁軟件給了我「你沒有寫權限」的錯誤
rvm rubies
ruby-1.9.3-p551 [ x86_64 ]
ruby-2.1.5 [ x86_64 ]
ruby-2.2.4 [ x86_64 ]
* ruby-2.3.0 [ x86_64 ]
ruby-2.3.1 [ x86_64 ]
# => - current
# =* - current && default
# * - default
我試圖運行命令bundle exec rake rb:mgirate
,我碰到下面的錯誤。
/usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/dependency.rb:319:in `to_specs': Could not find 'bundler' (>= 0.a) among 5 total gem(s) (Gem::LoadError)
Checked in 'GEM_PATH=:/nix/.nix-profile/lib/ruby/gems', execute `gem env` for more information
錯誤指出未安裝bundler。我運行了命令gem install bundle
,出現以下錯誤。
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /nix/.nix-profile/lib/ruby/gems directory.
它說我沒有寫入權限。我GOOGLE了錯誤,它與更新ruby和ruby版本有關。之所以我更新到一個新的紅寶石版本是因爲heroku run rake db:seed
沒有在生產中播種數據。我雖然可能是由於兼容性問題。因此,我決定更新到新版本的Ruby。服務器,postgresql和其他一切正常。我無法運行捆綁包,因爲我無法安裝該寶石。任何hep將不勝感激。謝謝!
嘗試運行'sudo chown -R \'whoami \'/ nix/.nix-profile/lib/ruby/gems' – mudasobwa
@mudasobwa,我能夠修復它。我必須指定用戶的版本。我只是運行rvm use 2.3.0,它既是當前版本,也是默認版本。它修復了問題 – kpaul
@mudasobwa,我試圖打開rails db,我得到了這個錯誤。無法在5個寶石中找到'railties'(> = 0.a)(Gem :: LoadError)。我認爲問題可能仍然存在。 – kpaul