我已经将一个rails应用程序上传到我的ubuntu服务器我正在使用apache2和passenger
我已经使用rails s -e生产测试了我本地的所有设置它运行正常。
我正在运行我的rails应用程序使用rails s -e生产服务器我可以使用我的域访问我的应用程序abc.com:3000我可以看到它正在运行我不知道我还需要做什么。我的生产日志是这样的:
F, [2018-05-28T10:56:13.167965 #17419] FATAL -- : [8498ddeb-113e-4d0d-8d78-a33acf089435]
F, [2018-05-28T10:56:13.168034 #17419] FATAL -- : [8498ddeb-113e-4d0d-8d78-a33acf089435] ActionController::RoutingError (No route matches [GET] "/favicon.ico"):
F, [2018-05-28T10:56:13.168063 #17419] FATAL -- : [8498ddeb-113e-4d0d-8d78-a33acf089435]
F, [2018-05-28T10:56:13.168091 #17419] FATAL -- : [8498ddeb-113e-4d0d-8d78-a33acf089435] actionpack (5.2.0) lib/action_dispatch/middleware/debug_exceptions.rb:65:in `call'
[8498ddeb-113e-4d0d-8d78-a33acf089435] actionpack (5.2.0) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
[8498ddeb-113e-4d0d-8d78-a33acf089435] railties (5.2.0) lib/rails/rack/logger.rb:38:in `call_app'
[8498ddeb-113e-4d0d-8d78-a33acf089435] railties (5.2.0) lib/rails/rack/logger.rb:26:in `block in call'
[8498ddeb-113e-4d0d-8d78-a33acf089435] activesupport (5.2.0) lib/active_support/tagged_logging.rb:71:in `block in tagged'
[8498ddeb-113e-4d0d-8d78-a33acf089435] activesupport (5.2.0) lib/active_support/tagged_logging.rb:28:in `tagged'
[8498ddeb-113e-4d0d-8d78-a33acf089435] activesupport (5.2.0) lib/active_support/tagged_logging.rb:71:in `tagged'
[8498ddeb-113e-4d0d-8d78-a33acf089435] railties (5.2.0) lib/rails/rack/logger.rb:26:in `call'
[8498ddeb-113e-4d0d-8d78-a33acf089435] actionpack (5.2.0) lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
[8498ddeb-113e-4d0d-8d78-a33acf089435] actionpack (5.2.0) lib/action_dispatch/middleware/request_id.rb:27:in `call'
[8498ddeb-113e-4d0d-8d78-a33acf089435] rack (2.0.5) lib/rack/method_override.rb:22:in `call'
[8498ddeb-113e-4d0d-8d78-a33acf089435] rack (2.0.5) lib/rack/runtime.rb:22:in `call'
[8498ddeb-113e-4d0d-8d78-a33acf089435] activesupport (5.2.0) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
[8498ddeb-113e-4d0d-8d78-a33acf089435] actionpack (5.2.0) lib/action_dispatch/middleware/executor.rb:14:in `call'
[8498ddeb-113e-4d0d-8d78-a33acf089435] rack (2.0.5) lib/rack/sendfile.rb:111:in `call'
[8498ddeb-113e-4d0d-8d78-a33acf089435] rack-cors (1.0.2) lib/rack/cors.rb:97:in `call'
[8498ddeb-113e-4d0d-8d78-a33acf089435] railties (5.2.0) lib/rails/engine.rb:524:in `call'
[8498ddeb-113e-4d0d-8d78-a33acf089435] puma (3.11.4) lib/puma/configuration.rb:225:in `call'
[8498ddeb-113e-4d0d-8d78-a33acf089435] puma (3.11.4) lib/puma/server.rb:632:in `handle_request'
[8498ddeb-113e-4d0d-8d78-a33acf089435] puma (3.11.4) lib/puma/server.rb:446:in `process_client'
[8498ddeb-113e-4d0d-8d78-a33acf089435] puma (3.11.4) lib/puma/server.rb:306:in `block in run'
[8498ddeb-113e-4d0d-8d78-a33acf089435] puma (3.11.4) lib/puma/thread_pool.rb:120:in `block in spawn_thread'
所以我的问题是如何解决这个问题。搜索一些日志后,我收到此错误:
/bin/sh: 1: exec: /root/.rbenv/versions/2.5.1/bin/ruby: Permission denied
我在乘客日志中发现此错误
答案 0 :(得分:0)
我认为它与文件夹乘客的权限有关,无法执行代码。
尝试类似以下应用文件夹的此更改权限:
sudo chmod -R 777 /path-to-folder/
使用以下命令重启apache服务器:
sudo service apache2 restart
您还可以查看已添加乘客红宝石的vhost文件。
如果chmod 777有效,那么您的问题就解决了,您可以像这样更改您的应用程序文件夹权限:
sudo chmod -R 755 /path-to-folder/