1

I am new to the ruby world. I want to run an existing Rails project, but I get the following error:

$ruby script/rails server
/Users/apple/.rvm/gems/ruby-1.9.3-p194/gems/json-1.7.0/ext/json/ext/json/ext/parser.bundle: undefined class/module Encoding (ArgumentError)
    from /Users/apple/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in `require'
    from /Users/apple/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:236:in `load_dependency'

Should I install other packages or another version of rails? If I write a small project using rails new xxx then $ruby script/rails server works.

BTW: I am in mac.

Thank you!

4

1 回答 1

0

The correct commands in different versions of rails are:

rails 2.3

ruby script/server

rails 3

rails server #  or ruby script/rails server

It is possible that the existing project is rails 2.3 and your environment is rails 3.0.

于 2012-06-05T02:40:25.733 回答