我将 Heroku 环境设置为暂存,但我的资产始终在生产环境中编译。
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
我已经添加了一个例外production.rb
文件,这样我就知道编译资产时正在运行哪个环境。服务器启动运行良好heroku run console
显示我正在运行分期。
就是跑步的时候assets:precompile
它始终处于生产状态。
如果需要,我很乐意发布任何其他配置文件。
我可以补充一点,我正在 Heroku 上运行 Rails 3.2.2 和 Cedar 堆栈
输出来自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
和跑步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
我应该放弃并给 Heroku 发送电子邮件吗?