开发者

Can't initialize local server for my Rails apps

开发者 https://www.devze.com 2022-12-20 17:59 出处:网络
My rails apps have been freaking out on me lately.开发者_JS百科I start my local server by running \"ruby script/server\" like normal.The server starts, but when I try to access it via \"http://localho

My rails apps have been freaking out on me lately.开发者_JS百科 I start my local server by running "ruby script/server" like normal. The server starts, but when I try to access it via "http://localhost:3000/", it throws me a 500 error. This happens for all my rails apps, even the old ones I've left unchanged for several months now. Here is the full trace:


/!\ 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'

Configuration: I have Ruby 1.9 installed with MacPorts, and am running on Rails 2.3.5. Some things I've been playing with recently: - Messed with RVM - Tried out the Homebrew, a MacOSX package management system - Installed Unicorn and Thin as gems

Any help would be much appreciated! I'd prefer not to have to scrap my system and reinstall everything.


When I get the " uninitialized constant" error, I normally have a missing class or library, e.g. an incomplete checkout of a project or branch. In your case there might be some problems with the path/setup of FFI::Platform::CPU

BTW you are mentioning: "not to have to scrap my system and reinstall everything" --> I use git to version control my dev environment once in a while, so I can checkout the previous snapshot before the trouble got started.

good luck!

0

精彩评论

暂无评论...
验证码 换一张
取 消