我在開發過程中(本地)使用了過去的Rails 3.0.9使用Heroku。使用sqlite3在本地設置Rails 3.2.2應用程序
的database.yml
development:
adapter: sqlite3
database: /db/development.sqlite3
pool: 5
timeout: 5000
工作流程如下:
- $ git的初始化
- $添加。
- $ git的承諾-m 「初始提交」
- $ Heroku的創建
- $混帳推Heroku的主
- $ Heroku的耙分貝:遷移
...我被關到了比賽,沒問題。
快進到今天使用Rails 3.2.2。新的非常基本的腳手架應用程序,相同的數據庫yml文件,相同的工作流程。當使用localhost:3000 /地址時,地址索引沒有問題。然而,使用相同的工作流程和步驟6,Heroku的耙分貝:遷移,並出現以下錯誤消息中止耙:
rake aborted!
Please install the postgresql adapter: `gem install activerecord-postgresql-adapter` (pg is not part of the bundle. Add it to Gemfile.)
所以我改變了我的Gemfile以下幾點:
group :Development, :test do
gem 'sqlite3', '1.3.5'
end
group :Production do
gem 'pg', '0.13.2'
end
然後我做了一個軟件包安裝,通過git add提交了我的更改。和git commit -m「添加pg」,並通過git push heroku master推送到heroku。接下來,我嘗試使用heroku rake db:migrate並遷移表。但是,當瀏覽到應用程序時,默認索引頁面工作,但是,在嘗試HerokuInstanceName/addresses路由時,我得到的並不是那麼有用的錯誤:「我們很抱歉,但出錯了。」
道歉的漫長解釋,任何想法?
* EDIT2: *我錯過了類型爲/地址第一條路線,這裏是當我真正放在正確的路由/地址日誌文件:
編輯:增加了Heroku的日誌文件:
2012-04-03T22:05:41+00:00 app[web.1]: thin (1.2.6) lib/thin/runner.rb:177:in `run_command'
2012-04-03T22:05:41+00:00 app[web.1]:
2012-04-03T22:05:41+00:00 app[web.1]: thin (1.2.6) lib/thin/runner.rb:143:in `run!'
2012-04-03T22:05:41+00:00 app[web.1]:
2012-04-03T22:05:41+00:00 app[web.1]: /usr/ruby1.9.2/bin/thin:19:in `<main>'
2012-04-03T22:05:41+00:00 app[web.1]: /usr/ruby1.9.2/bin/thin:19:in `load'
2012-04-03T22:05:41+00:00 app[web.1]: cache: [GET /address] miss
2012-04-03T22:05:41+00:00 heroku[router]: GET falling-window-3630.heroku.com/address dyno=web.1 queue=0 wait=0ms service=13ms status=404 bytes=728
2012-04-03T22:05:41+00:00 heroku[nginx]: 86.163.131.200 - - [03/Apr/2012:22:05:41 +0000] "GET /address HTTP/1.1" 404 728 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20100101 Firefox/11.0" falling-window-3630.heroku.com
2012-04-03T22:05:41+00:00 app[web.1]: cache: [GET /favicon.ico] miss
2012-04-03T22:05:41+00:00 heroku[router]: GET falling-window-3630.heroku.com/favicon.ico dyno=web.1 queue=0 wait=0ms service=7ms status=200 bytes=0
2012-04-03T22:05:41+00:00 heroku[nginx]: 86.163.131.200 - - [03/Apr/2012:22:05:41 +0000] "GET /favicon.ico HTTP/1.1" 200 0 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20100101 Firefox/11.0" falling-window-3630.heroku.com
2012-04-03T22:05:45+00:00 app[web.1]:
2012-04-03T22:05:45+00:00 app[web.1]:
2012-04-03T22:05:45+00:00 app[web.1]: Started GET "/addresses" for 86.163.131.200 at 2012-04-03 15:05:45 -0700
2012-04-03T22:05:45+00:00 app[web.1]: Processing by AddressesController#index as HTML
2012-04-03T22:05:45+00:00 app[web.1]: Rendered addresses/index.html.erb within layouts/application (15.0ms)
2012-04-03T22:05:45+00:00 app[web.1]: Completed 500 Internal Server Error in 91ms
2012-04-03T22:05:45+00:00 app[web.1]:
2012-04-03T22:05:45+00:00 app[web.1]: ActionView::Template::Error (application.css isn't precompiled):
2012-04-03T22:05:45+00:00 app[web.1]: 2: <html>
2012-04-03T22:05:45+00:00 app[web.1]: 3: <head>
2012-04-03T22:05:45+00:00 app[web.1]: app/views/layouts/application.html.erb:5:in `_app_views_layouts_application_html_erb___2192528381921801676_29536600'
2012-04-03T22:05:45+00:00 app[web.1]: 7: <%= csrf_meta_tags %>
2012-04-03T22:05:45+00:00 app[web.1]: 8: </head>
2012-04-03T22:05:45+00:00 app[web.1]: app/controllers/addresses_controller.rb:7:in `index'
2012-04-03T22:05:45+00:00 app[web.1]:
2012-04-03T22:05:45+00:00 app[web.1]: 6: <%= javascript_include_tag "application" %>
2012-04-03T22:05:45+00:00 app[web.1]: 5: <%= stylesheet_link_tag "application", :media => "all" %>
2012-04-03T22:05:45+00:00 app[web.1]: 4: <title>HavenCollect2</title>
2012-04-03T22:05:45+00:00 app[web.1]:
2012-04-03T22:05:45+00:00 app[web.1]: cache: [GET /addresses] miss
2012-04-03T22:05:45+00:00 heroku[router]: GET falling-window-3630.heroku.com/addresses dyno=web.1 queue=0 wait=0ms service=145ms status=500 bytes=643
2012-04-03T22:05:45+00:00 heroku[nginx]: 86.163.131.200 - - [03/Apr/2012:22:05:45 +0000] "GET /addresses HTTP/1.1" 500 643 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20100101 Firefox/11.0" falling-window-3630.heroku.com
2012-04-03T22:32:50+00:00 app[web.1]:
2012-04-03T22:32:50+00:00 app[web.1]:
2012-04-03T22:32:50+00:00 app[web.1]: Started GET "/addresses" for [local ip address] at 2012-04-03 15:32:50 -0700
2012-04-03T22:32:50+00:00 app[web.1]: Processing by AddressesController#index as HTML
2012-04-03T22:32:50+00:00 app[web.1]: Rendered addresses/index.html.erb within layouts/application (0.3ms)
2012-04-03T22:32:50+00:00 app[web.1]: Completed 500 Internal Server Error in 4ms
2012-04-03T22:32:50+00:00 app[web.1]:
2012-04-03T22:32:50+00:00 app[web.1]: ActionView::Template::Error (application.css isn't precompiled):
2012-04-03T22:32:50+00:00 app[web.1]: 3: <head>
2012-04-03T22:32:50+00:00 app[web.1]: 4: <title>HavenCollect2</title>
2012-04-03T22:32:50+00:00 app[web.1]: 2: <html>
2012-04-03T22:32:50+00:00 app[web.1]: 5: <%= stylesheet_link_tag "application", :media => "all" %>
2012-04-03T22:32:50+00:00 app[web.1]: 6: <%= javascript_include_tag "application" %>
2012-04-03T22:32:50+00:00 app[web.1]: 7: <%= csrf_meta_tags %>
2012-04-03T22:32:50+00:00 app[web.1]: 8: </head>
2012-04-03T22:32:50+00:00 app[web.1]:
2012-04-03T22:32:50+00:00 app[web.1]: app/views/layouts/application.html.erb:5:in `_app_views_layouts_application_html_erb___2192528381921801676_29536600'
2012-04-03T22:32:50+00:00 app[web.1]: app/controllers/addresses_controller.rb:7:in `index'
2012-04-03T22:32:50+00:00 app[web.1]: cache: [GET /addresses] miss
2012-04-03T22:32:50+00:00 app[web.1]:
2012-04-03T22:32:50+00:00 heroku[router]: GET falling-window-3630.heroku.com/addresses dyno=web.1 queue=0 wait=0ms service=14ms status=500 bytes=643
2012-04-03T22:32:50+00:00 heroku[nginx]: [local ip address] - - [03/Apr/2012:22:32:50 +0000] "GET /addresses HTTP/1.1" 500 643 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_7) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.142 Safari/535.19" falling-window-3630.heroku.com
2012-04-03T22:32:56+00:00 app[web.1]:
2012-04-03T22:32:56+00:00 app[web.1]:
2012-04-03T22:32:56+00:00 app[web.1]: Processing by AddressesController#index as HTML
2012-04-03T22:32:56+00:00 app[web.1]: Started GET "/addresses" for [local ip address] at 2012-04-03 15:32:56 -0700
2012-04-03T22:32:56+00:00 heroku[router]: GET falling-window-3630.heroku.com/addresses dyno=web.1 queue=0 wait=0ms service=15ms status=500 bytes=643
2012-04-03T22:32:56+00:00 app[web.1]: 3: <head>
2012-04-03T22:32:56+00:00 app[web.1]: Completed 500 Internal Server Error in 3ms
2012-04-03T22:32:56+00:00 app[web.1]: 4: <title>HavenCollect2</title>
2012-04-03T22:32:56+00:00 app[web.1]: ActionView::Template::Error (application.css isn't precompiled):
2012-04-03T22:32:56+00:00 app[web.1]:
2012-04-03T22:32:56+00:00 app[web.1]: 5: <%= stylesheet_link_tag "application", :media => "all" %>
2012-04-03T22:32:56+00:00 app[web.1]: 6: <%= javascript_include_tag "application" %>
2012-04-03T22:32:56+00:00 app[web.1]: 2: <html>
2012-04-03T22:32:56+00:00 app[web.1]: Rendered addresses/index.html.erb within layouts/application (0.3ms)
2012-04-03T22:32:56+00:00 heroku[nginx]: [local ip address] - - [03/Apr/2012:22:32:56 +0000] "GET /addresses HTTP/1.1" 500 643 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_7) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.142 Safari/535.19" falling-window-3630.heroku.com
2012-04-03T22:32:56+00:00 app[web.1]: 7: <%= csrf_meta_tags %>
2012-04-03T22:32:56+00:00 app[web.1]: 8: </head>
2012-04-03T22:32:56+00:00 app[web.1]: app/views/layouts/application.html.erb:5:in `_app_views_layouts_application_html_erb___2192528381921801676_29536600'
2012-04-03T22:32:56+00:00 app[web.1]: app/controllers/addresses_controller.rb:7:in `index'
2012-04-03T22:32:56+00:00 app[web.1]: cache: [GET /addresses] miss
2012-04-03T22:32:56+00:00 app[web.1]:
2012-04-03T22:32:56+00:00 app[web.1]:
2012-04-03T22:32:59+00:00 app[web.1]:
2012-04-03T22:32:59+00:00 app[web.1]:
2012-04-03T22:32:59+00:00 app[web.1]: Started GET "/addresses" for [local ip address] at 2012-04-03 15:32:59 -0700
2012-04-03T22:32:59+00:00 app[web.1]: Processing by AddressesController#index as HTML
2012-04-03T22:32:59+00:00 app[web.1]: Rendered addresses/index.html.erb within layouts/application (0.3ms)
2012-04-03T22:32:59+00:00 app[web.1]: Completed 500 Internal Server Error in 3ms
2012-04-03T22:32:59+00:00 app[web.1]: ActionView::Template::Error (application.css isn't precompiled):
2012-04-03T22:32:59+00:00 app[web.1]: 2: <html>
2012-04-03T22:32:59+00:00 app[web.1]:
2012-04-03T22:32:59+00:00 app[web.1]: 3: <head>
2012-04-03T22:32:59+00:00 app[web.1]: 4: <title>HavenCollect2</title>
2012-04-03T22:32:59+00:00 app[web.1]: 5: <%= stylesheet_link_tag "application", :media => "all" %>
2012-04-03T22:32:59+00:00 app[web.1]: 6: <%= javascript_include_tag "application" %>
2012-04-03T22:32:59+00:00 app[web.1]: 8: </head>
2012-04-03T22:32:59+00:00 app[web.1]: 7: <%= csrf_meta_tags %>
2012-04-03T22:32:59+00:00 app[web.1]: app/views/layouts/application.html.erb:5:in `_app_views_layouts_application_html_erb___2192528381921801676_29536600'
2012-04-03T22:32:59+00:00 app[web.1]: app/controllers/addresses_controller.rb:7:in `index'
2012-04-03T22:32:59+00:00 app[web.1]:
2012-04-03T22:32:59+00:00 app[web.1]:
2012-04-03T22:32:59+00:00 app[web.1]: cache: [GET /addresses] miss
2012-04-03T22:32:59+00:00 heroku[router]: GET falling-window-3630.heroku.com/addresses dyno=web.1 queue=0 wait=0ms service=11ms status=500 bytes=643
2012-04-03T22:32:59 + 00:00的Heroku [nginx的]:[本地IP地址] - - [03 /月/ 2012:22:32:59 0000]「GET /地址HTTP/1.1「500 643」 - 「」Mozilla/5.0(Macintosh; Intel Mac OS X 10_6_7)AppleWebKit/535.19(KHTML,如Gecko)Chrome/18.0.1025.142 Safari/535.19「falling-wi ndow-3630.heroku.com
- 刪除第一個日誌文件
試圖訪問同一頁面,你會得到錯誤頁面後,轉到您的控制檯,然後輸入'的Heroku logs'。有什麼問題? – Ashitaka 2012-04-03 19:31:32
我添加了日誌文件,但沒有看到任何提供線索的東西。 – JohnGalt 2012-04-03 21:47:01
好吧,看起來你有路由錯誤。 'ActionController :: RoutingError(沒有路由匹配[GET]「/地址」):' – Ashitaka 2012-04-03 22:18:37