我正在尝试从Ruby on Rails的Web Brick Web服务器转换为我的应用程序,而是使用Apache + Passenger。我似乎最难以实现这一目标。当前,在运行Apache + Passenger的网站上导航到我的网站时,出现以下错误:
App 31495 output: [passenger_native_support.so] trying to compile for the current user (nobody) and Ruby interpreter...
App 31495 output: (set PASSENGER_COMPILE_NATIVE_SUPPORT_BINARY=0 to disable)
App 31495 output: Warning: compilation didn't succeed. To learn why, read this file:
App 31495 output: /tmp/passenger_native_support-1p5ww5z.log
App 31495 output: [passenger_native_support.so] finding downloads for the current Ruby interpreter...
App 31495 output: (set PASSENGER_DOWNLOAD_NATIVE_SUPPORT_BINARY=0 to disable)
App 31495 output: Could not download https://github.com/phusion/passenger/releases/download/release-6.0.2/rubyext-ruby-2.5.1-x86_64-linux.tar.gz: 2019-09-26 10:17:17 ERROR 404: Not Found.
App 31495 output: Trying next mirror...
App 31495 output: Could not download https://oss-binaries.phusionpassenger.com/binaries/passenger/by_release/6.0.2/rubyext-ruby-2.5.1-x86_64-linux.tar.gz: 2019-09-26 10:17:17 ERROR 404: Not Found.
App 31495 output: Trying next mirror...
App 31495 output: Could not download https://s3.amazonaws.com/phusion-passenger/binaries/passenger/by_release/6.0.2/rubyext-ruby-2.5.1-x86_64-linux.tar.gz: 2019-09-26 10:17:17 ERROR 403: Forbidden.
App 31495 output: [passenger_native_support.so] will not be used (can't compile or download)
App 31495 output: --> Passenger will still operate normally.
App 31495 output: Error: The application encountered the following error: There was an error while trying to load the gem 'coffee-rails'.
App 31495 output: Gem Load Error is: HOME environment variable (or HOMEDRIVE and HOMEPATH) must be set and point to a directory
<snipped>
我要做的第一件事是添加:
PassengerRuby /usr/local/rvm/gems/ruby-2.5.1/wrappers/ruby
针对我的apache配置,现在我得到的错误似乎与coffee-rails
gem有关,但是我不知道该怎么做。
我需要做什么才能使它正常工作?
根据这篇帖子Gem 'coffee-rails' Load Error: HOME environment variable (or HOMEDRIVE and HOMEPATH) must be set and point to a directory,问题出在他的rb-readline
上,建议删除该帖子。我尝试将其从我的gemfile中删除,并发生以下错误:
[ E 2019-09-26 10:25:32.5273 31834/Th age/Cor/App/Implementation.cpp:221 ]: Could not spawn process for application /var/www/vpentest: The application encountered the following error: You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.
If this is a development machine, remove the /var/www/vpentest/Gemfile freeze
by running `bundle install --no-deployment`.
You have deleted from the Gemfile:
* rb-readline
(Bundler::ProductionError)
Error ID: 7b2f2a89
Error details saved to: /tmp/passenger-error-Nd6b5y.html
[ E 2019-09-26 10:25:32.5302 31834/T9 age/Cor/Con/CheckoutSession.cpp:276 ]: [Client 1-2] Cannot checkout session because a spawning error occurred. The identifier of the error is 7b2f2a89. Please see earlier logs for details about the error.
好的,所以我尝试运行bundle install
,然后出现此错误:
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
Your Gemfile lists the gem wicked_pdf (>= 0) more than once.
You should probably keep only one of them.
Remove any duplicate entries and specify the gem only once (per group).
While it's not a problem now, it could cause errors if you change the version of one of them later.
You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.
If this is a development machine, remove the /var/www/vpentest/Gemfile freeze
by running `bundle install --no-deployment`.
You have deleted from the Gemfile:
* rb-readline
这使我再次陷入困境,我无法弄清楚如何解决这个问题,或者由于另一个问题,是否有必要尝试解决此错误。
答案 0 :(得分:0)
不确定这是否是最佳答案,但是我能够从应用程序的另一个实例中的Gemfile中删除gem,在其中运行bundle install
,然后将应用程序复制回{{1 }} 目录。我完全不知道为什么需要这样做,但是它有效。
我遇到的下一组问题与权限问题有关,因此我只授予了/var/www/
对整个rails目录的所有权。