在 Heroku 上部署 Locomotive CMS 时出现 Jammit 警告
我正在尝试根据其安装指南在heroku上部署locomotive CMS http://www.locomotivecms.com /support/installation/heroku。我将资产上传到 S3 存储桶。因此,在 localhost 上它工作正常,但是当访问 heroku 上的站点时,会显示一条错误消息:
An error occurred in the application and your page could not be served. Please try again in a few moments. If you are the application owner, check your logs for details.
我检查了 heroku 日志:
2011-05-23T11:12:25+00:00 heroku[web.1]: Starting process with command: `thin -p 29674 -e production -R /home/heroku_rack/heroku.ru start`
2011-05-23T11:12:30+00:00 app[web.1]: Jammit Warning: Asset compression disabled -- Java unavailable.
2011-05-23T11:12:34+00:00 app[web.1]: /app/.bundle/gems/ruby/1.8/gems/mongo-1.3.1/lib/../lib/mongo/connection.rb:518:in `connect': Failed to connect to a master node at localhost:27017 (Mongo::ConnectionFailure)
2011-05-23T11:12:34+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/mongo-1.3.1/lib/../lib/mongo/connection.rb:656:in `setup'
2011-05-23T11:12:34+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/mongo-1.3.1/lib/../lib/mongo/connection.rb:101:in `initialize'
2011-05-23T11:12:34+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/mongo-1.3.1/lib/../lib/mongo/connection.rb:152:in `new'
2011-05-23T11:12:34+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/mongo-1.3.1/lib/../lib/mongo/connection.rb:152:in `from_uri'
2011-05-23T11:12:34+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/mongoid-2.0.1/lib/mongoid/config/database.rb:86:in `master'
2011-05-23T11:12:34+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/mongoid-2.0.1/lib/mongoid/config/database.rb:19:in `configure'
2011-05-23T11:12:34+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/mongoid-2.0.1/lib/mongoid/config.rb:319:in `configure_databases'
2011-05-23T11:12:34+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/mongoid-2.0.1/lib/mongoid/config.rb:114:in `from_hash'
2011-05-23T11:12:34+00:00 app[web.1]: from (eval):2:in `send'
2011-05-23T11:12:34+00:00 app[web.1]: from (eval):2:in `from_hash'
2011-05-23T11:12:34+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/mongoid-2.0.1/lib/mongoid/railtie.rb:66
2011-05-23T11:12:34+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.7/lib/rails/initializable.rb:25:in `instance_exec'
2011-05-23T11:12:34+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.7/lib/rails/initializable.rb:25:in `run'
2011-05-23T11:12:34+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.7/lib/rails/initializable.rb:50:in `run_initializers'
2011-05-23T11:12:34+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.7/lib/rails/initializable.rb:49:in `each'
2011-05-23T11:12:34+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.7/lib/rails/initializable.rb:49:in `run_initializers'
2011-05-23T11:12:34+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.7/lib/rails/application.rb:134:in `initialize!'
2011-05-23T11:12:34+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.7/lib/rails/application.rb:77:in `send'
2011-05-23T11:12:34+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.7/lib/rails/application.rb:77:in `method_missing'
2011-05-23T11:12:34+00:00 app[web.1]: from /app/config/environment.rb:5
2011-05-23T11:12:34+00:00 app[web.1]: from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
2011-05-23T11:12:34+00:00 app[web.1]: from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
2011-05-23T11:12:34+00:00 app[web.1]: from config.ru:3
2011-05-23T11:12:34+00:00 heroku[web.1]: Process exited
2011-05-23T04:12:35-07:00 heroku[web.1]: State changed from starting to crashed
2011-05-23T11:12:35+00:00 heroku[router]: Error H10 (App crashed) -> GET morning-night-832.heroku.com/ dyno=none queue=0 wait=0ms service=0ms bytes=0
2011-05-23T04:12:36-07:00 heroku[nginx]: GET / HTTP/1.1 | 80.218.114.86 | 795 | http | 503
2011-05-23T11:12:36+00:00 heroku[router]: Error H10 (App crashed) -> GET morning-night-832.heroku.com/favicon.ico dyno=none queue=0 wait=0ms service=0ms bytes=0
2011-05-23T11:12:39+00:00 heroku[router]: Error H10 (App crashed) -> GET morning-night-832.heroku.com/favicon.ico dyno=none queue=0 wait=0ms service=0ms bytes=0
2011-05-23T11:30:06+00:00 heroku[router]: Error H10 (App crashed) -> GET morning-night-832.heroku.com/ dyno=none queue=0 wait=0ms service=0ms bytes=0
看来,jammit 和资产存在问题。
2011-05-23T11:12:30+00:00 app[web.1]: Jammit Warning: Asset compression disabled -- Java unavailable.
直到现在我还没有在谷歌上找到任何有用的提示。有什么想法如何解决这个问题吗?
更新:我调整了 mongoid.yml 但仍然收到与上述相同的错误消息。我再次检查了日志:
2011-05-23T12:02:56+00:00 heroku[web.1]: Starting process with command: `thin -p 41882 -e production -R /home/heroku_rack/heroku.ru start`
2011-05-23T12:03:00+00:00 app[web.1]: Jammit Warning: Asset compression disabled -- Java unavailable.
2011-05-23T12:03:01+00:00 app[web.1]: /app/.bundle/gems/ruby/1.8/gems/rest-client-1.6.1/lib/restclient/abstract_response.rb:48:in `return!': 401 Unauthorized (RestClient::Request::Unauthorized)
2011-05-23T12:03:01+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/rest-client-1.6.1/lib/restclient/request.rb:220:in `process_result'
2011-05-23T12:03:01+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/rest-client-1.6.1/lib/restclient/request.rb:169:in `transmit'
2011-05-23T12:03:01+00:00 app[web.1]: from /usr/ruby1.8.7/lib/ruby/1.8/net/http.rb:543:in `start'
2011-05-23T12:03:01+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/rest-client-1.6.1/lib/restclient/request.rb:166:in `transmit'
2011-05-23T12:03:01+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/rest-client-1.6.1/lib/restclient/request.rb:60:in `execute'
2011-05-23T12:03:01+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/rest-client-1.6.1/lib/restclient/request.rb:31:in `execute'
2011-05-23T12:03:01+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/rest-client-1.6.1/lib/restclient/resource.rb:54:in `get'
2011-05-23T12:03:01+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/heroku-1.19.1/lib/heroku/client.rb:540:in `send'
2011-05-23T12:03:01+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/heroku-1.19.1/lib/heroku/client.rb:540:in `process'
2011-05-23T12:03:01+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/heroku-1.19.1/lib/heroku/client.rb:522:in `get'
2011-05-23T12:03:01+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/heroku-1.19.1/lib/heroku/client.rb:113:in `list_domains'
2011-05-23T12:03:01+00:00 app[web.1]: from /app/lib/locomotive/hosting/heroku.rb:41:in `enable_heroku'
2011-05-23T12:03:01+00:00 app[web.1]: from /app/config/initializers/../../lib/locomotive.rb:89:in `configure_hosting'
2011-05-23T12:03:01+00:00 app[web.1]: from /app/config/initializers/../../lib/locomotive.rb:57:in `after_configure'
2011-05-23T12:03:01+00:00 app[web.1]: from /app/config/initializers/../../lib/locomotive.rb:47:in `configure'
2011-05-23T12:03:01+00:00 app[web.1]: from /app/config/initializers/locomotive.rb:3
2011-05-23T12:03:01+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:235:in `load'
2011-05-23T12:03:01+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:235:in `load'
2011-05-23T12:03:01+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:227:in `load_dependency'
2011-05-23T12:03:01+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:235:in `load'
2011-05-23T12:03:01+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.7/lib/rails/engine.rb:201
2011-05-23T12:03:01+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.7/lib/rails/engine.rb:200:in `each'
2011-05-23T12:03:01+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.7/lib/rails/engine.rb:200
2011-05-23T12:03:01+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.7/lib/rails/initializable.rb:25:in `instance_exec'
2011-05-23T12:03:01+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.7/lib/rails/initializable.rb:25:in `run'
2011-05-23T12:03:01+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.7/lib/rails/initializable.rb:50:in `run_initializers'
2011-05-23T12:03:01+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.7/lib/rails/initializable.rb:49:in `each'
2011-05-23T12:03:01+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.7/lib/rails/application.rb:134:in `initialize!'
2011-05-23T12:03:01+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.7/lib/rails/initializable.rb:49:in `run_initializers'
2011-05-23T12:03:01+00:00 heroku[web.1]: Process exited
2011-05-23T05:03:03-07:00 heroku[nginx]: GET / HTTP/1.1 | 80.218.114.86 | 795 | http | 503
我想这次以下行是问题所在:
2011-05-23T12:03:01+00:00 app[web.1]: /app/.bundle/gems/ruby/1.8/gems/rest-client-1.6.1/lib/restclient/abstract_response.rb:48:in `return!': 401 Unauthorized (RestClient::Request::Unauthorized)
我想我需要再次配置我的heroku登录名和密码。让我们尝试一下...
更新 2:仍然不起作用。下面是我的 mongoid.yml 配置
defaults: &defaults
host: localhost
port: 27017
# slaves:
# - host: slave1.local
# port: 27018
# - host: slave2.local
# port: 27019
development:
<<: *defaults
database: locomotive_dev
test:
<<: *defaults
database: locomotive_test
# set these environment variables on your prod server
production:
# <<: *defaults
# database: locomotive_prod
# other settings for production
# host: <%= ENV['MONGOID_HOST'] %>
# port: <%= ENV['MONGOID_PORT'] %>
# username: <%= ENV['MONGOID_USERNAME'] %>
# password: <%= ENV['MONGOID_PASSWORD'] %>
# database: <%= ENV['MONGOID_DATABASE'] %>
#heroku
uri: <%= ENV['MONGOHQ_URL'] %>
# bushido (mongohq_url will also work)
# uri: <%= ENV['MONGODB_URL'] %>
我在 config/initializers/locomotive.rb 中的设置
require File.dirname(__FILE__) + '/../../lib/locomotive.rb'
Locomotive.configure do |config|
# A single locomotive instance can serve one single site or many.
# If you want to run many different websites, you will have to specify
# your own domain name (ex: locomotivehosting.com).
#
# Ex:
# config.multi_sites do |multi_sites|
# # each new website you add will have a default entry based on a subdomain
# # and the multi_site_domain value (ex: website_1.locomotivehosting.com).
# multi_sites.domain = 'example.com' #'myhostingplatform.com'
#
# # define the reserved subdomains
# # Ex:
# multi_sites.reserved_subdomains = %w(www admin email blog webmail mail support help site sites)
# end
config.multi_sites = false
# configure the hosting target for the production environment. Locomotive can be installed in:
# - your own server
# - Heroku (you need to create an account in this case)
# - Bushi.do (see the bushi.do website for more explanations)
#
# the possible options are: server, heroku, bushido or auto (default)
# if you select 'auto', Locomotive will look after specific ENV variables to check
# the matching platform (Heroku and Bushido set their own ENV variables).
#
config.hosting = :auto
# In case you host Locomotive in Heroku, the engine uses the heroku api to add / remove domains.
# there are 2 ways of passing heroku credentials to Locomotive
# - from ENV variables: HEROKU_LOGIN & HEROKU_PASSWORD
# - from this file, see the example below and uncomment it if needed
config.heroku = {
:login => ENV['HEROKU_LOGIN'],
:password => ENV['HEROKU_PASSWORD']
}
# Locomotive uses the DelayedJob gem for the site import module.
# In case you want to deploy to Heroku, you will have to pay for an extra dyno.
# If you do not mind about importing theme without DelayedJob, disable it.
#
# Warning: this option is not used if you deploy on bushi.do and we set automatically the value to true.
config.delayed_job = false
# configure how many items we display in sub menu in the "Contents" section.
# config.lastest_items_nb = 5
# default locale (for now, only en, de, fr, pt-BR and it are supported)
config.default_locale = :en
# tell if logs are enabled. Useful for debug purpose.
config.enable_logs = true
# Configure the e-mail address which will be shown in the DeviseMailer, NotificationMailer, ...etc
# if you do not put the domain name in the email, Locomotive will take the default domain name depending
# on your deployment target (server, Heroku, Bushido, ...etc)
#
# Ex:
# config.mailer_sender = 'support'
# # => '[email protected]' (Heroku), '[email protected]' (Bushido), '[email protected]' (Dev) or 'support@<your_hosting_platform>' (Multi-sites)
config.mailer_sender = 'support'
end unless Locomotive.engine? || Rails.env.test?
I am trying to deploy locomotive CMS on heroku according to their installation guide http://www.locomotivecms.com/support/installation/heroku. I uploaded the assets to an S3 bucket. So, on localhost it works fine, but when visiting the site on heroku an error message gets displayed:
An error occurred in the application and your page could not be served. Please try again in a few moments. If you are the application owner, check your logs for details.
I checked the heroku logs:
2011-05-23T11:12:25+00:00 heroku[web.1]: Starting process with command: `thin -p 29674 -e production -R /home/heroku_rack/heroku.ru start`
2011-05-23T11:12:30+00:00 app[web.1]: Jammit Warning: Asset compression disabled -- Java unavailable.
2011-05-23T11:12:34+00:00 app[web.1]: /app/.bundle/gems/ruby/1.8/gems/mongo-1.3.1/lib/../lib/mongo/connection.rb:518:in `connect': Failed to connect to a master node at localhost:27017 (Mongo::ConnectionFailure)
2011-05-23T11:12:34+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/mongo-1.3.1/lib/../lib/mongo/connection.rb:656:in `setup'
2011-05-23T11:12:34+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/mongo-1.3.1/lib/../lib/mongo/connection.rb:101:in `initialize'
2011-05-23T11:12:34+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/mongo-1.3.1/lib/../lib/mongo/connection.rb:152:in `new'
2011-05-23T11:12:34+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/mongo-1.3.1/lib/../lib/mongo/connection.rb:152:in `from_uri'
2011-05-23T11:12:34+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/mongoid-2.0.1/lib/mongoid/config/database.rb:86:in `master'
2011-05-23T11:12:34+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/mongoid-2.0.1/lib/mongoid/config/database.rb:19:in `configure'
2011-05-23T11:12:34+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/mongoid-2.0.1/lib/mongoid/config.rb:319:in `configure_databases'
2011-05-23T11:12:34+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/mongoid-2.0.1/lib/mongoid/config.rb:114:in `from_hash'
2011-05-23T11:12:34+00:00 app[web.1]: from (eval):2:in `send'
2011-05-23T11:12:34+00:00 app[web.1]: from (eval):2:in `from_hash'
2011-05-23T11:12:34+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/mongoid-2.0.1/lib/mongoid/railtie.rb:66
2011-05-23T11:12:34+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.7/lib/rails/initializable.rb:25:in `instance_exec'
2011-05-23T11:12:34+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.7/lib/rails/initializable.rb:25:in `run'
2011-05-23T11:12:34+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.7/lib/rails/initializable.rb:50:in `run_initializers'
2011-05-23T11:12:34+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.7/lib/rails/initializable.rb:49:in `each'
2011-05-23T11:12:34+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.7/lib/rails/initializable.rb:49:in `run_initializers'
2011-05-23T11:12:34+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.7/lib/rails/application.rb:134:in `initialize!'
2011-05-23T11:12:34+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.7/lib/rails/application.rb:77:in `send'
2011-05-23T11:12:34+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.7/lib/rails/application.rb:77:in `method_missing'
2011-05-23T11:12:34+00:00 app[web.1]: from /app/config/environment.rb:5
2011-05-23T11:12:34+00:00 app[web.1]: from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
2011-05-23T11:12:34+00:00 app[web.1]: from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
2011-05-23T11:12:34+00:00 app[web.1]: from config.ru:3
2011-05-23T11:12:34+00:00 heroku[web.1]: Process exited
2011-05-23T04:12:35-07:00 heroku[web.1]: State changed from starting to crashed
2011-05-23T11:12:35+00:00 heroku[router]: Error H10 (App crashed) -> GET morning-night-832.heroku.com/ dyno=none queue=0 wait=0ms service=0ms bytes=0
2011-05-23T04:12:36-07:00 heroku[nginx]: GET / HTTP/1.1 | 80.218.114.86 | 795 | http | 503
2011-05-23T11:12:36+00:00 heroku[router]: Error H10 (App crashed) -> GET morning-night-832.heroku.com/favicon.ico dyno=none queue=0 wait=0ms service=0ms bytes=0
2011-05-23T11:12:39+00:00 heroku[router]: Error H10 (App crashed) -> GET morning-night-832.heroku.com/favicon.ico dyno=none queue=0 wait=0ms service=0ms bytes=0
2011-05-23T11:30:06+00:00 heroku[router]: Error H10 (App crashed) -> GET morning-night-832.heroku.com/ dyno=none queue=0 wait=0ms service=0ms bytes=0
As it seems, there is a problem with jammit and the assets.
2011-05-23T11:12:30+00:00 app[web.1]: Jammit Warning: Asset compression disabled -- Java unavailable.
I didn't found any useful hints on Google until now. Any ideas how to solve that?
Update: I adapted the mongoid.yml but get still the same error message described as above. I checked again the logs:
2011-05-23T12:02:56+00:00 heroku[web.1]: Starting process with command: `thin -p 41882 -e production -R /home/heroku_rack/heroku.ru start`
2011-05-23T12:03:00+00:00 app[web.1]: Jammit Warning: Asset compression disabled -- Java unavailable.
2011-05-23T12:03:01+00:00 app[web.1]: /app/.bundle/gems/ruby/1.8/gems/rest-client-1.6.1/lib/restclient/abstract_response.rb:48:in `return!': 401 Unauthorized (RestClient::Request::Unauthorized)
2011-05-23T12:03:01+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/rest-client-1.6.1/lib/restclient/request.rb:220:in `process_result'
2011-05-23T12:03:01+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/rest-client-1.6.1/lib/restclient/request.rb:169:in `transmit'
2011-05-23T12:03:01+00:00 app[web.1]: from /usr/ruby1.8.7/lib/ruby/1.8/net/http.rb:543:in `start'
2011-05-23T12:03:01+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/rest-client-1.6.1/lib/restclient/request.rb:166:in `transmit'
2011-05-23T12:03:01+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/rest-client-1.6.1/lib/restclient/request.rb:60:in `execute'
2011-05-23T12:03:01+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/rest-client-1.6.1/lib/restclient/request.rb:31:in `execute'
2011-05-23T12:03:01+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/rest-client-1.6.1/lib/restclient/resource.rb:54:in `get'
2011-05-23T12:03:01+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/heroku-1.19.1/lib/heroku/client.rb:540:in `send'
2011-05-23T12:03:01+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/heroku-1.19.1/lib/heroku/client.rb:540:in `process'
2011-05-23T12:03:01+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/heroku-1.19.1/lib/heroku/client.rb:522:in `get'
2011-05-23T12:03:01+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/heroku-1.19.1/lib/heroku/client.rb:113:in `list_domains'
2011-05-23T12:03:01+00:00 app[web.1]: from /app/lib/locomotive/hosting/heroku.rb:41:in `enable_heroku'
2011-05-23T12:03:01+00:00 app[web.1]: from /app/config/initializers/../../lib/locomotive.rb:89:in `configure_hosting'
2011-05-23T12:03:01+00:00 app[web.1]: from /app/config/initializers/../../lib/locomotive.rb:57:in `after_configure'
2011-05-23T12:03:01+00:00 app[web.1]: from /app/config/initializers/../../lib/locomotive.rb:47:in `configure'
2011-05-23T12:03:01+00:00 app[web.1]: from /app/config/initializers/locomotive.rb:3
2011-05-23T12:03:01+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:235:in `load'
2011-05-23T12:03:01+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:235:in `load'
2011-05-23T12:03:01+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:227:in `load_dependency'
2011-05-23T12:03:01+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:235:in `load'
2011-05-23T12:03:01+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.7/lib/rails/engine.rb:201
2011-05-23T12:03:01+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.7/lib/rails/engine.rb:200:in `each'
2011-05-23T12:03:01+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.7/lib/rails/engine.rb:200
2011-05-23T12:03:01+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.7/lib/rails/initializable.rb:25:in `instance_exec'
2011-05-23T12:03:01+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.7/lib/rails/initializable.rb:25:in `run'
2011-05-23T12:03:01+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.7/lib/rails/initializable.rb:50:in `run_initializers'
2011-05-23T12:03:01+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.7/lib/rails/initializable.rb:49:in `each'
2011-05-23T12:03:01+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.7/lib/rails/application.rb:134:in `initialize!'
2011-05-23T12:03:01+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.7/lib/rails/initializable.rb:49:in `run_initializers'
2011-05-23T12:03:01+00:00 heroku[web.1]: Process exited
2011-05-23T05:03:03-07:00 heroku[nginx]: GET / HTTP/1.1 | 80.218.114.86 | 795 | http | 503
I suppose this time the following line is the problem:
2011-05-23T12:03:01+00:00 app[web.1]: /app/.bundle/gems/ruby/1.8/gems/rest-client-1.6.1/lib/restclient/abstract_response.rb:48:in `return!': 401 Unauthorized (RestClient::Request::Unauthorized)
I supppose I need to configure again my heroku login and password. Let's try that...
Update 2: still doesn't work. Below my mongoid.yml config
defaults: &defaults
host: localhost
port: 27017
# slaves:
# - host: slave1.local
# port: 27018
# - host: slave2.local
# port: 27019
development:
<<: *defaults
database: locomotive_dev
test:
<<: *defaults
database: locomotive_test
# set these environment variables on your prod server
production:
# <<: *defaults
# database: locomotive_prod
# other settings for production
# host: <%= ENV['MONGOID_HOST'] %>
# port: <%= ENV['MONGOID_PORT'] %>
# username: <%= ENV['MONGOID_USERNAME'] %>
# password: <%= ENV['MONGOID_PASSWORD'] %>
# database: <%= ENV['MONGOID_DATABASE'] %>
#heroku
uri: <%= ENV['MONGOHQ_URL'] %>
# bushido (mongohq_url will also work)
# uri: <%= ENV['MONGODB_URL'] %>
My settings in config/initializers/locomotive.rb
require File.dirname(__FILE__) + '/../../lib/locomotive.rb'
Locomotive.configure do |config|
# A single locomotive instance can serve one single site or many.
# If you want to run many different websites, you will have to specify
# your own domain name (ex: locomotivehosting.com).
#
# Ex:
# config.multi_sites do |multi_sites|
# # each new website you add will have a default entry based on a subdomain
# # and the multi_site_domain value (ex: website_1.locomotivehosting.com).
# multi_sites.domain = 'example.com' #'myhostingplatform.com'
#
# # define the reserved subdomains
# # Ex:
# multi_sites.reserved_subdomains = %w(www admin email blog webmail mail support help site sites)
# end
config.multi_sites = false
# configure the hosting target for the production environment. Locomotive can be installed in:
# - your own server
# - Heroku (you need to create an account in this case)
# - Bushi.do (see the bushi.do website for more explanations)
#
# the possible options are: server, heroku, bushido or auto (default)
# if you select 'auto', Locomotive will look after specific ENV variables to check
# the matching platform (Heroku and Bushido set their own ENV variables).
#
config.hosting = :auto
# In case you host Locomotive in Heroku, the engine uses the heroku api to add / remove domains.
# there are 2 ways of passing heroku credentials to Locomotive
# - from ENV variables: HEROKU_LOGIN & HEROKU_PASSWORD
# - from this file, see the example below and uncomment it if needed
config.heroku = {
:login => ENV['HEROKU_LOGIN'],
:password => ENV['HEROKU_PASSWORD']
}
# Locomotive uses the DelayedJob gem for the site import module.
# In case you want to deploy to Heroku, you will have to pay for an extra dyno.
# If you do not mind about importing theme without DelayedJob, disable it.
#
# Warning: this option is not used if you deploy on bushi.do and we set automatically the value to true.
config.delayed_job = false
# configure how many items we display in sub menu in the "Contents" section.
# config.lastest_items_nb = 5
# default locale (for now, only en, de, fr, pt-BR and it are supported)
config.default_locale = :en
# tell if logs are enabled. Useful for debug purpose.
config.enable_logs = true
# Configure the e-mail address which will be shown in the DeviseMailer, NotificationMailer, ...etc
# if you do not put the domain name in the email, Locomotive will take the default domain name depending
# on your deployment target (server, Heroku, Bushido, ...etc)
#
# Ex:
# config.mailer_sender = 'support'
# # => '[email protected]' (Heroku), '[email protected]' (Bushido), '[email protected]' (Dev) or 'support@<your_hosting_platform>' (Multi-sites)
config.mailer_sender = 'support'
end unless Locomotive.engine? || Rails.env.test?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Jammit 警告不是您的情况的问题。如果您在运行时关闭资产压缩,则此警告应该消失。
我认为您的 MongoDB 连接参数存在一些问题。您尚未安装 MongoDB 插件或连接参数不正确。
默认情况下,您在 locomotive.rb 中指定的 heroku 环境变量未定义。直接指定用户名/密码或从 Rails 文件夹内部指定用户名/密码,使用以下命令
添加这些环境变量。
The Jammit warning is not the problem in your case. If you switch off asset compression at runtime, this warning should go off..
I think there is some problem with your MongoDB connection params. Either you have not installed the MongoDB add-on or the connection params are incorrect.
By default, the heroku environment variables that you have specified in locomotive.rb are not defined. Either specify the username/password directly or from inside of your rails folder, use the following commands
to add these env variables..
据我所知,您应该运行 ruby 1.8.7 或 1.9.2 才能使机车工作。
您是否已将红宝石宝石更新到了?
如果没有,让我们尝试 Rvm:https://rvm.io
并重新安装您的 Locomotive 设置,然后它应该可以工作了!
如果您需要更多详细信息,请查看有关 Rail 安装的第一个教程:
http://ruby.railstutorial.org/
As I know, you should be running ruby 1.8.7 or 1.9.2 in order to make locomotive work.
Have you updated your ruby gem to thoe ?
If not, let's try Rvm : https://rvm.io
And reinstall your Locomotive setup and then it should work !
If you need more details check the first tutorial about Rail installation :
http://ruby.railstutorial.org/