2012-07-05 25 views
12

Vì vậy, ứng dụng của tôi chạy hoàn toàn trên máy cục bộ của tôi và tôi đẩy nó vào github và heroku thành công nhưng khi tôi thử mở ứng dụng trong trình duyệt của mình, tôi nhận được lỗi sau:"bundler: lệnh không tìm thấy: mỏng" đường dẫn triển khai heroku

Application Error 
An error occurred in the application and your page could not be served. Please try again in a few moments. 

If you are the application owner, check your logs for details. 

sau đó, tôi cố gắng chạy

$ heroku logs 

Và tôi nhận được đầu ra sau trong giao diện điều khiển của tôi:

2012-07-05T21:52:11+00:00 heroku[slugc]: Slug compilation started 
2012-07-05T21:52:33+00:00 heroku[slugc]: Slug compilation failed: failed to compile Ruby/rails app 
2012-07-05T21:53:33+00:00 heroku[slugc]: Slug compilation started 
2012-07-05T21:53:55+00:00 heroku[slugc]: Slug compilation failed: failed to compile Ruby/rails app 
2012-07-05T21:58:45+00:00 heroku[slugc]: Slug compilation started 
2012-07-05T21:59:04+00:00 heroku[slugc]: Slug compilation failed: failed to compile Ruby/rails app 
2012-07-05T22:00:34+00:00 heroku[slugc]: Slug compilation started 
2012-07-05T22:01:21+00:00 heroku[api]: Add shared-database:5mb add-on by [email protected] 
2012-07-05T22:01:21+00:00 heroku[api]: Release v2 created by [email protected] 
2012-07-05T22:01:21+00:00 heroku[api]: Add RAILS_ENV, LANG, PATH, RACK_ENV, GEM_PATH config by [email protected] 
2012-07-05T22:01:21+00:00 heroku[api]: Release v3 created by [email protected] 
2012-07-05T22:01:23+00:00 heroku[api]: Release v4 created by [email protected] 
2012-07-05T22:01:23+00:00 heroku[api]: Deploy 23effb5 by [email protected] 
2012-07-05T22:01:24+00:00 heroku[slugc]: Slug compilation finished 
2012-07-05T22:01:27+00:00 heroku[web.1]: Starting process with command `bundle exec thin start -R config.ru -e production -p 4606` 
2012-07-05T22:01:30+00:00 app[web.1]: bundler: command not found: thin 
2012-07-05T22:01:30+00:00 app[web.1]: Install missing gem executables with `bundle install` 
2012-07-05T22:01:31+00:00 heroku[web.1]: Process exited with status 127 
2012-07-05T22:01:31+00:00 heroku[web.1]: State changed from starting to crashed 
2012-07-05T22:01:31+00:00 heroku[web.1]: State changed from crashed to starting 
2012-07-05T22:01:34+00:00 heroku[web.1]: Starting process with command `bundle exec thin start -R config.ru -e production -p 16779` 
2012-07-05T22:01:35+00:00 app[web.1]: bundler: command not found: thin 
2012-07-05T22:01:35+00:00 app[web.1]: Install missing gem executables with `bundle install` 
2012-07-05T22:01:36+00:00 heroku[web.1]: Process exited with status 127 
2012-07-05T22:01:36+00:00 heroku[web.1]: State changed from starting to crashed 
2012-07-05T22:01:37+00:00 heroku[router]: Error H10 (App crashed) -> GET glowing-robot-9319.herokuapp.com/ dyno= queue= wait= service= status=503 bytes= 
2012-07-05T22:01:38+00:00 heroku[router]: Error H10 (App crashed) -> GET glowing-robot-9319.herokuapp.com/favicon.ico dyno= queue= wait= service= status=503 bytes= 
2012-07-05T22:01:49+00:00 heroku[router]: Error H10 (App crashed) -> GET glowing-robot-9319.herokuapp.com/ dyno= queue= wait= service= status=503 bytes= 
2012-07-05T22:01:49+00:00 heroku[router]: Error H10 (App crashed) -> GET glowing-robot-9319.herokuapp.com/favicon.ico dyno= queue= wait= service= status=503 bytes= 
2012-07-05T22:01:50+00:00 heroku[router]: Error H10 (App crashed) -> GET glowing-robot-9319.herokuapp.com/ dyno= queue= wait= service= status=503 bytes= 
2012-07-05T22:01:51+00:00 heroku[router]: Error H10 (App crashed) -> GET glowing-robot-9319.herokuapp.com/favicon.ico dyno= queue= wait= service= status=503 bytes= 
2012-07-05T22:01:51+00:00 heroku[router]: Error H10 (App crashed) -> GET glowing-robot-9319.herokuapp.com/ dyno= queue= wait= service= status=503 bytes= 
2012-07-05T22:01:51+00:00 heroku[router]: Error H10 (App crashed) -> GET glowing-robot-9319.herokuapp.com/favicon.ico dyno= queue= wait= service= status=503 bytes= 

