我在DigitalCloud上使用Passenger
和Nginx
製作了Ruby on Rails
應用程序。一切正常,直到我添加我的自定義域。我只需填寫DigitalCloud上的DNS page
,並從域託管提供商定向域到服務器IP。然後我將服務器名稱更改爲新的URL,地址爲/opt/nginx/conf/nginx.conf
。乘客或Nginx無法使用自定義域名
在這裏的錯誤:
There was an error while trying to write to Gemfile.lock. It is likely that
you need to allow write permissions for the file at path:
/var/www/formas_app/Gemfile.lock (Bundler::InstallError)
/usr/local/rvm/gems/[email protected]/gems/bundler-1.7.6/lib/bundler/definition.rb:253:in `rescue in lock'
/usr/local/rvm/gems/[email protected]/gems/bundler-1.7.6/lib/bundler/definition.rb:238:in `lock'
/usr/local/rvm/gems/[email protected]/gems/bundler-1.7.6/lib/bundler/environment.rb:34:in `lock'
/usr/local/rvm/gems/[email protected]/gems/bundler-1.7.6/lib/bundler/runtime.rb:44:in `setup'
/usr/local/rvm/gems/[email protected]/gems/bundler-1.7.6/lib/bundler.rb:121:in `setup'
/usr/local/rvm/gems/[email protected]/gems/bundler-1.7.6/lib/bundler/setup.rb:17:in `<top (required)>'
/usr/local/rvm/rubies/ruby-2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/usr/local/rvm/rubies/ruby-2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/usr/local/rvm/gems/ruby-2.1.5/gems/passenger-5.0.7/lib/phusion_passenger/loader_shared_helpers.rb:399:in `activate_gem'
/usr/local/rvm/gems/ruby-2.1.5/gems/passenger-5.0.7/lib/phusion_passenger/loader_shared_helpers.rb:277:in `block in run_load_path_setup_code'
/usr/local/rvm/gems/ruby-2.1.5/gems/passenger-5.0.7/lib/phusion_passenger/loader_shared_helpers.rb:404:in `running_bundler'
/usr/local/rvm/gems/ruby-2.1.5/gems/passenger-5.0.7/lib/phusion_passenger/loader_shared_helpers.rb:276:in `run_load_path_setup_code'
/usr/local/rvm/gems/ruby-2.1.5/gems/passenger-5.0.7/helper-scripts/rack-preloader.rb:99:in `preload_app'
/usr/local/rvm/gems/ruby-2.1.5/gems/passenger-5.0.7/helper-scripts/rack-preloader.rb:153:in `<module:App>'
/usr/local/rvm/gems/ruby-2.1.5/gems/passenger-5.0.7/helper-scripts/rack-preloader.rb:29:in `<module:PhusionPassenger>'
/usr/local/rvm/gems/ruby-2.1.5/gems/passenger-5.0.7/helper-scripts/rack-preloader.rb:28:in `<main>'
這是我/opt/nginx/conf/nginx.conf
文件:
worker_processes 1;
events {
worker_connections 1024;
}
http {
passenger_friendly_error_pages on;
passenger_root /usr/local/rvm/gems/ruby-2.1.5/gems/passenger-5.0.7;
passenger_ruby /usr/local/rvm/gems/ruby-2.1.5/wrappers/ruby;
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name mydomain.com;
passenger_enabled on;
root /var/www/my_app/public;
}
}
想不通是什麼問題。 謝謝反正!
編輯我的問題: 當我運行bundle install
客運錯誤頁面去了,但現在我有一個顯示了標準軌錯誤頁面。我猜它向前邁進了一步,但我仍然需要幫助:D
我認爲它的文件夾和文件權限問題,所以請給予適當的權限,並嘗試。 –