12296#0: *4 --乘客运行,但页面不显示 -- 轨道示例示例应用程序



为什么 apache 文件是唯一显示的内容。 为什么乘客页面不显示?

是什么让它指向公共/公共?我确实删除了索引.html文件,因为我有一个static_pages控制器

12296#0: *4 "/var/www/sample_app/releases/20120522195731/public/public/index.html" is not found 
(2: No such file or directory), client: 127.0.0.1, server: 

这是我转到网址时出现的内容

Index of /
[ICO]   Name    Last modified   Size    Description
[TXT]   404.html    22-May-2012 19:57   728      
[TXT]   422.html    22-May-2012 19:57   711      
[TXT]   500.html    22-May-2012 19:57   643      
[IMG]   favicon.ico 22-May-2012 19:57   0    
[ ] passenger.3000.log  22-May-2012 21:35   488      
[ ] passenger.3000.pid.lock 22-May-2012 21:36   0    
[TXT]   robots.txt  22-May-2012 19:57   204      

Apache/2.2.20 (Ubuntu) 服务器位于 server.silvernightfall.com 端口 80

我编辑了 apache2.conf

LoadModule passenger_module /home/ubuntu/.rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.12  
/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.12
PassengerRuby /usr/local/rvm/wrappers/ruby-1.9.3-p194/ruby

我编辑了apache2/sites-available/server

<VirtualHost *:80>
ServerAdmin victoria@jbyte.com
ServerName server.silvernightfall.com
# ServerAlias
DocumentRoot /var/www/sample_app/current/public
ErrorLog /var/www/sample_app/error.log
RailsEnv production
<Directory "/var/www/sample_app/current/public">
Options Indexes FollowSymLinks MultiViews
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

静态页面控制器

class StaticPagesController < ApplicationController
  def home
  end
  def help
  end
  def about
  end
  def contact
  end
end

和路由页面

SampleApp::Application.routes.draw do
root :to => 'static_pages#home'
 match '/signup',           to: 'users#new'
 match '/help',         to: 'static_pages#help'
 match '/about',        to: 'static_pages#about'
 match '/contact',          to: 'static_pages#contact'

end

我认为唯一可能搞砸它的另一件事是deploy.rb

                            # The name of your app
            set :application, "sample_app"
            # The directory on the EC2 node that will be deployed to
            set :deploy_to, "/var/www/#{application}"
            set :keep_releases, 3
            # deploy with git
            set :scm, :git
            set :repository,  "git@github.com:SilverNightFall/sample_app.git"
            set :git_shallow_clone, 1
            set :branch, "master"
            set :use_sudo, true
            # gets ssh info
            set :user, "ubuntu"
            ssh_options[:keys] = ["/Users/Victoria/Documents/ServerKeys/key.pem"]
            ssh_options[:forward_agent] = true
            default_run_options[:pty] = true
            # The address of the remote host on EC2 (the Public DNS address)
            set :location, "server.silvernightfall.com"
            # setup some Capistrano roles
            role :app, location
            role :web, location
            role :db,  location, :primary => true
            after 'deploy:update_code', 'deploy:symlink_db'
            namespace :deploy do
              desc "Restart Application"
              task :restart, :roles => :app do
                   run "touch #{deploy_to}/#{shared_dir}/tmp/restart.txt"
              end
              desc "Symlinks the database.yml"
              task :symlink_db, :roles => :app do
              run "ln -nfs #{deploy_to}/shared/config/database.yml    
                              #{release_path}/config/database.yml"
              end

事实证明,我不得不卸载并重新安装乘客。 看起来它被安装了两次。

最新更新