gpt4 book ai didi

ruby-on-rails - 推送到 heroku 使我无法使用默认设置获取 OPENSHIFT_SECRET_TOKEN

转载 作者:行者123 更新时间:2023-12-02 03:35:55 24 4
gpt4 key购买 nike

我正在尝试将我的应用程序部署到 heroku 服务器上,该服务器之前部署在 Open shift 上。在我上次推送之前它工作正常,现在出现以下错误。虽然,它在我的本地机器上运行良好。错误如下。

=> Ctrl-C to shutdown server
2014-05-05T10:46:19.190707+00:00 app[web.1]: Connecting to database specified by DATABASE_URL
2014-05-05T10:46:19.209705+00:00 app[web.1]: Unable to get OPENSHIFT_SECRET_TOKEN, using default
2014-05-05T10:46:19.209862+00:00 app[web.1]: Unable to get OPENSHIFT_SECRET_TOKEN, using default
2014-05-05T10:46:19.929309+00:00 app[web.1]: Exiting
2014-05-05T10:46:19.930376+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/engine.rb:436:in `eager_load!'
2014-05-05T10:46:19.930344+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:317:in `rescue in depend_on': No such file to load -- selenium-webdriver (LoadError)
2014-05-05T10:46:19.930368+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/engine.rb:439:in `block (2 levels) in eager_load!'
2014-05-05T10:46:19.930366+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:225:in `require_dependency'
2014-05-05T10:46:19.930373+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/engine.rb:438:in `block in eager_load!'
2014-05-05T10:46:19.930372+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/engine.rb:438:in `each'
2014-05-05T10:46:19.930377+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/application/finisher.rb:53:in `block in <module:Finisher>'
2014-05-05T10:46:19.930378+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `instance_exec'
2014-05-05T10:46:19.930374+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/engine.rb:436:in `each'
2014-05-05T10:46:19.930348+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:312:in `depend_on'
2014-05-05T10:46:19.930379+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `run'
2014-05-05T10:46:19.930381+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/initializable.rb:55:in `block in run_initializers'
2014-05-05T10:46:19.930382+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `each'
2014-05-05T10:46:19.930391+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/application.rb:136:in `initialize!'
2014-05-05T10:46:19.930390+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `run_initializers'
2014-05-05T10:46:19.930394+00:00 app[web.1]: from /app/config/environment.rb:5:in `<top (required)>'
2014-05-05T10:46:19.930392+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/railtie/configurable.rb:30:in `method_missing'
2014-05-05T10:46:19.930395+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
2014-05-05T10:46:19.930396+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
2014-05-05T10:46:19.930400+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
2014-05-05T10:46:19.930401+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
2014-05-05T10:46:19.930402+00:00 app[web.1]: from /app/config.ru:3:in `block in <main>'
2014-05-05T10:46:19.930404+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval'
2014-05-05T10:46:19.930405+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize'
2014-05-05T10:46:19.930409+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/builder.rb:40:in `eval'
2014-05-05T10:46:19.930406+00:00 app[web.1]: from /app/config.ru:in `new'
2014-05-05T10:46:19.930408+00:00 app[web.1]: from /app/config.ru:in `<main>'
2014-05-05T10:46:19.930413+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/commands/server.rb:46:in `app'
2014-05-05T10:46:19.930411+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/server.rb:200:in `app'
2014-05-05T10:46:19.930410+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/builder.rb:40:in `parse_file'
2014-05-05T10:46:19.930422+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/server.rb:304:in `wrapped_app'
2014-05-05T10:46:19.930424+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/server.rb:254:in `start'
2014-05-05T10:46:19.930425+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/commands/server.rb:70:in `start'
2014-05-05T10:46:19.930426+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/commands.rb:55:in `block in <top (required)>'
2014-05-05T10:46:19.930427+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/commands.rb:50:in `tap'
2014-05-05T10:46:19.930428+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/commands.rb:50:in `<top (required)>'
2014-05-05T10:46:19.930430+00:00 app[web.1]: from script/rails:6:in `require'
2014-05-05T10:46:19.930433+00:00 app[web.1]: from script/rails:6:in `<main>'
2014-05-05T10:46:21.257306+00:00 heroku[web.1]: State changed from starting to crashed
2014-05-05T10:46:21.258394+00:00 heroku[web.1]: State changed from crashed to starting

更新我的 database.yml 看起来像这样

sqlite: &sqlite
adapter: sqlite3
database: db/<%= Rails.env %>.sqlite3

mysql: &mysql
adapter: mysql2
database: "<%=ENV['OPENSHIFT_APP_NAME']%>"
username: "<%=ENV['OPENSHIFT_MYSQL_DB_USERNAME']%>"
password: "<%=ENV['OPENSHIFT_MYSQL_DB_PASSWORD']%>"
host: <%=ENV['OPENSHIFT_MYSQL_DB_HOST']%>
port: <%=ENV['OPENSHIFT_MYSQL_DB_PORT']%>

postgresql: &postgresql
adapter: postgresql
database: <%=ENV['OPENSHIFT_APP_NAME']%>
username: <%=ENV['OPENSHIFT_POSTGRESQL_DB_USERNAME']%>
password: <%=ENV['OPENSHIFT_POSTGRESQL_DB_PASSWORD']%>
host: <%=ENV['OPENSHIFT_POSTGRESQL_DB_HOST']%>
port: <%=ENV['OPENSHIFT_POSTGRESQL_DB_PORT']%>
min_messages: ERROR
reconnect: false

defaults: &defaults
pool: 5
timeout: 5000
encoding: utf8
<<: *<%= ENV['RAILS_DB'] || "sqlite" %>

development:
<<: *defaults

test: &test
<<: *defaults

production:
<<: *defaults

我的 config/initializers/secret_token.rb 看起来像这样。

require File.join(Rails.root,'lib','openshift_secret_generator.rb')

RailsApp::Application.config.secret_token = initialize_secret(
:token,
'my token'
)

最佳答案

Heroku 将为 Rails < 4.1 的所有版本重写 database.yml - 所以可以安全地假设这不是这里的问题。

我很想查看 config\initializers\secret_token.rb 作为您问题的原因,我怀疑将访问 OPENSHIFT_SECRET_TOKEN,当应用程序已初始化。

关于ruby-on-rails - 推送到 heroku 使我无法使用默认设置获取 OPENSHIFT_SECRET_TOKEN,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23471938/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com