我试图设置PasswordPusher作为我的第一个ruby应用程序。 按照自述文件中的说明构build和运行webrick服务器正常工作。
只有当我试图添加Apache ProxyPass和ProxyPassReverse时,页面加载速度减慢了几分钟。
所以我给mod_passenger一个旋转,但现在无法find密码表。 这是我在日志/ production.log中得到的。
Started GET "/" for 10.10.2.13 at Sun Jun 10 08:07:19 +0200 2012 Processing by PasswordsController#new as HTML Completed 500 Internal Server Error in 1ms ActiveRecord::StatementInvalid (Could not find table 'passwords'): app/controllers/passwords_controller.rb:77:in `new' app/controllers/passwords_controller.rb:77:in `new'
而在日志/ private.log我得到更多的输出,所以这只是一个片段,但它看起来像它与数据库的工作。 编辑:这实际上是旧的日志输出,也许从db:create。
Migrating to AddUserToPassword (20120220172426) (0.3ms) ALTER TABLE "passwords" ADD "user_id" integer (0.0ms) PRAGMA index_list("passwords") (0.2ms) CREATE INDEX "index_passwords_on_user_id" ON "passwords" ("user_id") (0.7ms) INSERT INTO "schema_migrations" ("version") VALUES ('20120220172426') (0.1ms) select sqlite_version(*) (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" (0.0ms) PRAGMA index_list("passwords") (0.0ms) PRAGMA index_info('index_passwords_on_user_id') (4.6ms) PRAGMA index_list("rails_admin_histories") (0.0ms) PRAGMA index_info('index_rails_admin_histories') (0.0ms) PRAGMA index_list("users") (4.8ms) PRAGMA index_info('index_users_on_unlock_token') (0.0ms) PRAGMA index_info('index_users_on_reset_password_token') (0.0ms) PRAGMA index_info('index_users_on_email') (0.0ms) PRAGMA index_list("views")
在我的虚拟主机,我已经设置使用RailsEnv私人。
<VirtualHost *:80> # ProxyPreserveHost on # # ProxyPass / http://10.220.100.209:180/ # ProxyPassReverse / http://10.220.100.209:180/ DocumentRoot /var/www/pwpusher/public <Directory /var/www/pwpusher/public> allow from all Options -MultiViews </Directory> RailsEnv private ServerName pwpush.intranet ErrorLog /var/log/apache2/error.log LogLevel debug CustomLog /var/log/apache2/access.log combined </VirtualHost>
我的mod.-enabled中的passenger.conf是Debian的默认值。
<IfModule mod_passenger.c> PassengerRoot /usr PassengerRuby /usr/bin/ruby </IfModule>
在Apache的error.log中,我得到了更神秘的东西。
[Sun Jun 10 06:25:07 2012] [notice] Apache/2.2.16 (Debian) Phusion_Passenger/2.2.11 PHP/5.3.3-7+squeeze9 with Suhosin-Patch mod_ssl/2.2.16 OpenSSL/0.9.8o configured -- resuming normal operations /var/www/pwpusher/vendor/bundle/ruby/1.8/bundler/gems/modernizr-rails-09e9e6a92d67/lib/modernizr/rails/version.rb:3: warning: already initialized constant VERSION cache: [GET /] miss [Sun Jun 10 08:07:19 2012] [debug] mod_deflate.c(615): [client 10.10.2.13] Zlib: Compressed 728 to 423 : URL / /var/www/pwpusher/vendor/bundle/ruby/1.8/bundler/gems/modernizr-rails-09e9e6a92d67/lib/modernizr/rails/version.rb:3: warning: already initialized constant VERSION cache: [GET /] miss [Sun Jun 10 10:17:16 2012] [debug] mod_deflate.c(615): [client 10.10.2.13] Zlib: Compressed 728 to 423 : URL /
也许这是常规的东西。 我可以在相关的应用程序根db /中看到rake命令创build文件。 我有private.sqlite3,production.sqlite3等等。 这是我的config / database.yml。
base: &base adapter: sqlite3 timeout: 5000 development: database: db/development.sqlite3 <<: *base test: database: db/test.sqlite3 <<: *base private: database: db/private.sqlite3 <<: *base production: database: db/production.sqlite3 <<: *base
我试过设置绝对path,但没有帮助。
你的configuration看起来有效,和我在Passwordpusher @ pwpush.com上运行的类似。
确保你在合适的环境下运行db:create / db:migrate rake任务:
RAILS_ENV=private bundle exec rake db:create db:migrate
不提供RAILS_ENV部分将导致耙子使用默认的“发展”。
要validation,请确保在操作系统中正确创build了db / private.sqlite3并添加了时间戳。
如果这仍然不起作用,请在这里提交问题,我会给你一个手(我是PasswordPusher的作者): https : //github.com/pglombardo/PasswordPusher/issues