如何修复 Rails 3.1 和 Ruby 1.9.2 中语言学库中的错误



我的应用程序在最新版本的rails中没有任何问题:

gem 'linguistics' # in Gemfile
Linguistics::use(:en, :installProxy => :en) # In environment.rb

最近我从Ruby 1.8.7升级到Ruby 1.9.2,并且正在使用Rails的边缘版本。当我启动服务器时,我现在看到以下内容:

=> Booting WEBrick
=> Rails 3.1.0.beta1 application starting in development on
http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server Exiting /Users/alextan/.rvm/gems/ruby-1.9.2-p180/gems/linguistics-1.0.8/lib/linguistics.rb:177:in
`en': can't modify frozen object
(RuntimeError)  from (eval):6:in
`method_missing'    from
/Users/alextan/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.1.0.beta1/lib/rails/commands/server.rb:78:in
`middleware'    from
/Users/alextan/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.3.0.beta/lib/rack/server.rb:291:in
`build_app'     from
/Users/alextan/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.3.0.beta/lib/rack/server.rb:301:in
`wrapped_app'   from
/Users/alextan/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.3.0.beta/lib/rack/server.rb:252:in
`start'     from
/Users/alextan/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.1.0.beta1/lib/rails/commands/server.rb:69:in
`start'     from
/Users/alextan/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.1.0.beta1/lib/rails/commands.rb:53:in
`block in <top (required)>'     from
/Users/alextan/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.1.0.beta1/lib/rails/commands.rb:48:in
`tap'   from
/Users/alextan/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.1.0.beta1/lib/rails/commands.rb:48:in
`<top (required)>'  from
script/rails:6:in `require'     from
script/rails:6:in `<main>'

关于如何解决此问题的任何想法?这是语言学和Ruby 1.9.2之间的不兼容吗?

我认为这主要是 rails 兼容性问题,因为在提交中提到了 1.9.2 compat,一个接一个地尝试,而不是两个一起,以确保 1.9.2 和 rails 3 工作,之后切换到边缘轨道。

您可能想尝试,如果有实际版本,请尝试(将此版本包含在您的 gemfile 中):

gem update linguistics --pre

或者确保在您的宝石文件中更新它

gem 'linguistics', :git => 'https://github.com/ged/linguistics.git'

相关内容

  • 没有找到相关文章

最新更新