Не могу инициализировать локальный сервер для моих приложений Rails - PullRequest
0 голосов
/ 18 февраля 2010

В последнее время мои рельсовые приложения меня бесят. Я запускаю свой локальный сервер, запустив «скрипт / сервер ruby», как обычно. Сервер запускается, но когда я пытаюсь получить к нему доступ через "http://localhost:3000/",, он выдает ошибку 500. Это происходит со всеми моими приложениями rails, даже со старыми, которые я оставил без изменений в течение нескольких месяцев. полный след:


/!\ FAILSAFE /!\  2010-02-17 23:34:46 -0800
  Status: 500 Internal Server Error
  uninitialized constant FFI::Platform::CPU
    /opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:440:in `rescue in load_missing_constant'
    /opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:436:in `load_missing_constant'
    /opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:80:in `const_missing_with_dependencies'
    /Users/elpizochoi/.gem/ruby/1.9.1/gems/ffi-0.6.2/lib/ffi/platform.rb:50:in `<module:Platform>'
    /Users/elpizochoi/.gem/ruby/1.9.1/gems/ffi-0.6.2/lib/ffi/platform.rb:32:in `<module:FFI>'
    /Users/elpizochoi/.gem/ruby/1.9.1/gems/ffi-0.6.2/lib/ffi/platform.rb:29:in `<top (required)>'
    /opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
    /opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `block in require'
    /opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in'
    /opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
    /Users/elpizochoi/.gem/ruby/1.9.1/gems/ffi-0.6.2/lib/ffi/ffi.rb:42:in `<top (required)>'
    /opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
    /opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `block in require'
    /opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in'
    /opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
    /Users/elpizochoi/.gem/ruby/1.9.1/gems/ffi-0.6.2/lib/ffi.rb:11:in `<top (required)>'
    /opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
    /opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `block in require'
    /opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in'
    /opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
    /opt/local/lib/ruby/gems/1.9.1/gems/sqlite3-0.0.8/lib/sqlite3.rb:1:in `<top (required)>'
    /opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
    /opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `block in require'
    /opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in'
    /opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
    /opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/core_ext/kernel/requires.rb:7:in `block in require_library_or_gem'
    /opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
    /opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/core_ext/kernel/requires.rb:5:in `require_library_or_gem'
    /opt/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.5/lib/active_record/connection_adapters/sqlite3_adapter.rb:10:in `sqlite3_connection'
    /opt/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in `new_connection'
    /opt/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:245:in `checkout_new_connection'
    /opt/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:188:in `block (2 levels) in checkout'
    /opt/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in `loop'
    /opt/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in `block in checkout'
    /opt/local/lib/ruby/1.9.1/monitor.rb:190:in `mon_synchronize'
    /opt/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:183:in `checkout'
    /opt/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:98:in `connection'
    /opt/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:326:in `retrieve_connection'
    /opt/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_specification.rb:123:in `retrieve_connection'
    /opt/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_specification.rb:115:in `connection'
    /opt/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:9:in `cache'
    /opt/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:28:in `call'
    /opt/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
    /opt/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/action_controller/string_coercion.rb:25:in `call'
    /opt/local/lib/ruby/gems/1.9.1/gems/rack-1.0.1/lib/rack/head.rb:9:in `call'
    /opt/local/lib/ruby/gems/1.9.1/gems/rack-1.0.1/lib/rack/methodoverride.rb:24:in `call'
    /opt/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/action_controller/params_parser.rb:15:in `call'
    /opt/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/action_controller/session/cookie_store.rb:93:in `call'
    /opt/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/action_controller/failsafe.rb:26:in `call'
    /opt/local/lib/ruby/gems/1.9.1/gems/rack-1.0.1/lib/rack/lock.rb:11:in `block in call'
    <internal:prelude>:8:in `synchronize'
    /opt/local/lib/ruby/gems/1.9.1/gems/rack-1.0.1/lib/rack/lock.rb:11:in `call'
    /opt/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:114:in `block in call'
    /opt/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/action_controller/reloader.rb:34:in `run'
    /opt/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:108:in `call'
    /opt/local/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/rails/rack/static.rb:31:in `call'
    /opt/local/lib/ruby/gems/1.9.1/gems/rack-1.0.1/lib/rack/urlmap.rb:46:in `block in call'
    /opt/local/lib/ruby/gems/1.9.1/gems/rack-1.0.1/lib/rack/urlmap.rb:40:in `each'
    /opt/local/lib/ruby/gems/1.9.1/gems/rack-1.0.1/lib/rack/urlmap.rb:40:in `call'
    /opt/local/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/rails/rack/log_tailer.rb:17:in `call'
    /opt/local/lib/ruby/gems/1.9.1/gems/rack-1.0.1/lib/rack/content_length.rb:13:in `call'
    /opt/local/lib/ruby/gems/1.9.1/gems/rack-1.0.1/lib/rack/handler/webrick.rb:50:in `service'
    /opt/local/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
    /opt/local/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
    /opt/local/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'

Конфигурация: у меня установлен Ruby 1.9 с MacPorts, и я работаю на Rails 2.3.5. Некоторые вещи, с которыми я играл недавно: - Перепутал с RVM - Попробовал Homebrew, систему управления пакетами MacOSX - Установлен Единорог и Тонкие как драгоценные камни

Любая помощь будет высоко ценится! Я бы предпочел не ломать мою систему и переустанавливать все.

1 Ответ

0 голосов
/ 18 февраля 2010

Когда я получаю ошибку «неинициализированная константа», у меня обычно отсутствует класс или библиотека, например неполная проверка проекта или филиала. В вашем случае могут быть некоторые проблемы с путем / настройкой FFI :: Platform :: CPU

Кстати, вы упоминаете: «не нужно утилизировать мою систему и переустанавливать все» -> время от времени я использую git для управления версиями моей среды разработки, поэтому я могу извлечь предыдущий снимок до того, как начнется проблема.

удачи!

...