无法在Mac上启动Rails服务器

时间:2017-04-10 21:09:40

标签: ruby-on-rails ruby rubygems

我想使用Rails 4.2.3,我设法使用rbenv和gem安装它。启动服务器时出现此错误:

rails server
=> Booting WEBrick
=> Rails 4.2.3 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
/Users/macuser/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/activesupport-4.2.3/lib/active_support/core_ext/numeric/conversions.rb:121: warning: constant ::Fixnum is deprecated
/Users/macuser/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/activesupport-4.2.3/lib/active_support/core_ext/numeric/conversions.rb:121: warning: constant ::Bignum is deprecated
Exiting
/Users/macuser/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/activesupport-4.2.3/lib/active_support/core_ext/numeric/conversions.rb:124:in `block (2 levels) in <class:Numeric>': stack level too deep (SystemStackError)
    from /Users/macuser/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/activesupport-4.2.3/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>'
    from /Users/macuser/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/activesupport-4.2.3/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>'
    from /Users/macuser/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/activesupport-4.2.3/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>'
    from /Users/macuser/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/activesupport-4.2.3/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>'
    from /Users/macuser/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/activesupport-4.2.3/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>'
    from /Users/macuser/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/activesupport-4.2.3/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>'
    from /Users/macuser/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/activesupport-4.2.3/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>'
    from /Users/macuser/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/activesupport-4.2.3/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>'
     ... 5542 levels...
    from /Users/macuser/.rbenv/versions/2.4.0/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Users/macuser/dreamer_me/bin/spring:15:in `<top (required)>'
    from bin/rails:3:in `load'
    from bin/rails:3:in `<main>'

1 个答案:

答案 0 :(得分:1)

您正在运行Ruby 2.4,您可以通过在应用级别的.ruby-version文件中设置ruby版本来更改它。

# .ruby-version
2.2.2

或者你喜欢什么。你可以看到你有哪些红宝石版本

$ rbenv versions