2015-01-16 3 views
1

내 Sinatra 앱이 sqlite로 로컬 설치시 정상적으로 작동했습니다. Heroku가 이동했을 때, 나는 이상한 오류를했다, 그래서 나도 내 로컬 응용 프로그램에서 포스트 그레스로 전환, 나는 이러한 오류를 받고 있어요 : IRB에서 모델을로드 할 때Postgres로 전환 한 후 앱 작동이 중지되었습니다.

dyld: lazy symbol binding failed: Symbol not found: _rb_thread_select 
    Referenced from: /Users/Emanuele/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-14/2.2.0-static/do_postgres-0.10.14/do_postgres/do_postgres.bundle 
    Expected in: flat namespace 

dyld: Symbol not found: _rb_thread_select 
    Referenced from: /Users/Emanuele/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-14/2.2.0-static/do_postgres-0.10.14/do_postgres/do_postgres.bundle 
    Expected in: flat namespace 

마찬가지입니다.

require 'data_mapper' 
require 'dm-types' 
require 'dm-validations' 
require 'dm-postgres-adapter' 
require 'bcrypt' 

# Setup DataMapper with a database URL. Will use ENV['DATABASE_URL'] on Heroku. 
DataMapper.setup(:default, 'postgres://localhost/myapp') 

# Let's define the model 
class User 
    include DataMapper::Resource 
    include BCrypt 

    property :id, Serial, :key => true 
    property :email, String, :length => 5..70, :unique => true, :required => true, :format => :email_address 
    property :password, BCryptHash 
    property :account_sid, String, :length => 34 
    property :auth_token, String, :length => 32 
    property :app_sid, String, :length => 34 

    def authenticate(attempted_password) 
    if self.password == attempted_password 
     true 
    else 
     false 
    end 
    end 

end 

# Finalize the DataMapper model. 
DataMapper.finalize 

# Tell DataMapper to update the database according to the definitions above. 
DataMapper.auto_upgrade! 

내가 앱이 다시 작동하기 시작 sqlite3를 다시 전환 :

여기 내 모델 파일입니다. 나는 그 오류를 찾아 낼 수 없다. 온라인으로 검색 한 결과가 없습니다.

아무도 무슨 일이 일어나고 있으며 어떻게 고칠 수 있고 Heroku에서 내 앱을 게시 할 수 있는지에 대한 아이디어가 있습니까?

자세한 정보가 필요하면 문의하십시오.

감사합니다.

+0

Mac에 있습니까? –

+0

예, Mac에 있지만 Ruby 2.2.0과 같은 것으로 보입니다. 2.1.5로 다시 전환하면 문제가 해결되었습니다. 그림을 이동. –

답변

1

2.2.0에서 Ruby 2.1.5로 다시 전환하는 것처럼 보입니다. 문제는 로컬 및 Heroku에서 모두 해결되었습니다. 어떤 일이 잘못되었는지 파악하십시오.

경험 많은 개발자가 버그를 추적하고 일부 정보를 제공해야하는 경우 질문하십시오.

1

pg 보석의 이전 버전은 Ruby 2.2와 호환되지 않습니다. 최신 버전으로 업데이트하려고합니다. 업데이트 지침을 포함하여 자세한 내용은 my answer to a similar question을 참조하십시오.

+0

브렌트 미안하지만 나는 이미 보석을 업데이트했다. 사실 나는 다시 시도하고 내가'Using Pg 0.18.1'인지 확인했지만 오류는 지속됩니다. 다시 2.1.5로 돌아갑니다. 추가 세부 정보가 있으면 제공하십시오. 성능 향상에 대해 읽은 2.2.0을 사용하고 싶습니다. –

+0

데이터 포인트로서 필자도이 문제를 겪었습니다 (필자는 0.14.0 보석을 가지고 있었고 새로 Ruby 2.2로 업그레이드했습니다). 그리고 pg 보석을 0.18.1로 업데이트하여 저를 고쳤습니다. –