Tag: 乘客

在production.log中没有日志消息

我编写了一个演示HelloWorld Rails应用程序并使用WEBrick测试它(它甚至不使用数据库,它只是一个打印“hello world”的控制器)。 然后我尝试将其部署到使用Passenger的本地Apache。 事实上,这个测试只是让Passenger工作(这是我第一次在Apache上部署)。 现在我甚至不确定Passenger是否正常工作,但我在Apache方面没有任何错误。 当我http://rails.test/ ,浏览器显示Rails 500错误页面 – 所以我假设P​​assenger正常工作。 我想调查日志,但是生产.log是空的! 我不认为这是一个权限问题,因为如果我删除该文件,它会在我重新加载页面时重新创建。 我试图在conf/environments/production.rb更改日志级别,尝试使用Rails控制台生成手动写入日志文件 Rails.logger.error(‘asdf’) 它返回true但没有任何内容写入production.log。 路径(根据Rails.logger.inspect获得)是正确的,我注意到如果我手动删除它,该文件将被重新创建。 我怎么知道发生了什么? (我已经检查过Apache日志,另外我为Passenger设置了最高的调试级别,但它似乎是一个Rails问题,所以服务器没有记录)

在Rails中无缝部署

我想无缝升级我的Rails应用程序: 含义: 如果不需要运行迁移,我希望透明地升级代码,并且在部署期间没有请求404。 这很难我想要一些可以无缝升级数据库的进程,并且在此期间只需要在db更新完成后暂停Web请求(在管道中排队),允许通过。 (我只需要这个就可以进行短暂的迁移 – 比如5-10秒的迁移)。 你会如何实现这一目标?

使用nginx,passenger和capistrano部署Rails应用程序

