简体   繁体   English

Ruby on Rails Heroku运行rake db:migrate解密

[英]Ruby on Rails Heroku run rake db:migrate deciphering

Running rake db:migrate --trace on synkline... up, run.9965
rake aborted!
NameError: undefined local variable or method `config' for main:Object
/app/config/application.rb:6:in `<top (required)>'
/app/Rakefile:4:in `require'
/app/Rakefile:4:in `<top (required)>'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/rake_module.rb:28:in `load'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/rake_module.rb:28:in `load_rakefile'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:689:in `raw_load_rakefile'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:94:in `block in load_rakefile'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:176:in `standard_exception_handling'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:93:in `load_rakefile'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:77:in `block in run'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:176:in `standard_exception_handling'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:75:in `run'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/bin/rake:33:in `<top (required)>'
/app/vendor/bundle/ruby/2.0.0/bin/rake:23:in `load'
/app/vendor/bundle/ruby/2.0.0/bin/rake:23:in `<main>'

Here's the problem: I am trying to deploy a basic ruby app to Heroku and when I run the following command: heroku run rake db:migrate --trace . 这是问题所在:我试图将基本的ruby应用程序部署到Heroku,并且在运行以下命令时: heroku run rake db:migrate --trace I get the above output. 我得到上面的输出。 Can anyone help me decipher this and maybe get me going in the correct direction to help solve and fix this issue so that I may be able to deploy this app and host it live. 任何人都可以帮我破译这个错误,也许可以让我朝正确的方向发展,以帮助解决和解决此问题,以便我可以部署此应用并对其进行托管。

Many thanks in advance. 提前谢谢了。

UPDATE I have included my application.rb and Rakefiles as follows. 更新我包括我的application.rb和Rakefiles如下。

application.rb file: application.rb文件:

# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)

module Synkline
  class Application < Rails::Application
    # Settings in config/environments/* take precedence over those specified here.
    # Application configuration should go into files in config/initializers
    # -- all .rb files in that directory are automatically loaded.

    # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
    # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
    # config.time_zone = 'Central Time (US & Canada)'

    # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
    # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
    # config.i18n.default_locale = :de
  end
end



    Rakefile:
    # Add your own tasks in files placed in lib/tasks ending in .rake,
    # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.

    require File.expand_path('../configure/application', __FILE__)

    Rails.application.load_tasks
NameError: undefined local variable or method config' for main:Object
/app/config/application.rb:6:in' 

Look here. 看这里。 Check your app config. 检查您的应用程序配置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM