我有一个rails应用程序,但握手不好。
我相信它与mysql库有关,我可以很好地访问大部分应用程序,但是当我遇到使用ferret的页面时它会失败。
我认为这与我运行RVM有关。如果我的用户没有安装宝石和rails的版本,但是雪貂脚本就是以这个开始的。
#!/usr/bin/env ruby
在命令行上,如果我这样做,ruby -v就会出现正确的版本。
我认为使用不同的ruby,因为它可能没有设置正确的路径?
以下是我在生产日志文件中看到的输出。
注意:localhost:9010是雪貂服务器的主机和端口。
ActionView::TemplateError (#08S01Bad handshake) on line #38 of
layouts/_sheet_info.rhtml:
35:
36: <%= worked_nice(@current_sheet.duration/60) -%><%= info_string -%
<%= " - " if total_today > 0 %>
37: <% end %>
38: <% if total_today > 0 %>
39: <%= distance_of_time_in_words(total_today.minutes) %> <%=_ 'worked
today'%>
40: <% end %>
41:
(druby://localhost:9010) /...myapp../vendor/rails/activerecord/lib/active_record/vendor/mysql.rb:523:in `read'
(druby://localhost:9010) /...myapp../vendor/rails/activerecord/lib/active_record/vendor/mysql.rb:153:in `real_connect'
(druby://localhost:9010) /...myapp../vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:527:in `connect'
(druby://localhost:9010) /...myapp../vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:186:in `initialize'
(druby://localhost:9010) /...myapp../vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:85:in `new'
(druby://localhost:9010) /...myapp../vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:85:in `mysql_connection'
(druby://localhost:9010) /...myapp../vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:292:in `send'
(druby://localhost:9010) /...myapp../vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:292:in `connection='
(druby://localhost:9010) /...myapp../vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:260:in `retrieve_connection'
(druby://localhost:9010) /...myapp../vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:78:in `connection'
(druby://localhost:9010) /...myapp../vendor/rails/activerecord/lib/active_record/base.rb:1143:in `table_exists?'
(druby://localhost:9010) /...myapp../vendor/rails/activerecord/lib/active_record/base.rb:1222:in `inspect'
(druby://localhost:9010) /...myapp../vendor/plugins/acts_as_ferret/lib/ferret_server.rb:143:in `rebuild_index'
(druby://localhost:9010) /...myapp../vendor/plugins/acts_as_ferret/lib/ferret_server.rb:171:in `reconnect_when_needed'
(druby://localhost:9010) /...myapp../vendor/plugins/acts_as_ferret/lib/ferret_server.rb:142:in `rebuild_index'
(druby://localhost:9010) /...myapp../vendor/plugins/acts_as_ferret/lib/ferret_server.rb:165:in `with_class'
(druby://localhost:9010) /...myapp../vendor/plugins/acts_as_ferret/lib/ferret_server.rb:138:in `rebuild_index'
(druby://localhost:9010) /...myapp../vendor/plugins/acts_as_ferret/lib/ferret_server.rb:123:in `ensure_index_exists'
(druby://localhost:9010) /...myapp../vendor/plugins/acts_as_ferret/lib/ferret_server.rb:165:in `with_class'
(druby://localhost:9010) /...myapp../vendor/plugins/acts_as_ferret/lib/ferret_server.rb:119:in `ensure_index_exists'
vendor/plugins/acts_as_ferret/lib/remote_index.rb:16:in `send'
vendor/plugins/acts_as_ferret/lib/remote_index.rb:16:in
`method_missing'
vendor/plugins/acts_as_ferret/lib/act_methods.rb:189:in
`acts_as_ferret'
app/models/work_log.rb:6
答案 0 :(得分:0)
这是因为运行设置ferret的脚本作为另一个用户运行。还重启了可能有帮助的机器。