Tôi không thể hình dung được điều này, vì đây là lần đầu tiên tôi triển khai cho heroku và tôi không biết gì về triển khai web. Mọi sự trợ giúp sẽ rất được trân trọng!

+0

Thêm 'gem' pg ' gem' taps'' to ** Gemfile ** và bundle install. Và triển khai mã nó để heroku và khởi động lại máy chủ. –

Trả lời

2

Có thể bạn đang thiếu một viên ngọc trong Gemfile. Hãy chắc chắn rằng tất cả mọi thứ ứng dụng của bạn cần được chỉ định trong Gemfile, trái ngược với cục bộ làm một "gem install". Để xác minh, bạn có thể cài đặt RVM, tạo một tập hợp đặc biệt cho ứng dụng của bạn, chạy "cài đặt nhóm" trong thư mục ứng dụng của bạn và sau đó xem ứng dụng của bạn có chạy cục bộ hay không. Nếu nó không chạy, một viên đá quý chắc chắn là mất tích.

21

Đối với tôi vấn đề là tôi đã thêm mỏng vào Gemfile trong phần phát triển, nhưng một khi tôi đã làm điều đó heroku muốn sử dụng nó để sản xuất, nhưng không cài đặt các đá quý trong phần phát triển. Bằng cách di chuyển viên đá quý mỏng ra khỏi phần phát triển để mọi môi trường sử dụng, tôi đã có thể vượt qua lỗi này.

Gemfile của bạn có thể sẽ giống như thế này cho một ứng dụng Rails:

source 'https://rubygems.org' 

gem 'rails' 
gem 'heroku' 

# Bundle edge Rails instead: 
# gem 'rails', :git => 'git://github.com/rails/rails.git' 

gem 'pg' 
gem 'thin' 

# more gems 

Heroku recommends thin cho một máy chủ web sản xuất anyway.

Cập nhật (2012-05-16): Trong đó Rails 3 máy chủ web liên kết trên Heroku bây giờ recommends unicorn. mỏng sẽ vẫn hoạt động, nhưng bạn có thể muốn xem xét switching over to unicorn.

+0

Cảm ơn mẹo! – wikichen

1

Dường như Heroku đang cố gắng bắt đầu Thin khi không có Procfile để nói cách khác. Như đã nói ở trên, Thin không được cài đặt trong Gemfile, do đó lỗi. Lấy Thin ra khỏi nhóm phát triển sẽ làm việc, như đã nói ở trên.

Nếu bạn muốn nhận được Heroku để bắt đầu Unicorn thay vì mỏng, thiết lập cấu hình của bạn/unicorn.rb và Procfile của bạn như được chỉ ra ở đây: https://devcenter.heroku.com/articles/rails-unicorn

Nội dung Procfile cho Unicorn được liệt kê trong liên kết ở trên, và thông tin thêm về Procfile (chỉ một tệp có tên 'Procfile' trong thư mục gốc của ứng dụng của bạn) tại đây: https://devcenter.heroku.com/articles/procfile

Các vấn đề liên quan