2011-10-25 3 views
2

그래서 내 애플 리케이션을 만들고있어. 모든 테스트가 통과하면 앱이 아름답게 작동합니다. 그런 다음, "rails server"를 다시 실행하려고 시도 할 때 변경하지 않고 분기를 전환하고 다시 전환 한 다음이 오류가 발생합니다. 이런 일이 몇 번 있었는데 이유가 없습니다.레일 서버가 작동을 멈춘다. (내가 믿는 바에 따르면) 분기가 바뀌고있다.

/Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:239:in `require': no such file to load -- bcrypt_ext (LoadError) 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:239:in `block in require' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:225:in `block in load_dependency' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:591:in `new_constants_in' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:225:in `load_dependency' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:239:in `require' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/bcrypt-ruby-3.0.1/lib/bcrypt.rb:12:in `<top (required)>' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:239:in `require' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:239:in `block in require' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:225:in `block in load_dependency' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:591:in `new_constants_in' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:225:in `load_dependency' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:239:in `require' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/devise-1.4.9/lib/devise/models/database_authenticatable.rb:2:in `<top (required)>' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/devise-1.4.9/lib/devise/models.rb:60:in `const_get' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/devise-1.4.9/lib/devise/models.rb:60:in `block (2 levels) in devise' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/devise-1.4.9/lib/devise/models.rb:59:in `each' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/devise-1.4.9/lib/devise/models.rb:59:in `block in devise' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/devise-1.4.9/lib/devise/models.rb:86:in `devise_modules_hook!' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/devise-1.4.9/lib/devise/models.rb:58:in `devise' 
    from /Users/beatjunkie84/Desktop/ProjectX/app/models/user.rb:16:in `<class:User>' 
    from /Users/beatjunkie84/Desktop/ProjectX/app/models/user.rb:13:in `<top (required)>' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:454:in `load' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:454:in `block in load_file' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:591:in `new_constants_in' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:453:in `load_file' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:340:in `require_or_load' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:491:in `load_missing_constant' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:183:in `block in const_missing' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:181:in `each' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:181:in `const_missing' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/rake-0.9.2/lib/rake/ext/module.rb:36:in `const_missing' 
    from /Users/beatjunkie84/Desktop/ProjectX/app/admin/users.rb:1:in `<top (required)>' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:235:in `load' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:235:in `block in load' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:225:in `block in load_dependency' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:591:in `new_constants_in' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:225:in `load_dependency' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:235:in `load' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/activeadmin-0.3.2/lib/active_admin/application.rb:132:in `block in load!' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/activeadmin-0.3.2/lib/active_admin/application.rb:132:in `each' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/activeadmin-0.3.2/lib/active_admin/application.rb:132:in `load!' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/activeadmin-0.3.2/lib/active_admin/application.rb:155:in `routes' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/activeadmin-0.3.2/lib/active_admin.rb:63:in `routes' 
    from /Users/beatjunkie84/Desktop/ProjectX/config/routes.rb:4:in `block in <top (required)>' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/actionpack-3.0.1/lib/action_dispatch/routing/route_set.rb:233:in `instance_exec' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/actionpack-3.0.1/lib/action_dispatch/routing/route_set.rb:233:in `draw' 
    from /Users/beatjunkie84/Desktop/ProjectX/config/routes.rb:1:in `<top (required)>' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:235:in `load' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:235:in `block in load' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:225:in `block in load_dependency' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:591:in `new_constants_in' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:225:in `load_dependency' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:235:in `load' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/railties-3.0.1/lib/rails/application.rb:127:in `block in reload_routes!' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/railties-3.0.1/lib/rails/application.rb:127:in `each' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/railties-3.0.1/lib/rails/application.rb:127:in `reload_routes!' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/railties-3.0.1/lib/rails/application.rb:120:in `block in routes_reloader' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/file_update_checker.rb:32:in `call' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/file_update_checker.rb:32:in `execute_if_updated' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/actionpack-3.0.1/lib/action_dispatch/railtie.rb:14:in `block (2 levels) in <class:Railtie>' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/callbacks.rb:419:in `_run_prepare_callbacks' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/actionpack-3.0.1/lib/action_dispatch/middleware/callbacks.rb:40:in `initialize' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/actionpack-3.0.1/lib/action_dispatch/middleware/stack.rb:33:in `new' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/actionpack-3.0.1/lib/action_dispatch/middleware/stack.rb:33:in `build' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/actionpack-3.0.1/lib/action_dispatch/middleware/stack.rb:79:in `block in build' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/actionpack-3.0.1/lib/action_dispatch/middleware/stack.rb:79:in `each' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/actionpack-3.0.1/lib/action_dispatch/middleware/stack.rb:79:in `inject' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/actionpack-3.0.1/lib/action_dispatch/middleware/stack.rb:79:in `build' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/railties-3.0.1/lib/rails/application.rb:162:in `app' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/railties-3.0.1/lib/rails/application/finisher.rb:35:in `block in <module:Finisher>' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/railties-3.0.1/lib/rails/initializable.rb:25:in `instance_exec' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/railties-3.0.1/lib/rails/initializable.rb:25:in `run' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/railties-3.0.1/lib/rails/initializable.rb:50:in `block in run_initializers' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/railties-3.0.1/lib/rails/initializable.rb:49:in `each' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/railties-3.0.1/lib/rails/initializable.rb:49:in `run_initializers' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/railties-3.0.1/lib/rails/application.rb:134:in `initialize!' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/railties-3.0.1/lib/rails/application.rb:77:in `method_missing' 
    from /Users/beatjunkie84/Desktop/ProjectX/config/environment.rb:5:in `<top (required)>' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:239:in `require' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:239:in `block in require' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:225:in `block in load_dependency' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:591:in `new_constants_in' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:225:in `load_dependency' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:239:in `require' 
    from /Users/beatjunkie84/Desktop/ProjectX/config.ru:3:in `block in <main>' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/rack-1.2.4/lib/rack/builder.rb:46:in `instance_eval' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/rack-1.2.4/lib/rack/builder.rb:46:in `initialize' 
    from /Users/beatjunkie84/Desktop/ProjectX/config.ru:1:in `new' 
    from /Users/beatjunkie84/Desktop/ProjectX/config.ru:1:in `<main>' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/rack-1.2.4/lib/rack/builder.rb:35:in `eval' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/rack-1.2.4/lib/rack/builder.rb:35:in `parse_file' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/rack-1.2.4/lib/rack/server.rb:162:in `app' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/rack-1.2.4/lib/rack/server.rb:253:in `wrapped_app' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/rack-1.2.4/lib/rack/server.rb:204:in `start' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/railties-3.0.1/lib/rails/commands/server.rb:65:in `start' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/railties-3.0.1/lib/rails/commands.rb:30:in `block in <top (required)>' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/railties-3.0.1/lib/rails/commands.rb:27:in `tap' 
    from /Users/beatjunkie84/Desktop/ProjectX/bundler/ruby/1.9.1/gems/railties-3.0.1/lib/rails/commands.rb:27:in `<top (required)>' 
    from script/rails:6:in `require' 
    from script/rails:6:in `<main>' 

