2014-02-12 32 views
0

寶石文件:PG :: StringDataRightTruncation:ERROR:值太長類型字符改變(255)

gem "oauth2" 
gem "omniauth-gmail" 
gem 'omniauth-facebook' 
gem "omniauth-google-oauth2" 

我在Ruby on Rails的是新的。我後來成功註冊了facebook,但是當我嘗試註冊gmail時,我得到了以下PG錯誤。

請給我任何建議,我也將地址的數據類型從字符串更改爲文本,但沒有得到結果。


ActiveRecord::StatementInvalid at /users PG::StringDataRightTruncation: ERROR: value too long for type character varying(255) : INSERT INTO "users" ("address", "city", "confirmation_sent_at", "confirmation_token", "confirmed_at", "country", "created_at", "current_sign_in_at", "current_sign_in_ip", "email", "encrypted_password", "facebookimage", "image", "last_sign_in_at", "last_sign_in_ip", "latitude", "longitude", "membership", "provider", "remember_created_at", "reset_password_sent_at", "reset_password_token", "sign_in_count", "state", "uid", "unconfirmed_email", "updated_at", "username", "zip") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28, $29) RETURNING "id" Application Frames All Frames rescue in log activerecord (3.2.12) lib/active_record/connection_adapters/abstract_adapter.rb, line 285


+0

這個答案可能有幫助:http://stackoverflow.com/questions/17920028/pgstringdatarighttruncation-error-postgresql-string255-limit-heroku – DiegoSalazar

回答

3

領域應該是:text型的,而不是在遷移文件:string

+1

哪個字段?有沒有可能告訴? – Trip

0

這可通過在遠程服務器一個過時的遷移測試分貝引起。

嘗試:

rake db:migrate db:test:prepare 

,然後再次運行遷移。

相關問題