Rake db:迁移SQLite3 :: IOException:磁盘I / O错误

时间:2015-05-10 14:38:14

标签: ruby-on-rails ruby rake

我做了installfest项目设置:

http://installfest.railsbridge.org/installfest/create_a_rails_app
在执行rake db:migrate时遇到此错误。

我尝试过重新安装导轨和红宝石,但这没有用。

使用:

  • Ruby 2.2.1
  • Rails 4.2.1
  • Ubuntu 14.04
  • Ubuntu在Windows 8.1主机上设置了vagrant(VM)

    vagrant@vagrant-ubuntu-trusty-64:/vagrant/odin/test_app$ rake db:migrate --trace

  

**调用db:migrate(first_time)       **调用环境(first_time)       **执行环境       **调用db:load_config(first_time)       **执行db:load_config       **执行db:migrate       耙子流产了!       ActiveRecord :: StatementInvalid:SQLite3 :: IOException:磁盘I / O错误:SELECT名称                 来自sqlite_master                 WHERE(type =&#39; table&#39; OR type =&#39; view&#39;)AND NOT name =&#39; sqlite_sequence&#39;        AND name =&#34; schema_migrations&#34;       /home/vagrant/.rvm/gems/ruby-2.2.1/gems/sqlite3-1.3.10/lib/sqlite3/database.rb:91:in   initialize' /home/vagrant/.rvm/gems/ruby-2.2.1/gems/sqlite3-1.3.10/lib/sqlite3/database.rb:91:in 新&#39;       /home/vagrant/.rvm/gems/ruby-2.2.1/gems/sqlite3-1.3.10/lib/sqlite3/database.rb:91:in   exec_query中的prepare' /home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/connection_adapters/sqlite3_adapter.rb:296:in阻止&#39;       /home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:473:in block in log' /home/vagrant/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.1/lib/active_support/notifications/instrumenter.rb:20:in instrument&#39;       /home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:467:in log' /home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/connection_adapters/sqlite3_adapter.rb:293:in exec_query&#39;       /home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/connection_adapters/sqlite3_adapter.rb:374:in tables' /home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/connection_adapters/sqlite3_adapter.rb:380:in table_exists?&#39;       /home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/schema_migration.rb:21:in   table_exists?' /home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/schema_migration.rb:25:in CREATE_TABLE&#39;       /home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:805:in   initialize_schema_migrations_table' /home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/migration.rb:922:in 初始化&#39;       /home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/migration.rb:820:in   new' /home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/migration.rb:820:in 起来&#39;       /home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/migration.rb:798:in   migrate' /home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/tasks/database_tasks.rb:137:in 迁移&#39;       /home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/railties/databases.rake:44:in   block (2 levels) in <top (required)>' /home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/task.rb:240:in 呼叫&#39;       /home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/task.rb:240:in   block in execute' /home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/task.rb:235:in 各&#39;       /home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/task.rb:235:in   {* 1}}阻止invoke_with_call_chain&#39;       /home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/monitor.rb:211:in   execute' /home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/task.rb:179:in invoke_with_call_chain&#39;       /home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/task.rb:165:in   mon_synchronize' /home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/task.rb:172:in invoke_task&#39;       /home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:106:in   invoke' /home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:150:in 各&#39;       /home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:106:in   block (2 levels) in top_level' /home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:106:in run_with_threads&#39;       /home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:100:in   block in top_level' /home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:115:in 阻止运行&#39;       /home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:176:in   top_level' /home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:78:in 运行&#39;       /home/vagrant/.rvm/rubies/ruby-2.2.1/bin/rake:33:in standard_exception_handling' /home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:75:in 初始化&#39;       /home/vagrant/.rvm/gems/ruby-2.2.1/gems/sqlite3-1.3.10/lib/sqlite3/database.rb:91:in   <main>' SQLite3::IOException: disk I/O error /home/vagrant/.rvm/gems/ruby-2.2.1/gems/sqlite3-1.3.10/lib/sqlite3/database.rb:91:in 制备&#39;       /home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/connection_adapters/sqlite3_adapter.rb:296:in new' /home/vagrant/.rvm/gems/ruby-2.2.1/gems/sqlite3-1.3.10/lib/sqlite3/database.rb:91:in 阻止日志&#39;       /home/vagrant/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.1/lib/active_support/notifications/instrumenter.rb:20:in   block in exec_query' /home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:473:in登录&#39;       /home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/connection_adapters/sqlite3_adapter.rb:293:in instrument' /home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:467:in表&#39;       /home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/connection_adapters/sqlite3_adapter.rb:380:in exec_query' /home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/connection_adapters/sqlite3_adapter.rb:374:in table_exists?&#39;       /home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/schema_migration.rb:25:in   table_exists?' /home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/schema_migration.rb:21:in initialize_schema_migrations_table&#39;       /home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/migration.rb:922:in   create_table' /home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:805:in 新&#39;       /home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/migration.rb:820:in   initialize' /home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/migration.rb:820:in 迁移&#39;       /home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/tasks/database_tasks.rb:137:in   up' /home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/migration.rb:798:in 阻止(2级)&#39;       /home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/task.rb:240:in   migrate' /home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/railties/databases.rake:44:in 阻止执行&#39;       /home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/task.rb:235:in   call' /home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/task.rb:240:in 执行&#39;       /home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/task.rb:179:in   each' /home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/task.rb:235:in mon_synchronize&#39;       /home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/task.rb:172:in   block in invoke_with_call_chain' /home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/monitor.rb:211:in 调用&#39;       /home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:150:in   top_level中的invoke_with_call_chain' /home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/task.rb:165:in 阻止(2个级别)&#39;   /home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:106:in   top_level中的invoke_task' /home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:106:in 阻止&#39;       /home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:115:in   each' /home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:106:in TOP_LEVEL&#39;       /home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:78:in   run_with_threads' /home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:100:in standard_exception_handling&#39;       /home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:75:in   block in run' /home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:176:in &#39;       任务:TOP =&gt;分贝:迁移

1 个答案:

答案 0 :(得分:0)

我解决了这个问题,更改了NFS共享文件夹挂载选项!

mount_options:['nolock,vers=3,udp,noatime,actimeo=1']

现在rake db:migrate运行正常!