[RoR ] 佈署到heroku發生錯誤
這幾天做了個縮網址的網站當第一次的作品,想要佈署到heroku上
我是按照OpenFoundry裡的佈署教學作的,不過到了git push heroku master出錯
在這之前,我有在rails的資料夾裡作本地端的repository並git commit
部份錯誤訊息如下:
-------------------------------錯誤訊息-----------------------------------
An error occurred while installing sqlite3 (1.3.8), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.3.8'` succeeds before bundling.
!
! Failed to install gems via Bundler.
!
! Detected sqlite3 gem which is not supported on Heroku.
! https://devcenter.heroku.com/articles/sqlite3
!
! Push rejected, failed to compile Ruby app
To git@heroku.com:anyshort.git
! [remote rejected] master -> master (pre-receive hook declined)
---------------------------------------------------------------------------
下面是我試著修正的步驟:
1. 按照第二行,嘗試gem install sqlite3 -v '1.3.8',然後git push
-> 錯誤訊息一樣,失敗
2.google第一行錯誤訊息,在stackoverflow找到有人提供解法為在Gemfile裡新增
group :production do
gem 'pg'
end
group :development, :test do
gem 'sqlite3'
end
新增完存檔,bundle install,最後在git push --> 錯誤訊息一樣,失敗
3.嘗試先gem install pg,安裝成功後bundle install --> 失敗
4.google找到說要先sudo apt-get install libpq-dev,安裝成功。再來gem install pg
成功。bundle install成功。最後git push --> 錯誤訊息一樣,失敗
5.試著將Gemfile裡的gem 'sqlite3'刪掉再git push --> 錯誤訊息一樣,失敗
作到這邊我已經不知道該怎麼解決了,所以來這版想問問版友,有沒有解決方法,謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 123.195.5.93
→
11/23 00:03, , 1F
11/23 00:03, 1F
→
11/23 00:12, , 2F
11/23 00:12, 2F
→
11/23 00:12, , 3F
11/23 00:12, 3F
→
11/23 22:34, , 4F
11/23 22:34, 4F
推
11/24 15:32, , 5F
11/24 15:32, 5F
→
11/24 15:34, , 6F
11/24 15:34, 6F
→
11/24 15:36, , 7F
11/24 15:36, 7F
推
12/19 20:14, , 8F
12/19 20:14, 8F
→
12/19 20:14, , 9F
12/19 20:14, 9F
→
12/19 20:15, , 10F
12/19 20:15, 10F
→
12/19 20:15, , 11F
12/19 20:15, 11F
→
12/19 20:17, , 12F
12/19 20:17, 12F
→
12/28 11:28, , 13F
12/28 11:28, 13F
Ruby 近期熱門文章
PTT數位生活區 即時熱門文章