我遇到了一个奇怪的问题,我的 Rails Web 服务器(webrick)无法启动。一切正常,但后来我的 Mac(OS 10.8)因缺乏电源而进入睡眠状态。(我对windows比较熟悉,所以我不确定它是睡眠还是休眠或者技术状态是什么,但基本上电池太低了。)
我将其插入并再次打开了 mac,但现在rails s
给了我以下输出:
rails s
exists
exists app/controllers
exists app/helpers
exists app/models
exists app/views/layouts
exists config/environments
exists config/initializers
exists config/locales
exists db
exists doc
exists lib
exists lib/tasks
exists log
exists public/images
exists public/javascripts
exists public/stylesheets
exists script/performance
exists test/fixtures
exists test/functional
exists test/integration
exists test/performance
exists test/unit
exists vendor
exists vendor/plugins
exists tmp/sessions
exists tmp/sockets
exists tmp/cache
exists tmp/pids
identical Rakefile
identical README
identical app/controllers/application_controller.rb
identical app/helpers/application_helper.rb
identical config/database.yml
identical config/routes.rb
identical config/locales/en.yml
identical db/seeds.rb
identical config/initializers/backtrace_silencers.rb
identical config/initializers/inflections.rb
identical config/initializers/mime_types.rb
identical config/initializers/new_rails_defaults.rb
overwrite config/initializers/session_store.rb? (enter "h" for help) [Ynaqdh] q
aborting app
我查看了在启动 rails webrick 服务器时报告错误的线程,并且rails 脚本/服务器没有启动服务器,但这似乎是一个不同的问题,因为我之前已经安装并工作了所有东西。
再次,它运行良好,直到我的电池电量不足并关闭电源。
我还尝试过创建一个全新的 rails 项目,但最初只是rails dummy
创建了一个虚拟项目。当我rails s
在项目中运行并选择 diff 选项时,我得到以下输出:
overwrite config/initializers/session_store.rb? (enter "h" for help) [Ynaqdh] d
--- s/config/initializers/session_store.rb 2012-07-30 19:36:06.000000000 -0400
+++ s/config/initializers/session_store.rb20120730-26164-2nbrgz-0 2012-07-30 19:36:28.000000000 -0400
@@ -6,7 +6,7 @@
# no regular words or you'll be exposed to dictionary attacks.
ActionController::Base.session = {
:key => '_s_session',
- :secret => '0de919861d30e11a894d96d395ec2340fd40d88309035bea3033bbf2a6f3c3e0b3a42afa9ec208533547e025be363c19439d79b22ed5b04709442e9d50dcf985'
+ :secret => '2609e7c27f761383e77cda8b7a7dead04ffa6ad47ce3bd540f946a1fcdfe9dec9a87cc71880e50db9f94d68afe5c4bce9efb621024a9ce69a7af22b44a266a43'
}
# Use the database for sessions instead of the cookie-based default,
提前感谢您的帮助。我迷路了。