第一个在线rails应用程序没有显示

时间:2015-09-28 08:01:44

标签: ruby-on-rails nginx unicorn

我已经跟踪this tutorial制作了一个rails应用程序,安装了独角兽,并安装了nginx。该教程说我应该将我的nginx.conf指向/home/myusername/my_app/public,这确实是我的应用程序的公共目录所在。

然而,当我启动unicorn然后启动nginx时,我在转到http://mypublicipaddress时看到403禁止错误。如果我在我的公共目录中放置一个index.html页面,它显示正常。但没有它,我的routes.rb似乎没有溃败。以下是我的routs.rb

的内容
Rails.application.routes.draw do
resources :tasks
# The priority is based upon order of creation: first created -> highest priority.
# See how all your routes lay out with "rake routes".

# You can have the root of your site routed with "root"
root 'welcome#index'

# Example of regular route:
#   get 'products/:id' => 'catalog#view'

# Example of named route that can be invoked with purchase_url(id: product.id)
#   get 'products/:id/purchase' => 'catalog#purchase', as: :purchase

# Example resource route (maps HTTP verbs to controller actions automatically):
#   resources :products

# Example resource route with options:
#   resources :products do
#     member do
#       get 'short'
#       post 'toggle'
#     end
#
#     collection do
#       get 'sold'
#     end
#   end

# Example resource route with sub-resources:
#   resources :products do
#     resources :comments, :sales
#     resource :seller
#   end

# Example resource route with more complex sub-resources:
#   resources :products do
#     resources :comments
#     resources :sales do
#       get 'recent', on: :collection
#     end
#   end

# Example resource route with concerns:
#   concern :toggleable do
#     post 'toggle'
#   end
#   resources :posts, concerns: :toggleable
#   resources :photos, concerns: :toggleable

# Example resource route within a namespace:
#   namespace :admin do
#     # Directs /admin/products/* to Admin::ProductsController
#     # (app/controllers/admin/products_controller.rb)
#     resources :products
#   end
end

由于常规index.html显示它不是权限问题。这里发生了什么?

0 个答案:

没有答案