ruby-on-rails-3.1 – 每个上限的服务器上的机架错误:部署

ruby-on-rails-3.1 – 每个上限的服务器上的机架错误:部署,第1张

概述每次我在我的本地机器上运行时:部署我在打开我的网页时出现下一个错误: Ruby (Rack) application could not be startedError message:git://github.com/ctran/annotate_models.git (at master) is not checked out. Please run `bundle install` (B 每次我在我的本地机器上运行时:部署我在打开我的网页时出现下一个错误:

Ruby (Rack) application Could not be startedError message:git://github.com/ctran/annotate_models.git (at master) is not checked out. Please run `bundle install` (Bundler::GitError)Exception class:PhusionPassenger::UnkNownErrorApplication root:/vol/www/apps/ror_tutorial/currentBacktrace:#filelineLocation0/usr/local/rvm/gems/ruby-1.9.3-head/gems/bundler-1.0.21/lib/bundler/source.rb572in `rescue in load_spec_files'1/usr/local/rvm/gems/ruby-1.9.3-head/gems/bundler-1.0.21/lib/bundler/source.rb570in `load_spec_files'2/usr/local/rvm/gems/ruby-1.9.3-head/gems/bundler-1.0.21/lib/bundler/source.rb385in `local_specs'3/usr/local/rvm/gems/ruby-1.9.3-head/gems/bundler-1.0.21/lib/bundler/source.rb555in `specs'4/usr/local/rvm/gems/ruby-1.9.3-head/gems/bundler-1.0.21/lib/bundler/deFinition.rb147in `block in resolve'5/usr/local/rvm/gems/ruby-1.9.3-head/gems/bundler-1.0.21/lib/bundler/deFinition.rb145in `each'6/usr/local/rvm/gems/ruby-1.9.3-head/gems/bundler-1.0.21/lib/bundler/deFinition.rb145in `resolve'7/usr/local/rvm/gems/ruby-1.9.3-head/gems/bundler-1.0.21/lib/bundler/deFinition.rb90in `specs'8/usr/local/rvm/gems/ruby-1.9.3-head/gems/bundler-1.0.21/lib/bundler/deFinition.rb135in `specs_for'9/usr/local/rvm/gems/ruby-1.9.3-head/gems/bundler-1.0.21/lib/bundler/deFinition.rb124in `requested_specs'10/usr/local/rvm/gems/ruby-1.9.3-head/gems/bundler-1.0.21/lib/bundler/environment.rb23in `requested_specs'11/usr/local/rvm/gems/ruby-1.9.3-head/gems/bundler-1.0.21/lib/bundler/runtime.rb11in `setup'12/usr/local/rvm/gems/ruby-1.9.3-head/gems/bundler-1.0.21/lib/bundler.rb110in `setup'13/usr/local/rvm/gems/ruby-1.9.3-head/gems/passenger-3.0.11/lib/phusion_passenger/utils.rb326in `prepare_app_process'14/usr/local/rvm/gems/ruby-1.9.3-head/gems/passenger-3.0.11/lib/phusion_passenger/rack/application_spawner.rb156in `block in initialize_server'15/usr/local/rvm/gems/ruby-1.9.3-head/gems/passenger-3.0.11/lib/phusion_passenger/utils.rb572in `report_app_init_status'16/usr/local/rvm/gems/ruby-1.9.3-head/gems/passenger-3.0.11/lib/phusion_passenger/rack/application_spawner.rb154in `initialize_server'17/usr/local/rvm/gems/ruby-1.9.3-head/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server.rb204in `start_synchronously'18/usr/local/rvm/gems/ruby-1.9.3-head/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server.rb180in `start'19/usr/local/rvm/gems/ruby-1.9.3-head/gems/passenger-3.0.11/lib/phusion_passenger/rack/application_spawner.rb129in `start'20/usr/local/rvm/gems/ruby-1.9.3-head/gems/passenger-3.0.11/lib/phusion_passenger/spawn_manager.rb253in `block (2 levels) in spawn_rack_application'21/usr/local/rvm/gems/ruby-1.9.3-head/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server_collection.rb132in `lookup_or_add'22/usr/local/rvm/gems/ruby-1.9.3-head/gems/passenger-3.0.11/lib/phusion_passenger/spawn_manager.rb246in `block in spawn_rack_application'23/usr/local/rvm/gems/ruby-1.9.3-head/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server_collection.rb82in `block in synchronize'24prelude>10:in `synchronize'25/usr/local/rvm/gems/ruby-1.9.3-head/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server_collection.rb79in `synchronize'26/usr/local/rvm/gems/ruby-1.9.3-head/gems/passenger-3.0.11/lib/phusion_passenger/spawn_manager.rb244in `spawn_rack_application'27/usr/local/rvm/gems/ruby-1.9.3-head/gems/passenger-3.0.11/lib/phusion_passenger/spawn_manager.rb137in `spawn_application'28/usr/local/rvm/gems/ruby-1.9.3-head/gems/passenger-3.0.11/lib/phusion_passenger/spawn_manager.rb275in `handle_spawn_application'29/usr/local/rvm/gems/ruby-1.9.3-head/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server.rb357in `server_main_loop'30/usr/local/rvm/gems/ruby-1.9.3-head/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server.rb206in `start_synchronously'31/usr/local/rvm/gems/ruby-1.9.3-head/gems/passenger-3.0.11/helper-scripts/passenger-spawn-server99in `'

