My application has had the following lines without any trouble in recent versions of rails:
gem 'linguistics' # in Gemfile
Linguistics::use(:en, :installProxy => :en) # In environment.rb
Recently I upgraded from Ruby 1.8.7 to Ruby 1.9.2 and am using the edge version of Rails. When I start the server I now see the following:
=> 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>'
Any idea on how I can fix this? Is this an incompatibility between Linguistics 开发者_Go百科and Ruby 1.9.2?
I think its mainly a rails compatibility problem, because in the commits 1.9.2 compat is mentioned, try on after another, not both together, to ensure, 1.9.2 and rails 3 works, after that switch to edge rails.
You may want to try, if there is a actual version out there, try (include this version then in your gemfile):
gem update linguistics --pre
OR be sure to have it updated in your gemfile
gem 'linguistics', :git => 'https://github.com/ged/linguistics.git'
精彩评论