Rails控制台权限被拒绝@ rb_sysopen错误

时间:2018-09-17 04:07:25

标签: ruby-on-rails ruby rails-console

退出Rails控制台时,终端会出现此错误。

 Calendar currTime = Calendar.getInstance();
 int hour = currTime.get(Calendar.HOUR_OF_DAY);
        int min = currTime.get(Calendar.MINUTE);

 if(hour >=11 && hour <= 14)
        {
              if(min >= 30 || min <=30) {
                  foodArrayList = getModel();
                  menu.setText("Lunch Menu");
              }
        }
        else //if ((hour >= 17 && min >= 30) || (hour <= 23 && min <= 30))
        if(hour >=17 && hour <= 23)
        {
           if(min >= 30 || min <=30){
               foodArrayList = getModel1();
               menu.setText("Dinner Menu");
           }

        }
        else
        {
           foodArrayList = getModel2();
            menu.setText("We are Closed!!");
            Intent myintent = new Intent(MainActivity.this,ResultActivity.class);
            startActivity(myintent);

        }

起初我不在乎此错误消息,但很快我意识到未应用Rails控制台中的活动记录更新。

我该如何解决这个问题?

1 个答案:

答案 0 :(得分:1)

这应该可以解决问题。 编辑/创建 ~/.irbrc

require 'irb/ext/save-history'
IRB.conf[:SAVE_HISTORY] = 10000
IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-history"