ฉันมีแอปพลิเคชัน Rails พื้นฐานที่ทำงานบนเดสก์ท็อป Windows 8 ของฉัน (rails_12factor, ruby 1.9.3, rails 4, postgres) - โดยใช้ rails server
- ฉันสามารถนำทางไปยังเว็บไซต์แอปพลิเคชันบนเบราว์เซอร์ในเครื่องของฉันได้ และทุกอย่างก็แสดงผลได้ดี
ฉันผลักดันแอปพลิเคชันไปที่ heroku ผ่าน git push heroku master
และทุกอย่างดูเหมือนจะเป็นไปด้วยดี คำเตือนเดียวที่ฉันเห็นคือ "กำลังลบ Gemfile.lock
เนื่องจากสร้างขึ้นบน Windows" กระบวนการสิ้นสุดด้วยข้อความต่อไปนี้ - "กำลังเปิดตัว... เสร็จสิ้น v9"
อย่างไรก็ตามเมื่อรัน "heroku ps" ฉันได้รับสิ่งต่อไปนี้:
=== เว็บ (1X): bin/rails server -p $PORT -e $RAILS_ENV
web.1: ขัดข้อง 2013/07/12 00:42:20 (~ 4s ที่แล้ว)
ในการทำบันทึก heroku --tail ฉันพบสิ่งต่อไปนี้ซ้ำในไฟล์บันทึก - :
heroku[web.1]: Starting process with command `bin/rails server -p 16041 -e $RAILS_ENV`
app[web.1]: /usr/bin/env: ruby.exe: No such file or directory
heroku[web.1]: Process exited with status 127
heroku[web.1]: State changed from starting to crashed
heroku[web.1]: Error R99 (Platform error) -> Failed to launch the dyno within 10 seconds
heroku[web.1]: Stopping process with SIGKILL
...
heroku[web.1]: Process exited with status 127
heroku[web.1]: Error R99 (Platform error) -> Failed to launch the dyno within 10 seconds
ฉันเห็นสิ่งต่าง ๆ บนเว็บที่ให้ฉันตรวจสอบ .gitignore เพื่อดูว่าเนื้อหาของโฟลเดอร์ bin ในเครื่องของฉันถูกแยกออกหรือไม่ พวกเขาจะไม่. ฉันยังเห็นคำแนะนำให้แก้ไขเนื้อหาของโฟลเดอร์ bin และลบคำว่า .exe หลังจาก ruby - ฉันก็ลองเช่นกัน
แก้ไข 1: โครงการของฉันมีโฟลเดอร์ย่อยที่มีไฟล์ 3 ชุดรางและคราด นี่เป็นไฟล์เดียวที่ขึ้นต้นด้วย #!/usr/bin/env ruby ฉันยังแก้ไขบรรทัดแรกเพื่ออ่าน #!/usr/bin/env ruby*.exe* - ยังคงเห็นข้อผิดพลาดอยู่ นี่คือเนื้อหาของแต่ละไฟล์:
มัด
#!/usr/bin/env ruby
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
load Gem.bin_path('bundler', 'bundle')
ราง
#!/usr/bin/env ruby
APP_PATH = File.expand_path('../../config/application', __FILE__)
require_relative '../config/boot'
require 'rails/commands'
คราด
#!/usr/bin/env ruby
require_relative '../config/boot'
require 'rake'
Rake.application.run