我已将Heroku环境设置为staging,但我的资产始终在production环境下编译。
这是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
显示我正在运行staging环境。
只有在运行assets:precompile
时,它才始终处于production环境中。
如果需要,我可以发布任何其他配置文件。
我还可以添加我正在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
的结果是:
/usr/local/bin/ruby /app/vendor/bundle/ruby/1.9.1/bin/rake assets:precompile:all RAILS_ENV=staging RAILS_GROUPS=assets
我是不是应该放弃,直接给Heroku发邮件?