“识别”功能无法识别回形针我的图像命令。 (运行Windows)

发布于 2024-10-04 23:00:52 字数 426 浏览 1 评论 0原文

我使用回形针调整图像大小,但我不断收到此错误

( 1 个错误禁止保存此项目: “identify”命令无法识别图像 C:/DOCUME~1/HP_ADM~1/LOCALS~1/Temp/stream,5584,0.jpg。 )

我几乎尝试了我在网上找到的所有内容:

  • 将 Paperclip.options[:command_path] = "C:\ImageMagick-6.6.6-Q16" 添加到我的development.rb
  • 对project.rb 进行更改(删除单引号)

我我正在使用最新的 Ruby/Rails 和 Paperclip 1.3.3 运行 Windows,

我刚刚开始使用 Rails,但我不知道该怎么做。我知道这是一个常见问题,但我遇到的所有答案都没有帮助。

提前致谢。

Im using Paperclip to size my images but I keep getting this error

( 1 error prohibited this project from being saved:
Image C:/DOCUME~1/HP_ADM~1/LOCALS~1/Temp/stream,5584,0.jpg is not recognized by the 'identify' command. )

Ive tried pretty much everything that I found online:

  • Adding Paperclip.options[:command_path] = "C:\ImageMagick-6.6.6-Q16" to my development.rb
  • Doing changes to the project.rb (removing single quotes)

I'm running windows with the latest Ruby/Rails and Paperclip 1.3.3

Im just getting into Rails and I have no idea what to do. I know this is a common problem but all of the answers I have come across havent helped.

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

与往事干杯 2024-10-11 23:00:52

通过执行以下操作,我能够使其在 Windows XP 上运行(我的开发环境 - 部署到 Heroku 工作正常):

  1. 将 ImageMagick 安装到 c:\ImageMagick
  2. 编辑 config/environments/development.rb 并添加以下内容< /p>

    Paperclip.options[:command_path] = "C:/ImageM~1"

  3. 终止并重新启动开发服务器以获取新配置。

我无法通过使用“长”窗口路径来使其工作。只有‘~1’怪物。因此,您可能需要做的唯一一件事就是更改

Paperclip.options[:command_path] = "C:\ImageMagick-6.6.6-Q16"

Paperclip.options[:command_path] = "C:/ImageM~1"

I was able to get this to work on Windows XP (my dev environment - deployment to Heroku worked fine) by doing the following:

  1. Installing ImageMagick to c:\ImageMagick
  2. editing config/environments/development.rb and adding the following

    Paperclip.options[:command_path] = "C:/ImageM~1"

  3. Kill and restart the dev server to pick up the new config.

I was not able to get it to work by using "long" windows paths. Only the '~1' monstrosity. So, the only thing you might have to do is change

Paperclip.options[:command_path] = "C:\ImageMagick-6.6.6-Q16"

to

Paperclip.options[:command_path] = "C:/ImageM~1"
杀お生予夺 2024-10-11 23:00:52

我能够以与 Edward 相同的方式或多或少地使其工作,并添加一些内容:

  1. 将 ImageMagick 安装到 c:\Imagick6 ->选择此路径的文件夹名称不超过 8 个字符
  2. 如果您有以前的版本,请确保从路径中删除旧版本,并且 c:\Imagick6 位于您的 Windows 路径中(使用“echo %path 检查%" 出现提示)
  3. 编辑 config/environments/development.rb 并添加:
    Paperclip.options[:command_path] = "C:/Imagick6"
  4. 终止并重新启动开发服务器以获取新配置
  5. 您甚至可能需要重新启动 Windows 以确保选择新路径(我这样做了,无法验证是否有帮助)

I was able to get it working more or less in the same way as Edward, with some additions:

  1. Installing ImageMagick to c:\Imagick6 -> chose this path to have a folder name of not more than 8 chars
  2. If you have a previous version, make sure that you remove that old version from the path and that c:\Imagick6 is in your Windows path (check with "echo %path%" on prompt)
  3. edit config/environments/development.rb and add:
    Paperclip.options[:command_path] = "C:/Imagick6"
  4. Kill and restart the dev server to pick up the new config
  5. You might even need to restart Windows to make sure the new path is picked up (I did, could not verify whether that helped)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文