【发布时间】:2014-07-06 00:45:14
【问题描述】:
我不久前注册了一个月 Rails 计划,现在才开始着手。我已经安装了 Rails,设置了 GitHub 和 Heroku。一切似乎都运行良好,Rails 测试应用程序在我的本地服务器上运行,我在推送到 Heroku 时没有收到任何错误,但我不断收到“您要查找的页面不存在”。
我尝试添加根路由、安装“pg”gem、运行 rake db:migrate 等。此时我决定删除整个 Ruby 项目,重新开始并重新安装“pg”gem .
我的 Gemfile 如下所示: 源'https://rubygems.org'
gem 'rails', '4.1.4'
group :production do
gem 'pg'
end
group :development, :test do
gem 'sqlite3'
end
gem 'sass-rails', '~> 4.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'spring', group: :development
我的 Heroku 日志如下所示:
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.0.0
-----> Installing dependencies using 1.6.3
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
Using json 1.8.1
Using minitest 5.3.5
Using thread_safe 0.3.4
Using builder 3.2.2
Using i18n 0.6.9
Using erubis 2.7.0
Using rake 10.3.2
Using rack 1.5.2
Using mime-types 1.25.1
Using polyglot 0.3.5
Using arel 5.0.1.20140414130214
Using coffee-script-source 1.7.0
Using execjs 2.2.1
Using thor 0.19.1
Using hike 1.2.3
Using pg 0.17.1
Using multi_json 1.10.1
Using bundler 1.6.3
Using tilt 1.4.1
Using sass 3.2.19
Using rdoc 4.1.1
Using tzinfo 1.2.1
Using treetop 1.4.15
Using rack-test 0.6.2
Using coffee-script 2.2.0
Using uglifier 2.5.1
Using sdoc 0.4.0
Using activesupport 4.1.4
Using mail 2.5.4
Using actionview 4.1.4
Using activemodel 4.1.4
Using jbuilder 2.1.1
Using actionpack 4.1.4
Using railties 4.1.4
Using actionmailer 4.1.4
Using activerecord 4.1.4
Using sprockets 2.11.0
Using coffee-rails 4.0.1
Using jquery-rails 3.1.1
Using sprockets-rails 2.1.3
Using turbolinks 2.2.2
Using rails 4.1.4
Using sass-rails 4.0.3
Your bundle is complete!
Gems in the groups development and test were not installed.
It was installed into ./vendor/bundle
Bundle completed (0.61s)
Cleaning up the bundler cache.
-----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
Asset precompilation completed (2.01s)
Cleaning assets
Running: rake assets:clean
-----> WARNINGS:
Include 'rails_12factor' gem to enable all platform features
See https://devcenter.heroku.com/articles/rails-integration-gems for more information.
You have not declared a Ruby version in your Gemfile.
To set your Ruby version add this line to your Gemfile:
ruby '2.0.0'
# See https://devcenter.heroku.com/articles/ruby-versions for more information.
No Procfile detected, using the default web server (webrick)
https://devcenter.heroku.com/articles/ruby-default-web-server
-----> Discovering process types
Procfile declares types -> (none)
Default types for Ruby -> console, rake, web, worker
-----> Compressing... done, 21.2MB
-----> Launching... done, v7
http://immense-lake-7186.herokuapp.com/ deployed to Heroku
任何帮助将不胜感激!谢谢!
【问题讨论】:
-
日志是否继续显示服务器正在启动?如果没有,请尝试
heroku restart并检查日志中的错误消息。 -
您是否也对devcenter.heroku.com/articles/getting-started-with-rails4(包括
database.yml)进行了所有所需的更改?
标签: ruby-on-rails ruby heroku