Rails 4.1.1在生产中使用控制台

时间:2014-06-12 14:33:19

标签: ruby-on-rails ruby-on-rails-4

自从更新到rails 4.1.1并在生产中启动我的控制台后,我一直收到此错误:RAILS_ENV=production rails c

load error: /home/tristan/.rvm/rubies/ruby-2.1.1/.irbrc
NoMethodError: undefined method `split' for nil:NilClass
    /home/tristan/.rvm/scripts/irbrc.rb:41:in `<top (required)>'
    /home/tristan/joggle/shared/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `require'
    /home/tristan/joggle/shared/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `block in require'
    /home/tristan/joggle/shared/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:232:in `load_dependency'
    /home/tristan/joggle/shared/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `require'
    /home/tristan/.rvm/rubies/ruby-2.1.1/.irbrc:11:in `<top (required)>'
    /home/tristan/joggle/shared/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:241:in `load'
    /home/tristan/joggle/shared/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:241:in `block in load'
    /home/tristan/joggle/shared/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:232:in `load_dependency'
    /home/tristan/joggle/shared/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:241:in `load'
    /home/tristan/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/irb/init.rb:236:in `run_config'
    /home/tristan/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/irb/init.rb:19:in `setup'
    /home/tristan/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/irb.rb:380:in `start'
    /home/tristan/joggle/shared/bundle/ruby/2.1.0/gems/railties-4.1.1/lib/rails/commands/console.rb:90:in `start'
    /home/tristan/joggle/shared/bundle/ruby/2.1.0/gems/railties-4.1.1/lib/rails/commands/console.rb:9:in `start'
    /home/tristan/joggle/shared/bundle/ruby/2.1.0/gems/railties-4.1.1/lib/rails/commands/commands_tasks.rb:69:in `console'
    /home/tristan/joggle/shared/bundle/ruby/2.1.0/gems/railties-4.1.1/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
    /home/tristan/joggle/shared/bundle/ruby/2.1.0/gems/railties-4.1.1/lib/rails/commands.rb:17:in `<top (required)>'

1 个答案:

答案 0 :(得分:0)

我刚才有同样的问题。我跑'spring stop'然后'rails c',它纠正了错误。因为irbrc.rb文件的第41行引用了ENV变量GEM_HOME,我确认实际上已经设置好了。

这会解决您的问题吗?