我想使用Rails 4.2.3,并且我设法使用rbenv和gem来安装它。当启动服务器我得到这个错误:在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>'
感谢您的帮助@Swards。 rbenv版本 系统 * 2.4.0(由/Users/macuser/.rbenv/version设置) 我在哪里可以找到.ruby版本?按照应用程序级别,你的意思是在运行“rails new”时创建的目录。 – khatman
是的,将.ruby-version(这是文件名和。)放在与/ app相同的级别。然后你可以通过rbenv安装来添加ruby - 例如'rbenv install 2.2.2' – Swards