我在安装Stripe gem后尝试启动Rails服务器时收到此错误消息。
$ rails s
/home/alex/.rvm/gems/ruby-1.9.3-p551@rails323/gems/stripe-2.0.1/lib/stripe.rb:23:in `require': /home/alex/.rvm/gems/ruby-1.9.3-p551@rails323/gems/stripe-2.0.1/lib/stripe/errors.rb:20: syntax error, unexpected tLABEL (SyntaxError)
...alize(message=nil, http_status: nil, http_body: nil, json_bo...
... ^
/home/alex/.rvm/gems/ruby-1.9.3-p551@rails323/gems/stripe-2.0.1/lib/stripe/errors.rb:20: Can't assign to nil
...(message=nil, http_status: nil, http_body: nil, json_body: n...
... ^
/home/alex/.rvm/gems/ruby-1.9.3-p551@rails323/gems/stripe-2.0.1/lib/stripe/errors.rb:20: Can't assign to nil
...tp_status: nil, http_body: nil, json_body: nil,
... ^
/home/alex/.rvm/gems/ruby-1.9.3-p551@rails323/gems/stripe-2.0.1/lib/stripe/errors.rb:20: Can't assign to nil
/home/alex/.rvm/gems/ruby-1.9.3-p551@rails323/gems/stripe-2.0.1/lib/stripe/errors.rb:39: class definition in method body
/home/alex/.rvm/gems/ruby-1.9.3-p551@rails323/gems/stripe-2.0.1/lib/stripe/errors.rb:45: class definition in method body
/home/alex/.rvm/gems/ruby-1.9.3-p551@rails323/gems/stripe-2.0.1/lib/stripe/errors.rb:52: class definition in method body
/home/alex/.rvm/gems/ruby-1.9.3-p551@rails323/gems/stripe-2.0.1/lib/stripe/errors.rb:57: class definition in method body
/home/alex/.rvm/gems/ruby-1.9.3-p551@rails323/gems/stripe-2.0.1/lib/stripe/errors.rb:60: syntax error, unexpected tLABEL
...sage, param, code, http_status: nil, http_body: nil, json_bo...
我认为这是我的ruby版本的问题,即1.9.3,据我所知,Stripe并不支持ruby版本1.9,但我还没有找到任何具体的内容。你们知道Stripe是否可以使用ruby 1.9?
谢谢!
答案 0 :(得分:1)
您的服务器应该以Stripe版本< = 1.58.0启动。它可能缺少一些功能,但我能够使用该版本和Ruby 1.9.3运行服务器。