2017-04-10 11 views
1

Rails 4.2.3を使用したいと思っています。私はrbenvとgemを使ってインストールしました。サーバーを起動するとき、私はこのエラーを取得する:あなたはルビー2.4を実行しているMacでRailsサーバを起動するときに問題が発生する

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>' 
+0

help @Swardsありがとうございます。 rbenvバージョン システム * 2.4.0(/Users/macuser/.rbenv/versionで設定) .ruby-versionはどこにありますか?アプリケーションレベルでは、 "rails new"を実行したときに作成されたディレクトリ内にあることを意味します。 – khatman

+0

はい、/ appと同じレベルに.ruby-version(ファイル名は。)を追加します。次に、rbenv installを実行してルビを追加することができます。 'rbenv install 2.2.2' – Swards

答えて

1

、あなたはアプリレベルで.ruby-versionファイルでそれを設定して、Rubyのバージョンを変更することができます。

# .ruby-version 
2.2.2 

またはあなたが好きなもの。ルビーのバージョンを確認することができます

$ rbenv versions 
+0

ここでの問題は、Rubyの最新バージョンと旧バージョンのRailsを混在させていて、2つがうまく一致しないことです。 Railsは、Fixnum *と* Bignum *を要求しているようですが、バージョン2.4以降では非推奨です。 これらの2つが非推奨になる前に2.4より前のバージョンは動作すると思います。私はRuby 2.4.0をアンインストールし、Ruby 2.2.2をインストールしました。 **私を助けるために@Swardsに叫ぶ**。 – khatman

関連する問題