由於我無法控制的原因,我需要在CentOS 7上運行Rails 4應用程序。目前,它已在rvm和Passenger的Red Hat上成功運行。我想將它遷移到rbenv和Puma,但我陷入了這個問題。爲什麼Puma無法在擁有Puma進程的用戶可以加載Bundler?
我想在VirtualBox虛擬機上運行測試安裝。我相信我已經正確地把所有東西連接起來我禁用了SELinux。當我運行cap deploy
,彪馬成功啓動:
04:03 puma:start
using conf file /var/www/rails-app/shared/puma.rb
01 bundle exec puma -C /var/www/rails-app/shared/puma.rb --daemon
01 * Pruning Bundler environment
01 [6464] Puma starting in cluster mode...
01 [6464] * Version 3.9.1 (ruby 2.1.10-p492), codename: Private Caller
01 [6464] * Min threads: 4, max threads: 16
01 [6464] * Environment: vm
01 [6464] * Process workers: 1
01 [6464] * Phased restart available
01 [6464] * Listening on unix:///var/www/rails-app/shared/tmp/sockets/puma.sock
01 [6464] * Daemonizing...
✔ 01 [email protected] 0.537s
但彪馬訪問日誌旋轉出這個錯誤在一個無限循環:
/home/deploy/.rbenv/versions/2.1.10/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- bundler/setup (LoadError)
... stack trace clipped ...
清單與我彪馬用戶關聯的進程顯示:
$ ps aux | grep deploy
deploy 12645 0.0 0.2 115384 2084 pts/0 S 18:18 0:00 -bash
deploy 18517 0.7 1.7 271344 18076 ? Sl 18:27 0:00 puma 3.9.1 (unix:///var/www/rails-app/shared/tmp/sockets/puma.sock)
deploy 23279 7.0 0.0 0 0 ? Z 18:29 0:00 [ruby] <defunct>
deploy 23283 4.0 1.7 273400 17464 ? Rl 18:29 0:00 puma: cluster worker 0: 18517
我確認我可以成功運行Bundler作爲擁有Rails應用程序和Puma進程的deploy
用戶:
cd /var/www/rails-app/current && bundler --version
Bundler version 1.15.4
所以我不知道爲什麼我會看到這個錯誤。經過數小時的研究和故障排除,我陷入困境。如果需要,我可以提供配置文件,但它們非常標準,我認爲在這一點上只會混淆這個問題。
這個問題看起來對任何人都很熟悉嗎?
你的問題似乎是類似於這一個https://stackoverflow.com/questions/19061774/cannot-load-such-file-bundler-setup-loaderror –
如果您使用RVM https://stackoverflow.com/questions/32670779/loaderror-can-load-such-file-bundler-setup –