2017-07-04 127 views
0

我正在嘗試渲染我的Rails應用程序Chrome。 但是,我得到的Passenger一個錯誤頁面:apache2:您的Ruby版本是2.1.6,但您的Gemfile指定爲2.3.4

We're sorry, but something went wrong. 
The issue has been logged for investigation. Please try again later. 

Technical details for the administrator of this website 
This website is powered by Passenger®, a rock-solid, feature-rich web application server that integrates with Apache and Nginx built by Phusion®. 

Apache的錯誤日誌說,我有以下錯誤:

Your Ruby version is 2.1.6, but your Gemfile specified 2.3.4 

我做了以下但事與願違幫助:

$ruby -v 
ruby 2.3.4p301 (2017-03-30 revision 58214) [x86_64-darwin16] 

$rbenv version 
2.3.4 (set by /Users/.../.rbenv/version) 

$gem update bundler 
Updating installed gems 
Nothing to update 

$ brew upgrade ruby-build 
Error: ruby-build 20170523 already installed 

$ bundle install 
...Bundle complete!... 

有誰知道如何解決它? 在此先感謝!

+0

有運行rbenv老調重彈,如果沒有的話裏面的文件夾,你可以運行這個 – widjajayd

+0

我做到了。仍然不起作用:( –

回答

0

我們需要告訴Passenger它在哪裏.Passenger使用與系統Ruby一起安裝的gem而不是新版本。

編輯/ etc/apache2的/ MODS的可用/ passenger.conf`:

<IfModule mod_passenger.c> 
    PassengerRoot /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini 
    PassengerDefaultRuby /home/$YOUR_HOME_DIRECTORY/.rbenv/shims/ruby 
</IfModule> 
+0

它似乎設置爲正確的路徑,但仍然不起作用 '$ cat /etc/apache2/other/passenger.conf LoadModule passenger_module/usr/local/opt /乘客/ libexec/buildout/apache2/mod_passenger.so PassengerRoot /usr/local/opt/passenger/libexec/src/ruby_supportlib/phusion_passenger/locations.ini PassengerDefaultRuby/Users /.../。rbenv/shims/ruby​​' $ $ ruby​​ /Users /.../。rbenv/shims/ruby​​' –

+0

:-)你有沒有重新啓動服務器,以確保它獲得新的設置? – widjajayd

+0

'$ sudo reboot'後仍然出現同樣的錯誤:( –

相關問題