8

Trying to boot up a Rails app inside a Vagrant box (percise32) host machine is Windows 7. This is my Vagrantfile

Vagrant.configure('2') do |config|
  config.vm.box      = 'precise32'
  config.vm.box_url  = 'http://files.vagrantup.com/precise32.box'
  config.vm.hostname = 'rails-dev-box'

  config.vm.synched_folder "c:\rails_text", "/home/code"

  config.vm.network :forwarded_port, guest: 3000, host: 3003

  config.vm.provision :puppet do |puppet|
    puppet.manifests_path = 'puppet/manifests'
    puppet.module_path    = 'puppet/modules'
  end
end

When i try to run the app (code is syncing correctly) i am getting the following error on the Rails server output:

Errno::ETXTBSY in Welcome#index

Showing /home/code/app/views/layouts/application.html.erb where line #4 raised:
Text file busy - (/home/code/tmp/cache/sass/a0a09a036cf07b1cae262d60fa989a8e24765858/welcome.css.scssc20131001-1595-f6clpt, /home/code/cache/sass/a0a09a036cf07b1cae262d60fa989a8e24765858/welcome.css.scssc)
  (in /home/code/app/assets/stylesheets/welcome.css.scss)

Some articles suggested that moving my synced folder outside of the /vagrant root is the cure, but it seems that it is not the issue in my case since i am using /home/code

ideas welcome.

4

5 回答 5

13

看起来 Sass 的 gem 最近更新了(比如昨天或今天) 转到 Gemfile 并将 sass 版本设置为 3.2.10,然后进行捆绑更新

gem 'sass', '3.2.10' # 3.2.11 破坏了应用程序

于 2013-10-02T19:27:04.167 回答
3

user2840051工作的解决方法..需要卸载sass

gem uninstall sass

选择要卸载的版本

使用以下命令修改您的 Gemfile:

gem 'sass', '3.2.10'

最后运行:

bundle update sass

于 2014-02-21T08:47:08.223 回答
0

在 sass 升级到 3.2.12 后,我遇到了同样的问题。我的解决方案是将 sass 缓存从同步文件夹移到适当的 linux 文件系统:

options[:cache_location] = "/tmp/sass-cache"
于 2013-10-11T07:00:11.383 回答
0

我对 grunt/sass 和 vagrant 也有同样的问题。

消息是:

vagrant@precise32:~$ grunt
Running "sass:dist" (sass) task
Errno::ETXTBSY: Text file busy @ sys_fail2 - (./.sass-cache/8147710423c1a1d0096b06b58f36e8601f62e931/main.scssc20140302-6017-1phv8qn, ./.sass-cache/8147710423c1a1d0096b06b58f36e8601f62e931/main.scssc)
  Use --trace for backtrace.
Warning: Exited with error code 1 Use --force to continue.

Aborted due to warnings.

修复方法是将cacheLocation选项添加到Gruntfile.js中,示例配置如下。

module.exports = function(grunt) {
    grunt.initConfig({

        sass: {
            dist: {
                options: {
                    style: 'compressed', // compact
                    lineNumbers : false, // true
                    cacheLocation: '/tmp/sass-cache'
                },
            },
        },
    });
}
于 2014-03-02T18:13:43.793 回答
-1

作为一般系统范围的修复

gem uninstall sass
gem install sass -v 3.2.10
于 2013-12-12T20:31:14.317 回答