我通过下一行解决了这个问题:

$bundle install --without development test$bundle install --deployment$service Nginx restart

但我真的厌倦了一次又一次这样做.有谁知道如何永远修复它?

我的gemfile:

source 'http://rubygems.org'gem 'rails','3.1.3'                                                          gem 'gravatar_image_tag'gem 'will_paginate'gem 'rack'                                                                    gem 'rake'                                                                    gem 'texticle',"2.0",:require => 'texticle/rails'# Gems used only for assets and not required# in production environments by default.group :assets do  gem 'sass-rails'                                                              gem 'coffee-rails'                                                            gem 'uglifIEr'endgem 'jquery-rails'group :development do  gem 'cAPIstrano'  gem 'rspec-rails'                                                            gem 'therubyracer-heroku'  gem 'pg'                                                                       gem 'annotate',:git => 'git://github.com/ctran/annotate_models.git'          gem 'faker'                                                                 endgroup :test do  gem 'rspec-rails'                                                             gem 'webrat'                                                                  gem 'spork'  gem 'autotest'                                                                                                                 gem 'autotest-rails-pure'                                                                                                    gem 'autotest-fsevent'                                                        gem 'autotest-growl'                                                                                                       gem 'factory_girl_rails'endgroup :production do    gem 'pg'                                                                      gem 'faker'end

配置/ deploy.rb

set :user,"root"                                                                 set :rails_env,"production"default_run_options[:pty] = true                                              set :repository,"git://github.com/Loremaster/sample_app.git"set :application,"ror_tutorial"set :deploy_to,"/vol/www/apps/#{application}"set :scm,:gitset :branch,"master"set :deploy_via,:remote_cache                                                server "my.ip",:app,:web,:db,:primary => true# If you are using Passenger mod_rails uncomment this:namespace :deploy do   task :start do ; end   task :stop do ; end   task :restart,:roles => :app,:except => { :no_release => true } do     run "#{try_sudo} touch #{file.join(current_path,'tmp','restart.txt')}"   endend

我的服务器系统:

Ubuntu 10.04 LTSPostgresql 9.1Rails 3.1.3Ruby 1.9.3p27Nginx 1.0.11 (installed/compiled by passenger)Phusion passenger 3.0.11CAPIstrano
解决方法 除非您指定在deploy.rb中使用bundler,否则cAPIstrano不会自动运行bundler命令.我将此行添加到deploy.rb文件的顶部以激活bundler集成.然后CAPIstrano在部署时自动运行正确的bundler命令.

require 'bundler/cAPIstrano'  # Add Bundler integration to cAPIstrano

您运行捆绑安装的解决方案 – 没有开发测试和捆绑安装 – 部署实际上是相同的,但必须手动保持最新.此外,您可以将其提炼为单个命令:bundle install –deployment – without development development.在当前的解决方案中,您运行了两次捆绑程序.

总结

以上是内存溢出为你收集整理的ruby-on-rails-3.1 – 每个上限的服务器上的机架错误:部署全部内容,希望文章能够帮你解决ruby-on-rails-3.1 – 每个上限的服务器上的机架错误:部署所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/1282904.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-09
下一篇 2022-06-09

发表评论

登录后才能评论

评论列表(0条)

保存