将Rails应用程序部署到Heroku时出错

时间:2013-06-27 01:59:57

标签: ruby-on-rails heroku

您好我刚开始学习Ruby on Rails并且正在观看Railstutoprials屏幕演员。但是,当我执行git push to heroku并尝试加载我的rails应用程序时,我收到错误,我的日志看起来像这样。

2013-06-26T22:41:06.427464+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 55907 -e $RAILS_ENV`
2013-06-26T22:41:07.770202+00:00 app[web.1]: 
2013-06-26T22:41:07.770515+00:00 app[web.1]: Options:
2013-06-26T22:41:07.770114+00:00 app[web.1]:   rails new APP_PATH [options]
2013-06-26T22:41:07.771778+00:00 app[web.1]:   -m, [--template=TEMPLATE]      # Path to some application template (can be a filesystem path or URL)
2013-06-26T22:41:07.771778+00:00 app[web.1]:   -r, [--ruby=PATH]              # Path to the Ruby binary of your choice
2013-06-26T22:41:07.771778+00:00 app[web.1]:   -B, [--skip-bundle]            # Don't run bundle install
2013-06-26T22:41:07.770029+00:00 app[web.1]: Usage:
2013-06-26T22:41:07.771962+00:00 app[web.1]:                                  # Default: sqlite3
2013-06-26T22:41:07.771778+00:00 app[web.1]:   -d, [--database=DATABASE]      # Preconfigure for selected database (options: mysql/oracle/postgresql/sqlite3/frontbase/ibm_db/sqlserver/jdbcmysql/jdbcsqlite3/jdbcpostgresql/jdbc)
2013-06-26T22:41:07.771962+00:00 app[web.1]:   -j, [--javascript=JAVASCRIPT]  # Preconfigure for selected JavaScript library
2013-06-26T22:41:07.771778+00:00 app[web.1]:                                  # Default: /app/vendor/ruby-2.0.0/bin/ruby
2013-06-26T22:41:07.771778+00:00 app[web.1]:       [--skip-gemfile]           # Don't create a Gemfile
2013-06-26T22:41:07.771778+00:00 app[web.1]:   -O, [--skip-active-record]     # Skip Active Record files
2013-06-26T22:41:07.771778+00:00 app[web.1]:   -G, [--skip-git]               # Skip .gitignore file
2013-06-26T22:41:07.771962+00:00 app[web.1]:   -J, [--skip-javascript]        # Skip JavaScript files
2013-06-26T22:41:07.771778+00:00 app[web.1]:       [--skip-keeps]             # Skip source control .keep files
2013-06-26T22:41:07.771778+00:00 app[web.1]:   -S, [--skip-sprockets]         # Skip Sprockets files
2013-06-26T22:41:07.771962+00:00 app[web.1]:                                  # Default: jquery
2013-06-26T22:41:07.771962+00:00 app[web.1]:       [--edge]                   # Setup the application with Gemfile pointing to Rails repository
2013-06-26T22:41:07.771962+00:00 app[web.1]:   -T, [--skip-test-unit]         # Skip Test::Unit files
2013-06-26T22:41:07.771962+00:00 app[web.1]:       [--rc=RC]                  # Path to file containing extra configuration options for rails command
2013-06-26T22:41:07.771962+00:00 app[web.1]:       [--dev]                    # Setup the application with Gemfile pointing to your Rails checkout
2013-06-26T22:41:07.771962+00:00 app[web.1]:       [--no-rc]                  # Skip loading of extra configuration options from .railsrc file
2013-06-26T22:41:07.771962+00:00 app[web.1]: 
2013-06-26T22:41:07.772167+00:00 app[web.1]: Runtime options:
2013-06-26T22:41:07.772167+00:00 app[web.1]:   -f, [--force]    # Overwrite files that already exist
2013-06-26T22:41:07.772167+00:00 app[web.1]:   -p, [--pretend]  # Run but do not make any changes
2013-06-26T22:41:07.773137+00:00 app[web.1]: Rails options:
2013-06-26T22:41:07.772167+00:00 app[web.1]:   -s, [--skip]     # Skip files that already exist
2013-06-26T22:41:07.772167+00:00 app[web.1]:   -q, [--quiet]    # Suppress status output
2013-06-26T22:41:07.772167+00:00 app[web.1]: 
2013-06-26T22:41:07.773756+00:00 app[web.1]: Description:
2013-06-26T22:41:07.773217+00:00 app[web.1]:   -v, [--version]  # Show Rails version number and quit
2013-06-26T22:41:07.773756+00:00 app[web.1]:     The 'rails new' command creates a new Rails application with a default
2013-06-26T22:41:07.773217+00:00 app[web.1]:   -h, [--help]     # Show this help message and quit
2013-06-26T22:41:07.773756+00:00 app[web.1]:     directory structure and configuration at the path you specify.
2013-06-26T22:41:07.773756+00:00 app[web.1]:     'rails new' runs in the .railsrc configuration file in your home directory.
2013-06-26T22:41:07.773217+00:00 app[web.1]: 
2013-06-26T22:41:07.773756+00:00 app[web.1]:     defaults values shown above in this help message.
2013-06-26T22:41:07.773756+00:00 app[web.1]: 
2013-06-26T22:41:07.773756+00:00 app[web.1]:     You can specify extra command-line arguments to be used every time
2013-06-26T22:41:07.773756+00:00 app[web.1]:     Note that the arguments specified in the .railsrc file don't affect the
2013-06-26T22:41:07.773756+00:00 app[web.1]: 
2013-06-26T22:41:07.773756+00:00 app[web.1]: 
2013-06-26T22:41:07.773989+00:00 app[web.1]: Example:
2013-06-26T22:41:07.773989+00:00 app[web.1]: 
2013-06-26T22:41:07.773989+00:00 app[web.1]:     See the README in the newly created application to get going.
2013-06-26T22:41:07.773989+00:00 app[web.1]:     rails new ~/Code/Ruby/weblog
2013-06-26T22:41:07.773989+00:00 app[web.1]:     This generates a skeletal Rails installation in ~/Code/Ruby/weblog.
2013-06-26T22:41:09.160872+00:00 heroku[web.1]: Process exited with status 0
2013-06-26T22:41:09.172961+00:00 heroku[web.1]: State changed from starting to crashed

我的Gemfile看起来像:

source 'https://rubygems.org'

ruby '2.0.0'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0'

# Use postgresql as the database for Active Record
gem 'pg', group: :production

gem 'sqlite3', group: [:test, :development]

# Use V8 JavaScript engine
gem 'therubyracer'

# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'

# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'

# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'

# Use jquery as the JavaScript library
gem 'jquery-rails'

# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'

# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.2'

gem 'rails_12factor'

group :doc do
  # bundle exec rake doc:rails generates the API under doc/api.
  gem 'sdoc', require: false
end

# Use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# Use unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano', group: :development

# Use debugger
# gem 'debugger', group: [:development, :test]

最后是我的database.yml

# SQLite version 3.x
#   gem install sqlite3
#
#   Ensure the SQLite 3 gem is defined in your Gemfile
#   gem 'sqlite3'
development:
  adapter: sqlite3
  database: db/development.sqlite3
  pool: 5
  timeout: 5000

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
  adapter: sqlite3
  database: db/test.sqlite3
  pool: 5
  timeout: 5000

production:
  adapter: postgresql
  database: social_pantry
  pool: 5
  timeout: 5000

1 个答案:

答案 0 :(得分:1)

看起来像是在尝试在不是rails项目的目录上执行rails server命令。在配置中设置正确的应用程序路径。