Ruby on rails 3.1 如何运行资源:在Heroku上的子目录中使用Rails进行预编译?

Ruby on rails 3.1 如何运行资源:在Heroku上的子目录中使用Rails进行预编译?,ruby-on-rails-3.1,heroku,asset-pipeline,Ruby On Rails 3.1,Heroku,Asset Pipeline,我在一个子目录中有一个rails应用程序,发布到heroku Gemfile Gemfile.lock Rakefile config.ru railshost/ app/ etc... 如果我从基本Rakefile本地运行它,则在sprockets环境中,assets:precompile:nondigest失败且为nil undefined method 'each_logical_path' for nil:NilClass .../gems/actionpack-3.1.1/l

我在一个子目录中有一个rails应用程序,发布到heroku

Gemfile
Gemfile.lock
Rakefile
config.ru
railshost/
  app/
  etc...
如果我从基本Rakefile本地运行它,则在sprockets环境中,assets:precompile:nondigest失败且为nil

undefined method 'each_logical_path' for nil:NilClass
.../gems/actionpack-3.1.1/lib/sprockets/static_compiler.rb:18:in `compile'
如果我将assets:precompiletocd扩展到railshost,然后运行该任务,它将在Heroku上失败,因为找不到bin/node-它似乎是一个相对路径


我正在从一个应用程序中挑选一些其他的东西,所以希望这一切都能起作用

耙子 预编译调用一些子任务。我们必须诱使它炮击以维持我们的攻击

ENV['RAILS_GROUPS'] = nil # trick asset rake file into shelling out
Rake必须在rails目录中运行

task :railshost do
  cd 'railshost'
end

# this gets called by heroku
namespace :assets do
  task :precompile => [:railshost]

  namespace :precompile do
    task :nondigest => [:railshost]
  end
end
不幸的是,这破坏了Heroku的节点路径

railshost/bin/node
当然,所有常用的application-set应用程序都用于编译资产、服务资产等等。

我正在从一个正在进行其他事情的应用程序中挑选一些片段,希望这一切都能正常工作

耙子 预编译调用一些子任务。我们必须诱使它炮击以维持我们的攻击

ENV['RAILS_GROUPS'] = nil # trick asset rake file into shelling out
Rake必须在rails目录中运行

task :railshost do
  cd 'railshost'
end

# this gets called by heroku
namespace :assets do
  task :precompile => [:railshost]

  namespace :precompile do
    task :nondigest => [:railshost]
  end
end
不幸的是,这破坏了Heroku的节点路径

railshost/bin/node
当然,所有常用的application-set应用程序都用于编译资产、服务资产等等。

您是否找到过这个问题的答案?我有一个类似的错误,但它似乎是由不同的东西触发的。我想知道这个解决方案是否类似。你有没有找到答案?我有一个类似的错误,但它似乎是由不同的东西触发的。我想知道这个解决方案是否类似。