1

这对我来说似乎很奇怪。我刚刚将我的 rails api 从 rails 3.2 升级到 rails 4.0.0.rc1。

所有测试都在本地通过,并且在本地生产模式下也可以正常运行。

但是,当我部署到 Heroku 时,日志显示应用程序无法启动。奇怪的是,在日志显示 rails server 命令后,它们会显示输出,就好像我输入了“rails new -h”一样。

她是我的小应用的 github 。这是我的heroku日志:

› heroku logs  
2013-05-24T20:37:18.023853+00:00 heroku[web.1]: State changed from crashed to starting
2013-05-24T20:37:20.904692+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 39526 -e production`
2013-05-24T20:37:21.886451+00:00 app[web.1]: Options:
2013-05-24T20:37:21.886451+00:00 app[web.1]: Usage:
2013-05-24T20:37:21.886451+00:00 app[web.1]:   rails new APP_PATH [options]
2013-05-24T20:37:21.888820+00:00 app[web.1]:   -m, [--template=TEMPLATE]      # Path to some application template (can be a filesystem path or URL)
2013-05-24T20:37:21.888820+00:00 app[web.1]:                                  # Default: /app/vendor/ruby-2.0.0/bin/ruby
2013-05-24T20:37:21.888820+00:00 app[web.1]:       [--skip-gemfile]           # Don't create a Gemfile
2013-05-24T20:37:21.888820+00:00 app[web.1]:   -O, [--skip-active-record]     # Skip Active Record files
2013-05-24T20:37:21.888820+00:00 app[web.1]:   -G, [--skip-git]               # Skip .gitignore file
2013-05-24T20:37:21.889145+00:00 app[web.1]:                                  # Default: jquery
2013-05-24T20:37:21.888820+00:00 app[web.1]:   -B, [--skip-bundle]            # Don't run bundle install
2013-05-24T20:37:21.888820+00:00 app[web.1]:       [--skip-keeps]             # Skip source control .keep files
2013-05-24T20:37:21.889145+00:00 app[web.1]:   -J, [--skip-javascript]        # Skip JavaScript files
2013-05-24T20:37:21.888820+00:00 app[web.1]:   -S, [--skip-sprockets]         # Skip Sprockets files
2013-05-24T20:37:21.889145+00:00 app[web.1]:   -j, [--javascript=JAVASCRIPT]  # Preconfigure for selected JavaScript library
2013-05-24T20:37:21.888820+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-05-24T20:37:21.889145+00:00 app[web.1]:                                  # Default: sqlite3
2013-05-24T20:37:21.886451+00:00 app[web.1]:
2013-05-24T20:37:21.889145+00:00 app[web.1]:       [--dev]                    # Setup the application with Gemfile pointing to your Rails checkout
2013-05-24T20:37:21.889145+00:00 app[web.1]:       [--edge]                   # Setup the application with Gemfile pointing to Rails repository
2013-05-24T20:37:21.889145+00:00 app[web.1]:   -T, [--skip-test-unit]         # Skip Test::Unit files
2013-05-24T20:37:21.889145+00:00 app[web.1]:       [--rc=RC]                  # Path to file containing extra configuration options for rails command
2013-05-24T20:37:21.889145+00:00 app[web.1]:       [--no-rc]                  # Skip loading of extra configuration options from .railsrc file
2013-05-24T20:37:21.889398+00:00 app[web.1]: Runtime options:
2013-05-24T20:37:21.889398+00:00 app[web.1]:   -f, [--force]    # Overwrite files that already exist
2013-05-24T20:37:21.889145+00:00 app[web.1]:
2013-05-24T20:37:21.889398+00:00 app[web.1]:   -p, [--pretend]  # Run but do not make any changes
2013-05-24T20:37:21.889398+00:00 app[web.1]:   -q, [--quiet]    # Suppress status output
2013-05-24T20:37:21.888820+00:00 app[web.1]:   -r, [--ruby=PATH]              # Path to the Ruby binary of your choice
2013-05-24T20:37:21.889398+00:00 app[web.1]:   -s, [--skip]     # Skip
 files that already exist
2013-05-24T20:37:21.889398+00:00 app[web.1]: Rails options:
2013-05-24T20:37:21.889398+00:00 app[web.1]:
2013-05-24T20:37:21.889398+00:00 app[web.1]:
2013-05-24T20:37:21.889398+00:00 app[web.1]:   -h, [--help]     # Show this help message and quit
2013-05-24T20:37:21.889398+00:00 app[web.1]:   -v, [--version]  # Show Rails version number and quit
2013-05-24T20:37:21.889654+00:00 app[web.1]:     directory structure and configuration at the path you specify.
2013-05-24T20:37:21.889654+00:00 app[web.1]:
2013-05-24T20:37:21.889654+00:00 app[web.1]:     The 'rails new' command creates a new Rails application with a default
2013-05-24T20:37:21.889654+00:00 app[web.1]: Description:
2013-05-24T20:37:21.889654+00:00 app[web.1]:     You can specify extra command-line arguments to be used every time
2013-05-24T20:37:21.889654+00:00 app[web.1]:     'rails new' runs in the .railsrc configuration file in your home directory.
2013-05-24T20:37:21.889654+00:00 app[web.1]:     Note that the arguments specified in the .railsrc file don't affect the
2013-05-24T20:37:21.889898+00:00 app[web.1]: Example:
2013-05-24T20:37:21.889654+00:00 app[web.1]:
2013-05-24T20:37:21.889654+00:00 app[web.1]:
2013-05-24T20:37:21.889898+00:00 app[web.1]:
2013-05-24T20:37:21.889654+00:00 app[web.1]:     defaults values shown above in this help message.
2013-05-24T20:37:21.889898+00:00 app[web.1]:     This generates a skeletal Rails installation in ~/Code/Ruby/weblog.
2013-05-24T20:37:21.889898+00:00 app[web.1]:     See the README in the newly created application to get going.
2013-05-24T20:37:21.889898+00:00 app[web.1]:     rails new ~/Code/Ruby/weblog
2013-05-24T20:37:29.907618+00:00 heroku[web.1]: Process exited with status 0
2013-05-24T20:37:29.918034+00:00 heroku[web.1]: State changed from starting to crashed
4

1 回答 1

1

解决了,感谢 #RubyOnRails irc 频道上的 drale2k,他向我指出了这篇文章

本质上,您需要一个 Procfile(我没有,并且在 Rails 3.2 上运行时也不需要)。

于 2013-05-24T21:08:08.833 回答