我正在部署我的第一个rails应用程序。 我这样做有些麻烦。 我将描述我到目前为止所做的事情。 1)我通过gorails.com正确配置了所有内容 2)我正在尝试将其部署在Digital Ocean上 3)我进行了cap deploy production ,最终结果成功,中间有一些失败。 4)我启动了nginx服务器 5)在我的浏览器中它给了我500错误。 6)我检查了我的production.log ,它显示了它运行的所有迁移和种子。 它完美地创建了表格(正如我在我的数据库中检查过的那样)。 7)我检查了nginx error.log ,结果显示index.html缺失。 8)所以为了检查,我在公共目录中添加了index.html文件,浏览器正确显示了内容。 9)但是我的登陆页面是家庭控制器中的index.html.erb,所以在路径文件中我做了一些修改但是浏览器的输出没有变化。 10)我注意到error.log和production.log没有立即更新。 我不知道为什么。 11)我需要帮助让nginx显示我的index.html.erb文件并将其与rails app连接。 数据库配置正确。 12)我的nginx配置文件是: server { listen 80 default_server; server_name digital_ocean_ip; passenger_enabled on; rails_env production; root /home/myapp/myapp/current/public; # redirect server error pages to the static page /50x.html error_page 500 502 503 504 /50x.html; […]

在生产中更新了Ruby,现在Rails将无法启动,因为仍然引用旧的ruby

刚刚通过RVM在登台服务器上更新了Ruby: $ rvm upgrade 1.9.3-p327 1.9.3-p362 我对所有迁移和别名问题说“是”,包括删除旧的Ruby。 现在,每当我尝试访问Rails应用程序时,都会从Passenger获取错误: Error message: dlopen(/Library/WebServer/rails/myapp/shared/bundle/ruby/1.9.1/gems/bcrypt-ruby-3.0.1/lib/bcrypt_ext.bundle, 9): Library not loaded: /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/libruby.1.9.1.dylib Referenced from: /Library/WebServer/rails/myapp/shared/bundle/ruby/1.9.1/gems/bcrypt-ruby-3.0.1/lib/bcrypt_ext.bundle Reason: image not found – /Library/WebServer/rails/myapp/shared/bundle/ruby/1.9.1/gems/bcrypt-ruby-3.0.1/lib/bcrypt_ext.bundle 我已经重新安装了Passenger ……并且还使用稍微更新的Gemfile运行了cap deploy 。 但似乎仍有一些旧Ruby的引用。 这里发生了什么以及如何更新或重新编译,以便gem等引用新的Ruby? 是否有一些我可以在Capistrano中指定的标志会强制重新编译gem(假设这是问题)? 编辑(添加一些RVM信息): 我在这台服务器上使用RVM的“多用户”安装,因此gem安装在: /Library/WebServer/rails/popup/shared/bundle/ruby/1.9.1/gems gems而不是我的位置可能已经预料到了它们: /usr/local/rvm/rubies/ruby-1.9.3-p362/lib/ruby/gems/1.9.1/gems 。 从来没有真正理解RVM在多用户安装中所做的事情,但它已经奏效了。 因此,我不能真正$ rvm gemset use myapp然后bundle install因为我认为不会安装在正确的目录中。 这是Capistrano在bundle install任务期间的输出: * 2013-01-03 19:23:22 executing `bundle:install’ * executing “cd […]

phusion乘客独立服务器无法正常工作

如果我使用以下方式运行: rvmsudo passenger start -p 80 [编辑]输出是 >> rvmsudo passenger start -p 80 =============== Phusion Passenger Standalone web server started =============== PID file: /home/user/site/rails-webpage/tmp/pids/passenger.80.pid Log file: /home/user/site/rails-webpage/log/passenger.80.log Environment: development Accessible via: http://0.0.0.0/ You can stop Phusion Passenger Standalone by pressing Ctrl-C. =============================================================================== /usr/local/rvm/gems/ruby-1.9.3-p362/gems/therubyracer-0.10.2/ext/v8/v8.so: [BUG] Segmentation fault ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux] [\编辑] 在浏览器上,我得到了一个由乘客制作的页面,其中包含许多无用的错误。 至少对于我来说。 […]

rbenv乘客无法加载此类文件 – bundler / setup

我的乘客是作为gem安装的。 Nginx由passenger-install-nginx-module 。 ruby 2.1.1有3个gemsets,rubygemset rails4_1是这个应用程序的正确。 其他post显示类似的问题( 1,2,3 ),但没有一个解决我的问题。 [ 2014-09-29 14:29:17.1212 13182/7f32e5938700 Pool2/Implementation.cpp:287 ]: Could not spawn process for application /home/canoe/apps/app1: An error occured while starting up the preloader. Error ID: b57602d4 Error details saved to: /tmp/passenger-error-jcmrkH.html Message from application: cannot load such file — bundler/setup (LoadError) /home/canoe/.rbenv/versions/2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require’ /home/canoe/.rbenv/versions/2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require’ /home/canoe/.rbenv/versions/2.1.1/gemsets/rails4_1/gems/passenger-4.0.52/lib/phusion_passenger/loader_shared_helpers.rb:263:in `block in […]

Phusion Passenger错误:Gemfile.lock的权限被拒绝

任何人都可以提供有关此错误的任何见解我正在死亡的紫色屏幕上?

mongo + passenger:从rails中重新连接到数据库的正确方法? 如何确保最佳的mongo性能?

我们在轨道3.2.12,乘客+ nginx(1.0.10),mongo 2.2和mongomapper 0.12。 我们被告知乘客和mongo不能很好地协同工作,除非有一个配置集来确保快速的数据库连接(或重新连接)。 但是,有人建议我们在这里使用代码: http : //pastie.org/572282 。 然后我们在stackoverflow( mongoDB,乘客和性能问题与phusion乘客 )上找到了这篇文章,这是不同的。 这是确保乘客(和nginx)达到最佳mongo性能的正确方法吗?

ActionView :: Template ::错误(application.css未预编译)Rails

我在我的生产服务器下面: Started GET “/” for 101.160.190.206 at 2013-09-05 00:11:28 +1000 Processing by HomeController#index as HTML Rendered home/index.html.erb within layouts/application (0.5ms) Completed 500 Internal Server Error in 2ms ActionView::Template::Error (application.css isn’t precompiled): 4: 5: 6: <meta name="description" content="”> 7: “all” %> 8: 9: 10: app/views/layouts/application.html.erb:7:in `_app_views_layouts_application_html_erb__153052184121312410_16560580′ 我运行rake assets:precompile ,它似乎正确编译,因为我可以在资产文件中看到,但我仍然得到 We’re sorry, but something went wrong. 错误。 […]

Rails 4 app进入Bluehost的问题

我在启动我在bluehost上托管的rails应用程序时遇到了一些问题。 我认为问题是乘客版本与rails 4应用程序交互,但我不确定。 当我启动我的应用程序时,我得到了这个跟踪 Ruby (Rack) application could not be started These are the possible causes: There may be a syntax error in the application’s code. Please check for such errors and fix them. A required library may not installed. Please install all libraries that this application requires. The application may not be properly configured. […]