- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我认为 ruby 1.9.3 无法在/tmp 目录中创建临时文件。问题错误信息:
Status: 500 Internal Server Error No such file or directory /tmp/RackRewindableInput20121031-8340-1qko694.lock
/lib/ruby/1.9.1/tempfile.rb:346:in rmdir'
/lib/ruby/1.9.1/tempfile.rb:346:in rmdir'
/lib/ruby/1.9.1/tempfile.rb:338:in ensure in locking'
/lib/ruby/1.9.1/tempfile.rb:338:in locking'
/lib/ruby/1.9.1/tempfile.rb:144:in block in initialize'
/lib/ruby/1.9.1/tmpdir.rb:133:in create'
/lib/ruby/1.9.1/tempfile.rb:134:in initialize'
/lib/ruby/gems/1.9.1/gems/passenger-3.0.12/lib/phusion_passenger/utils/rewindable_input.rb:86:in new'
最佳答案
报同样的错误,当我尝试使用prince xml生成pdf文件时发生:
在本地机器上运行良好,开发和生产运行 webrick,但 passenger 导致崩溃。
这是我的回溯(简短版):
Compiled print/print_core.css (1ms) (pid 14275)
Completed 500 Internal Server Error in 236ms
Errno::ENOENT (No such file or directory - /*** PATH DELETED ***/tmp/cache/assets/10948d89a043b6251405277a36d3e0e2.cache20130517-14275-1l2wvu7.lock):
/usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/tempfile.rb:346:in `rmdir'
/usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/tempfile.rb:346:in `rmdir'
/usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/tempfile.rb:338:in `ensure in locking'
/usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/tempfile.rb:338:in `locking'
/usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/tempfile.rb:144:in `block in initialize'
/usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/tmpdir.rb:133:in `create'
/usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/tempfile.rb:134:in `initialize'
activesupport (3.2.9) lib/active_support/core_ext/file/atomic.rb:19:in `new'
activesupport (3.2.9) lib/active_support/core_ext/file/atomic.rb:19:in `atomic_write'
activesupport (3.2.9) lib/active_support/cache/file_store.rb:91:in `write_entry'
activesupport (3.2.9) lib/active_support/cache/strategy/local_cache.rb:140:in `write_entry'
activesupport (3.2.9) lib/active_support/cache.rb:364:in `block in write'
activesupport (3.2.9) lib/active_support/cache.rb:520:in `instrument'
activesupport (3.2.9) lib/active_support/cache.rb:362:in `write'
sprockets (2.2.2) lib/sprockets/caching.rb:90:in `cache_set'
sprockets (2.2.2) lib/sprockets/caching.rb:53:in `cache_set_hash'
sprockets (2.2.2) lib/sprockets/caching.rb:24:in `cache_asset'
sprockets (2.2.2) lib/sprockets/index.rb:92:in `build_asset'
sprockets (2.2.2) lib/sprockets/base.rb:169:in `find_asset'
sprockets (2.2.2) lib/sprockets/index.rb:60:in `find_asset'
sprockets (2.2.2) lib/sprockets/bundled_asset.rb:16:in `initialize'
sprockets (2.2.2) lib/sprockets/base.rb:252:in `new'
sprockets (2.2.2) lib/sprockets/base.rb:252:in `build_asset'
sprockets (2.2.2) lib/sprockets/index.rb:93:in `block in build_asset'
sprockets (2.2.2) lib/sprockets/caching.rb:19:in `cache_asset'
sprockets (2.2.2) lib/sprockets/index.rb:92:in `build_asset'
sprockets (2.2.2) lib/sprockets/base.rb:169:in `find_asset'
sprockets (2.2.2) lib/sprockets/index.rb:60:in `find_asset'
/var/www/*** PATH DELETED ***_core/lib/princely/pdf_helper.rb:83:in `asset_file_path'
/var/www/*** PATH DELETED ***_core/lib/princely/pdf_helper.rb:29:in `block in make_pdf'
/var/www/*** PATH DELETED ***_core/lib/princely/pdf_helper.rb:29:in `collect'
/var/www/*** PATH DELETED ***_core/lib/princely/pdf_helper.rb:29:in `make_pdf'
/var/www/*** PATH DELETED ***_core/lib/custom_pdf_helper.rb:28:in `make_pdf_with_defaults'
/var/www/*** PATH DELETED ***_core/lib/custom_pdf_helper.rb:59:in `make_tmp_pdf'
/var/www/*** PATH DELETED ***_concept/app/controllers/pdf_builder_controller.rb:171:in `build_pdf'
问题是由当 passenger 以用户“nobody”运行时的权限问题引起的,当配置文件归 root 时会发生这种情况。
在您的 apache/passenger conf 中设置以下内容使其工作
PassengerDefaultUser www-data # should be same as apache user
将 apache/rails 应用程序使用的所有文件/文件夹设置为
chown www-data:www-data
(在我的例子中是 chown -R tmp/)让它工作。
注意: 我认为,实际上错误是在 ruby 尝试实际写入临时文件时发生的,但显然在这一刻没有出现错误。在下一步中,ruby 尝试删除一个不存在的临时文件并崩溃。
希望对您有所帮助!
关于ruby 1.9 3 with passenger 3.0.12 - Tempfile 在尝试 rmdir 时导致 'No such file or directory' *.lock,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13161133/
我有一个简单的脚本来创建和删除文件夹,但是当我尝试删除文件夹时,它会出现错误。 代码: 错误信息: Warning: rmdir(../g_test/uploads/) [function.rmdi
本教程将介绍rmdir()函数的使用 新建一个293.php,如图所示: 输入php网页的结构(<?php?>),如图所示: 声明php与浏览器交互的文件类型和编码,如图所
我需要能够删除与任何用户系统的文档文件夹相关的目录。 rmdir: ~/Documents/Folder: No such file or directory 如果我手动输入扩展路径 (/Users/
这个问题与 python 没有直接关系,但我需要在 windows 下的 python32 下工作实现。 从此answer开始我假设使用 shutil.rmtree()在windows下真的很慢(我每
unlink()函数删除文件 、mkdir()函数创建目录、rmdir()函数删除目录 复制代码代码如下: <html> <head> 
我在 .bat 文件中有以下代码: @echo off xcopy /Y /S %CD%\Code\Release C:\Users\%USERNAME%\Desktop\ShareIt /I cls
我有一段代码用于测试目录是否存在,如果存在则删除它,并在其上创建一个新目录。它应该相当简单。 if(is_dir($directory)){ $files = new RecursiveIte
我想要 rmdir/s 的功能,但我需要保留指定的目录。 rmdir/s 删除指定目录之外的所有文件和子目录。 我也尝试过使用 del/s,但随后在指定目录中留下了空文件夹。我也需要删除这些文件夹。
我是 NativeScript 新手,我尝试使用 NativeScript 和 Angular 运行我的 HelloWord 应用程序。我连接了我的 Android 设备,然后运行命令 tns run
我尝试在测试前创建一些目录树并在测试结束后将其删除: require('should'); var fs = require('fs'); var rmdir = require('rmdir');
public function deleteAllEmailRelatedFolders($clientID) { $path = getcwd(); //Delete Email I
QFile 有一个静态函数 bool QFile::remove (const QString & fileName) [静态] 删除指定的文件。这很方便:我们有一个文件路径,我们使用一个命令来删除它
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 这个问题似乎不是关于 a specific programming problem, a softwar
我正在使用以下代码在 Linux 上删除一个空文件夹: bool removeFolder (const QString& path) { QDir dir(path); assert(d
我在 Windows 10 上使用 git bash,最近更新到 creators update。 每当我尝试在分支之间切换时,我都会得到以下信息 $ git fetch && git checkou
我正在尝试制作一个批处理文件,该文件将删除每个用户配置文件中的一个文件夹。但是当我运行批处理文件时,它会询问“你确定要删除 Y/N 吗?我需要这个文件在没有用户交互的情况下运行,所以有没有办法解决这个
我正在尝试使用 PHP 删除目录。 我从内到外取消链接/删除所有文件/子目录,最后在现在空的顶层目录上调用 rmdir。一切都按计划进行,直到最后一次调用 rmdir。 PHP 警告该目录不是空的并拒
我在提交图像时遇到错误,该进程已在其他程序(如 ADOBE Photoshop)中打开,我无法提交,图像已被删除。 我该如何解决?感谢您的帮助。 最佳答案 您必须停止该文件夹内的任何进程,如果您使用的
我试图了解使用 tar 的正确方法是什么。我有一个名为 main 的目录,在 sub 目录中,它包含一些我想排除的文件和目录。我想删除的所有其他人。我使用的命令: tar --remove-files
最近,我正在使用 SharpSSH 来处理远程文件。 SharpSSH 提供了用于删除远程目录的 rmdir API,但我发现当目录不为空时它会抛出异常并显示消息“Permission denied”
我是一名优秀的程序员,十分优秀!