나는 내가 실제로 그것을 일으키는 또는 내가 그것을 해결하기 위해 무슨 짓을했는지 ... 무엇이 원인을 모른 채이 문제를 적어도 4 번 고정 것 같아요?

다음은이 문제를 해결하는 방법입니다. 1) 현재 내 지부 ('paperclip')에서 가장 오래된 커밋을 확인하십시오. 2) 번들 설치 (어떤 보석을 번들러/어떤 이유로 든 설치 함) 3) 힘내 자. 및/또는 git stash를 사용하여 체크 아웃 한 후 이름없는 지점에 방금 변경 한 내용을 제거하십시오. 4) 처음 분기를 다시 체크 아웃하고 ('paperclip') 레일스 서버를 실행하십시오. 5) 작동합니다.

겉으로보기에 나는 어떤 경우에도 아무것도하지 않기 때문에 무엇이 원인인지 또는 무엇이 문제인지를 알지 못합니다. 도와주세요!

답변

0

'bcrypt_ext'처럼 보이는 보석이 서버에 설치되어 있지 않습니다!

소스 코드를 업데이트 한 후 bundle install을 실행해야합니다. 가지를 전환하거나 새로운 코드 수정을 당겨 ..

+0

내가 전에 bcrypt_ext 사용한 적이 그것은 필요하지 않았다. 분기없이 스위치를 바꿀 때까지 완벽하게 작동합니다 (단 하나의 변경없이). 그런 다음이를 고치려면 기본적으로 내 보석 디렉토리를 다시 설치해야합니다 (보석 디렉토리가 더 이상 존재하지 않는 구식 저장소를 체크 아웃하여). 설치하고 다시 전환해야합니다. 다시 말하면, 실제로 변경된 사항은 없습니다. 또한 bcrypt로 번들 설치를 시도했지만 아무 것도하지 않았습니다. –

+0

추 신 : 나는 다른 SOF 대답에서 뭔가를 시도했다 : cd [gems 폴더의 경로] /gems/bcrypt-ruby-2.1.4/ext/mri ruby ​​extconf.rb make sudo make install which .... 어떤 아이디어인지 이유는 무엇인가? ? (http://stackoverflow.com/questions/3900180/no-such-file-to-load-bcrypt-ext-via-devise) –

+0

아마도 각 분기마다 RVM에서 다른 보석 세트를 사용해야합니다 ... 'rvm gemset help ' – Tilo

1

을하지만이 일을 왜 확실하지 :

cd [path to your gems folder]/gems/bcrypt-ruby-3.0.1/ext/mri 
ruby extconf.rb 
make 
sudo make install 

여기에서 찾을 : no such file to load -- bcrypt_ext (via devise)

+0

빌드시 오류가 발생합니다. 어떤 아이디어? – Edward

관련 문제