首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >12296#0:*4 --乘客运行但页面不显示-- Rails by example示例应用程序

12296#0:*4 --乘客运行但页面不显示-- Rails by example示例应用程序
EN

Stack Overflow用户
提问于 2012-05-23 10:24:47
回答 1查看 350关注 0票数 2

为什么只有apache文件显示出来。为什么乘客页面没有出现?

是什么让它指向public/public?我删除了index.html文件,因为我有一个static_pages控制器

代码语言:javascript
复制
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: 

这是我转到url时出现的内容。

代码语言:javascript
复制
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      

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

我编辑了apache2.conf

代码语言:javascript
复制
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

代码语言:javascript
复制
<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>

静态页面控制器

代码语言:javascript
复制
class StaticPagesController < ApplicationController

  def home
  end

  def help
  end

  def about
  end

  def contact
  end
end

和一个路由页面

代码语言:javascript
复制
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

代码语言:javascript
复制
                            # 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
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-05-24 07:32:56

结果我不得不卸载并重新安装Passenger。看起来它安装了两次。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/10712680

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档