Heroku总是运行资产:预编译Rails 3.2的生产环境 [英] Heroku always runs assets:precompile with the production environment for Rails 3.2

查看:114
本文介绍了Heroku总是运行资产:预编译Rails 3.2的生产环境的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



以下是 heroku config
$ p
GEM_PATH => vendor / bundle / ruby​​ / 1.9.1
LANG => en_US.UTF-8
PATH => bin:vendor / bundle / ruby​​ / 1.9.1 / bin:/ usr / local / bin:/ usr / bin:/ bin
RACK_ENV =>分段

我为 production.rb 文件添加了一个异常,所以我知道它在编译时运行的env资产。服务器启动正常运行 heroku run console 显示我正在运行登台。



只是在运行时 assets:precompile 它始终在生产中。



如果需要,我很乐意发布任何其他配置文件。

我可以补充一点,我正在运行Rails 3.2.2以及heroku上的Cedar栈






输出

 
关于您的应用程序的环境
Ruby版本1.9.2(x86_64-linux)
RubyGems版本1.3.7
机架版本1.4
Rails版本3.2.2
JavaScript运行时therubyracer(V8)
行动包版本3.2.2
有效支持版本3.2.2
中间件Rack :: Cache,ActionDispatch :: Static,Rack :: Lock,#,Rack ::运行时,Rack :: Auth :: Basic,Rack :: MethodOverride,ActionDispatch :: RequestId,Rails :: Rack :: Logger,ActionDispa tch :: ShowExceptions,ActionDispatch :: DebugExceptions,ActionDispatch :: RemoteIp,ActionDispatch :: Callbacks,ActionDispatch :: Cookies,ActionDispatch :: Session :: CookieStore,ActionDispatch :: Flash,ActionDispatch :: ParamsParser,ActionDispatch :: Head,Rack: :ConditionalGet,Rack :: ETag,ActionDispatch :: BestStandardsSupport
应用程序根目录/应用程序
环境分段

并运行 heroku运行rake资源:precompile 给出:

 / usr / local / bin / ruby​​ / app / vendor / bundle / ruby​​ / 1.9.1 / bin / rake assets:precompile:all RAILS_ENV = staging RAILS_GROUPS = assets 

我应该给打印和邮件Heroku?

解决方案

显然我需要启用插件以使其正常工作。


I have my Heroku environment set to staging but my assets are always compiled in the production environment.

Here's heroku config:

GEM_PATH            => vendor/bundle/ruby/1.9.1
LANG                => en_US.UTF-8
PATH                => bin:vendor/bundle/ruby/1.9.1/bin:/usr/local/bin:/usr/bin:/bin
RACK_ENV            => staging

I've added an exception to the production.rb file so I know which env it's running when compiling the assets. The server starts up just fine running heroku run console shows that I'm running staging.

It's just when running assets:precompile that it's always in production.

I'd be happy to post any other config file if required.

I can add that I'm running Rails 3.2.2 and the Cedar stack on heroku


Output from heroku run rake about:

About your application's environment
Ruby version             1.9.2 (x86_64-linux)
RubyGems version         1.3.7
Rack version             1.4
Rails version            3.2.2
JavaScript Runtime       therubyracer (V8)
Action Pack version      3.2.2
Active Support version   3.2.2
Middleware               Rack::Cache, ActionDispatch::Static, Rack::Lock, #, Rack::Runtime, Rack::Auth::Basic, Rack::MethodOverride, ActionDispatch::RequestId, Rails::Rack::Logger, ActionDispatch::ShowExceptions, ActionDispatch::DebugExceptions, ActionDispatch::RemoteIp, ActionDispatch::Callbacks, ActionDispatch::Cookies, ActionDispatch::Session::CookieStore, ActionDispatch::Flash, ActionDispatch::ParamsParser, ActionDispatch::Head, Rack::ConditionalGet, Rack::ETag, ActionDispatch::BestStandardsSupport
Application root         /app
Environment              staging

And running heroku run rake assets:precompile gives:

/usr/local/bin/ruby /app/vendor/bundle/ruby/1.9.1/bin/rake assets:precompile:all RAILS_ENV=staging RAILS_GROUPS=assets

Should I just give up and email Heroku?

解决方案

Apparently I needed to enable a plugin to make it work.

这篇关于Heroku总是运行资产:预编译Rails 3.2的生产环境的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