Tag: 部署

在heroku雪松堆栈上部署sinatra app(使用config.ru)

我正在尝试重构我的sinatra代码,将我的主文件分成单独的文件,使用此响应中的一些提示,并且我遇到了部署到heroku的麻烦。 以前我没有config.ru文件,只使用了我的Procfile ,它是: web: bundle exec ruby web.rb -p $PORT 根据这篇文章 。 从重构开始,我现在将我的Procfile更改为 web: bundle exec thin -R config.ru start -p $PORT 我的config.ru文件正在 root = ::File.dirname(__FILE__) require ::File.join( root, ‘web’ ) run MyApp.new 我的web.rb文件包含在类定义中 class MyApp < Sinatra::Application # … end 这适用于我的本地开发计算机,但是当我部署到heroku时,我得到了 2011-12-01T11:21:54+00:00 app[web.1]: bundler: command not found: thin 2011-12-01T11:21:54+00:00 app[web.1]: Install missing gem executables […]

Capistrano 3改变任务中的ssh_options

我尝试使用不同的ssh_options在同一阶段运行capistrano v.3任务。 我的production.rb说: set :stage, :production set :user, ‘deploy’ set :ssh_options, { user: ‘deploy’ } 通过这种配置,capistrano与用户部署连接,这对于其余的用户来说是正确的。 但我需要在服务器中配置良好的an_other_user将其连接到一个特定任务。 然后我的食谱说: … tasks with original user … task :my_task_with_an_other_user do set :user, ‘an_other_user’ set :ssh_options, { user: ‘an_other_user’ } on roles(:all) do |host| execute :mkdir, ‘-p’, ‘mydir’ end end … other tasks with original user … 执行时: cap […]

为什么我收到此乘客错误无法在任何来源中找到rake-0.9.2.2?

我刚刚创建了一个新的空Rails应用程序,它几乎是空的。 我创建它只是为了试图找出问题,但我收到以下错误。 我正在使用Rails 3.1.0和Ruby 1.9.2 Error message: Could not find rake-0.9.2.2 in any of the sources (Bundler::GemNotFound) Exception class: PhusionPassenger::UnknownError 所以我将rake-0.9.2.2添加到Gemfile并运行bundle,我仍然收到相同的错误消息。 我不知道问题是什么,我甚至试图打开rails日志文件,但那里什么都没有。 我已经多次尝试以不同方式修复错误,但似乎没有任何工作。 我认为它也可能与资产管道有关。 添加细节 我试着打包gem,现在我得到了这个 bundle show mysql2 /releases/20111117205618/vendor/bundle/ruby/1.9.1/gems/mysql2-0.3.10 bundle show rails /releases/20111117205618/vendor/bundle/ruby/1.9.1/gems/rails-3.1.0 bundle show bundler /usr/local/rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.21 注意bundler gem和其他gem之间的区别。

部署时“预热缓存”

我想知道是否有人有任何插件或capistrano配方,通过在部署时构建所有页面缓存的html或在部署发生之前本地“预热”rails应用程序的页面缓存。 我有一些大多数静态网站没有太大变化,如果已经编写了html,它会运行得更快,而不是要求一个访问者访问该网站。 而不是自己创建(似乎很容易,但它优先级低)它是否已经存在?