我知道这类问题已经被问到了.
我使用s3 gem在s3存储桶中上传我的文件.但是在s3 gem安装之后,当我启动rails服务器时它会显示以下错误:
/var/lib/gems/1.9.1/gems/aws-s3-0.6.3/lib/aws/s3/extensions.rb:223:in `class_eval': /var/lib/gems/1.9.1/gems/aws-s3-0.6.3/lib/aws/s3/extensions.rb:223: `@@{' is not allowed as a class variable name (SyntaxError) /var/lib/gems/1.9.1/gems/aws-s3-0.6.3/lib/aws/s3/extensions.rb:223: Syntax error,unexpected $end unless defined? @@{:instance_writer=>true} ^ from /var/lib/gems/1.9.1/gems/aws-s3-0.6.3/lib/aws/s3/extensions.rb:223:in `block in cattr_reader' from /var/lib/gems/1.9.1/gems/aws-s3-0.6.3/lib/aws/s3/extensions.rb:222:in `each' from /var/lib/gems/1.9.1/gems/aws-s3-0.6.3/lib/aws/s3/extensions.rb:222:in `cattr_reader' from /var/lib/gems/1.9.1/gems/aws-s3-0.6.3/lib/aws/s3/extensions.rb:258:in `cattr_accessor' from /var/lib/gems/1.9.1/gems/activesupport-4.1.5/lib/active_support/cache.rb:155:in `<class:Store>' from /var/lib/gems/1.9.1/gems/activesupport-4.1.5/lib/active_support/cache.rb:154:in `<module:Cache>' from /var/lib/gems/1.9.1/gems/activesupport-4.1.5/lib/active_support/cache.rb:14:in `<module:ActiveSupport>' from /var/lib/gems/1.9.1/gems/activesupport-4.1.5/lib/active_support/cache.rb:12:in `<top (required)>' from /var/lib/gems/1.9.1/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:247:in `require' from /var/lib/gems/1.9.1/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:247:in `block in require' from /var/lib/gems/1.9.1/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:232:in `load_dependency' from /var/lib/gems/1.9.1/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:247:in `require' from /var/lib/gems/1.9.1/gems/jbuilder-2.2.5/lib/jbuilder/jbuilder_template.rb:3:in `<top (required)>' from /var/lib/gems/1.9.1/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:247:in `require' from /var/lib/gems/1.9.1/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:247:in `block in require' from /var/lib/gems/1.9.1/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:232:in `load_dependency' from /var/lib/gems/1.9.1/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:247:in `require' from /var/lib/gems/1.9.1/gems/jbuilder-2.2.5/lib/jbuilder/railtie.rb:2:in `<top (required)>' from /var/lib/gems/1.9.1/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:247:in `require' from /var/lib/gems/1.9.1/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:247:in `block in require' from /var/lib/gems/1.9.1/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:232:in `load_dependency' from /var/lib/gems/1.9.1/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:247:in `require' from /var/lib/gems/1.9.1/gems/jbuilder-2.2.5/lib/jbuilder.rb:317:in `<top (required)>' from /var/lib/gems/1.9.1/gems/bundler-1.6.2/lib/bundler/runtime.rb:76:in `require' from /var/lib/gems/1.9.1/gems/bundler-1.6.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require' from /var/lib/gems/1.9.1/gems/bundler-1.6.2/lib/bundler/runtime.rb:72:in `each' from /var/lib/gems/1.9.1/gems/bundler-1.6.2/lib/bundler/runtime.rb:72:in `block in require' from /var/lib/gems/1.9.1/gems/bundler-1.6.2/lib/bundler/runtime.rb:61:in `each' from /var/lib/gems/1.9.1/gems/bundler-1.6.2/lib/bundler/runtime.rb:61:in `require' from /var/lib/gems/1.9.1/gems/bundler-1.6.2/lib/bundler.rb:132:in `require' from /home/rick/rick/Projects/practice/shareBox/config/application.rb:7:in `<top (required)>' from /var/lib/gems/1.9.1/gems/railties-4.1.5/lib/rails/commands/commands_tasks.rb:79:in `require' from /var/lib/gems/1.9.1/gems/railties-4.1.5/lib/rails/commands/commands_tasks.rb:79:in `block in server' from /var/lib/gems/1.9.1/gems/railties-4.1.5/lib/rails/commands/commands_tasks.rb:76:in `tap' from /var/lib/gems/1.9.1/gems/railties-4.1.5/lib/rails/commands/commands_tasks.rb:76:in `server' from /var/lib/gems/1.9.1/gems/railties-4.1.5/lib/rails/commands/commands_tasks.rb:40:in `run_command!' from /var/lib/gems/1.9.1/gems/railties-4.1.5/lib/rails/commands.rb:17:in `<top (required)>' from bin/rails:4:in `require' from bin/rails:4:in `<main>'