Identify error Paperclip and Imagemagick - ruby-on-rails-3

I recently upgraded to osx 10.8 (Mtn Lion) and now I am having problems with Imagemagick. I get the following error when I try to upload a file:
Command :: identify -format %wx%h '/var/folders/nd/1cw0mqzj0nb3jv8psz_ht9cr0000gn/T/2011Spring20120803-530-2nr1jn.jpg[0]'
[paperclip] An error was received while processing: #<Paperclip::Errors::NotIdentifiedByImageMagickError: /var/folders/nd/1cw0mqzj0nb3jv8psz_ht9cr0000gn/T/2011Spring20120803-530-2nr1jn.jpg is not recognized by the 'identify' command.>
Command :: identify -format %wx%h '/var/folders/nd/1cw0mqzj0nb3jv8psz_ht9cr0000gn/T/2011Spring20120803-530-2nr1jn.jpg[0]'
[paperclip] An error was received while processing: #<Paperclip::Errors::NotIdentifiedByImageMagickError: /var/folders/nd/1cw0mqzj0nb3jv8psz_ht9cr0000gn/T/2011Spring20120803-530-2nr1jn.jpg is not recognized by the 'identify' command.>
I uninstalled / reinstalled homebrew and imagemagick. I even added the rmagick gem (which I didn't need before) but still get the above error.
brew install imagemagick
Error: imagemagick-6.7.7-6 already installed
Here is brew doctor output:
brew doctor
Warning: Setting DYLD_LIBRARY_PATH can break dynamic linking.
You should probably unset it.
Warning: You have uncommitted modifications to Homebrew's core.
Unless you know what you are doing, you should run:
cd /usr/local && git reset --hard
Warning: /usr/bin occurs before /usr/local/bin
This means that system-provided programs will be used instead of those
provided by Homebrew. The following tools exist at both paths:
xml2-config
xmlcatalog
xmllint
xslt-config
xsltproc
Consider amending your PATH so that /usr/local/bin
occurs before /usr/bin in your PATH.
I even added the following to my config/environments/development.rb file
Paperclip.options[:command_path] = "/usr/local/bin"
I uninstalled Imagemagick again and reinstalled it. Now I get the following link errors.
==> Installing imagemagick dependency: jpeg
dyld: DYLD_ environment variables being ignored because main executable (/usr/bin/sudo) is setuid or setgid
==> Downloading http://www.ijg.org/files/jpegsrc.v8d.tar.gz
Already downloaded: /Library/Caches/Homebrew/jpeg-8d.tar.gz
==> ./configure --prefix=/usr/local/Cellar/jpeg/8d
==> make install
Error: The linking step did not complete successfully
The formula built, but is not symlinked into /usr/local
You can try again using `brew link jpeg'
==> Summary
/usr/local/Cellar/jpeg/8d: 18 files, 1.3M, built in 16 seconds
==> Installing imagemagick dependency: libtiff
dyld: DYLD_ environment variables being ignored because main executable (/usr/bin/sudo) is setuid or setgid
==> Downloading http://download.osgeo.org/libtiff/tiff-4.0.2.tar.gz
Already downloaded: /Library/Caches/Homebrew/libtiff-4.0.2.tar.gz
==> ./configure --prefix=/usr/local/Cellar/libtiff/4.0.2
==> make install
Error: The linking step did not complete successfully
The formula built, but is not symlinked into /usr/local
You can try again using `brew link libtiff'
==> Summary
/usr/local/Cellar/libtiff/4.0.2: 241 files, 3.6M, built in 24 seconds
Error: You must `brew link jpeg' before little-cms can be installed
When I type brew link jpeg
Error: No such file or directory - /usr/local/Cellar/jpeg/8c
When I type brew link libtiff
Error: No such file or directory - /usr/local/Cellar/libtiff/3.9.5
So in summary the links are looking for older versions of jpeg (8c instead of 8d) and libtiff (3.9.5 instead of 4.0.2)
Any ideas on how to fix this?

I was able to finally fix it with 2 commands. Simple symbolic link, seems pretty hackish...
jpeg fix
cd /usr/local/Cellar/jpeg
ln -s 8d 8c
libtiff fix
/usr/local/Cellar/libtiff
ln -s 4.0.2 3.9.5

Related

rbenv install 2.6.3 BUILD FAILED

I want to use rbenv for first time, install it and initialize it, after using rbenv install 2.6.3 (this version is in my list. rbenv install --list) I have BUILD FAILED (error about clang3.0 and gcc-4.0) how can I fix it? thank you.
I tried brew update and upgrade and git clone on my rbenv list for 2.6.3 and it is ok, and with gcc --version I get:
Apple LLVM version 10.0.0 (clang-1000.10.44.4)
rbenv install 2.6.3
ruby-build: using openssl from homebrew
Downloading ruby-2.6.3.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.3.tar.bz2
Installing ruby-2.6.3...
ruby-build: using readline from homebrew
BUILD FAILED (OS X 10.13.2 using ruby-build 20190615-7-g0e9094b)
Inspect or clean up the working tree at /var/folders/r2/1kkj8jmd5cz_hcl22vs96pzm0000gn/T/ruby-build.20190720165009.5566
Results logged to /var/folders/r2/1kkj8jmd5cz_hcl22vs96pzm0000gn/T/ruby-build.20190720165009.5566.log
Last 10 log lines:
/var/folders/r2/1kkj8jmd5cz_hcl22vs96pzm0000gn/T/ruby-build.20190720165009.5566/ruby-2.6.3 /var/folders/r2/1kkj8jmd5cz_hcl22vs96pzm0000gn/T/ruby-build.20190720165009.5566 ~
checking for ruby... /usr/local/bin/ruby
tool/config.guess already exists
tool/config.sub already exists
checking build system type... x86_64-apple-darwin17.3.0
checking host system type... x86_64-apple-darwin17.3.0
checking target system type... x86_64-apple-darwin17.3.0
./configure: line 3491: /usr/bin/gcc-4.0: No such file or directory
configure: error: clang version 3.0 or later is required
make: *** No targets specified and no makefile found. Stop.
Fix: RUBY_CFLAGS="-Wno-error=implicit-function-declaration" rbenv install 2.6.3

error in bazel/ tensorflow installation 'external:io_bazel_rules_closure: no such attribute 'urls' in 'http_archive' rule.'

Hi all I am trying to install tensor flow with GPU compatibility using this guide "guide 1" and guide 2 on ubuntu pc (cuda 8). I am stuck at installing tensorflow,
when I use ./configure, I getting this error
ERROR: /home/krishna/tensorflow/WORKSPACE:3:1: //external:io_bazel_rules_closure: no such attribute 'urls' in 'http_archive' rule.
ERROR: /home/krishna/tensorflow/WORKSPACE:3:1: //external:io_bazel_rules_closure: missing value for mandatory attribute 'url' in 'http_archive' rule.
ERROR: com.google.devtools.build.lib.packages.BuildFileContainsErrorsException: error loading package '': Encountered error while reading extension file 'closure/defs.bzl': no such package '#io_bazel_rules_closure//closure': error loading package 'external': Could not load //external package.
I am new to ubuntu, after reading a lot I understood that, the error has something to do with "version of bazel" (for version above 0.3.1 it does not apper).
When I use the command
$bazel version
Build label: 0.3.0
Build target: bazel-out/local-fastbuild/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Fri Jun 10 11:38:23 2016 (1465558703)
Build timestamp: 1465558703
Build timestamp as int: 1465558703
when i use
$ sudo apt-get install bazel
Reading package lists... Done
Building dependency tree
Reading state information... Done
bazel is already the newest version (0.4.5).
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
and
upgraded it using $ sudo apt-get upgrade bazel. Finally I tried
$ bazel version
Build label: 0.3.0
Build target: bazel-out/local-fastbuild/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Fri Jun 10 11:38:23 2016 (1465558703)
Build timestamp: 1465558703
Build timestamp as int: 1465558703
which shows me that I am at version 0.3.0. I even tried compiling tensorflow again,which gave me the same above error.
It looks like you have two versions of Bazel on your system (0.3.0 and 0.4.5). You can see what the current binary is by running which bazel. You can find all of the bazels on your system by running:
$ updatedb # This will take a while.
$ slocate bazel
Assuming this returns something like:
/etc/bazel/bin/bazel
/usr/bin/bazel
you can figure out which bazel is the "right" one (0.4.5) by running /usr/bin/bazel version etc. for each bazel slocate finds.
Once you find the right bazel, you want that to be the default, so you have to make sure Linux searches for Bazel in that directory first. If the right bazel is /usr/local/bin/bazel, you'd run:
$ export PATH="/usr/local/bin:$PATH"
Then you should be able to call "bazel" normally and your system will find the "right" one (you can also delete any old ones you find).
Alternatively, you can install Bazel using the installer which will tell you what directory it got installed in.

Unable to install therubyracer on clean install of Yosemite and clean version of ruby

There are many people with similar issues and I've been one of them in the past on other machines and none of the solutions out there appear to work -- I also appear to have different error than others who have similar problems:
Building native extensions. This could take a while...
ERROR: Error installing therubyracer:
ERROR: Failed to build gem native extension.
/Users/username/.rvm/rubies/ruby-2.0.0-p353/bin/ruby -r ./siteconf20150412-25981-y7cvt6.rb extconf.rb
checking for main() in -lpthread... yes
checking for main() in -lobjc... yes
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling accessor.cc
clang: warning: argument unused during compilation: '-rdynamic'
In file included from accessor.cc:1:
In file included from ./rr.h:6:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/vector:265:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/__bit_reference:15:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/algorithm:628:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/memory:604:
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/iterator:341:10: fatal error: '__debug' file not found
#include <__debug>
^
1 error generated.
make: *** [accessor.o] Error 1
make failed, exit code 2
Gem files will remain installed in /Users/ecnalyr/.rvm/gems/ruby-2.0.0-p353#canopy/gems/therubyracer-0.12.2 for inspection.
Results logged to /Users/ecnalyr/.rvm/gems/ruby-2.0.0-p353#canopy/extensions/x86_64-darwin-14/2.0.0/therubyracer-0.12.2/gem_make.out
When running:
gem install therubyracer -v '0.12.2'
or simply
bundle install
with therubyracer included in my gemfile.
I'm running Yosemite 10.10.3, Ruby 2.0.0-p353, I have uninstalled everything and tried the gem install libv8 -- --with-system-v8 solution that comes up frequently with these kind of problems, but have found no resolution.
Creating a temporary file '__debug' solved this issue for me.
Run this command in terminal:
echo '#define _LIBCPP_ASSERT(x, m) ((void)0)' | sudo tee -a /Library/Developer/CommandLineTools/usr/include/c++/v1/__debug > /dev/null
I was able to solve this by re-installing Command Line Tools for XCode 6.2 (instead of those for XCode 6.3).
There's more discussion in Stack Overflow 29529455.

json gem won't install on Windows

Here is the error I keep getting. I installed DevKit and followed all the instructions.
gem install json -v '1.6.3'
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing json:
ERROR: Failed to build gem native extension.
"C:/Program Files/Ruby/Ruby192/bin/ruby.exe" extconf.rb
creating Makefile
make
Makefile:160: warning: overriding commands for target `C:/Program'
Makefile:153: warning: ignoring old commands for target `C:/Program'
C:/Program Files/Ruby/Ruby192/bin/ruby -e "puts 'EXPORTS', 'Init_parser'" > par
ser-i386-mingw32.def
/bin/sh: C:/Program: No such file or directory
make: *** [parser-i386-mingw32.def] Error 127
Gem files will remain installed in C:/Program Files/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/json-1.6.3 for inspection.
Results logged to C:/Program Files/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/json-1.6.3/ext/json/ext/parser/gem_make.out
Does anyone have a solution to this?
Just ran into this as well. Via Installing dm-types on Windows. (Win7 x64): this fixed it:
It looks the the spaces in the path for ruby are screwing up the makefile. Maybe try creating a symlink on Windows temporarily, like:
mklink /d c:\ruby "C:\Program Files (x86)\Ruby\Ruby193"
and then try installing with c:\ruby\bin\ruby.exe. You can delete the symlink after installing.

getting a could not resolve host error when trying to install RVM on osx lion

I have all the prereq's installed.. I am on osx lion 10.7.2
xcode:
$ xcodebuild -version
Xcode 4.2.1
git:
$ git --version
git version 1.7.5.4
when i run
$ bash < <( curl -s https://rvm.beginrescueend.com/install/rvm )
i get the following error:
curl: (6) Could not resolve host: HD; nodename nor servname provided,
or not known Could not download
'https://github.com/wayneeseguin/rvm/tarball/master'.
any ideas why? If i run as sudo it goes through but then i get more errors... Need this to install as single user. path to my home dir is:
'/volumes/Macintosh HD/users/mikedevita'
It seems like the file brew is referring to has moved, hence you are looking for a dead link.
I got past this issue by running 'brew update' in the terminal.
After letting this run, and after brew updates to the latest version it should have the latest directories and files, and as a result should avoid dead links. You should be free to continue as normal now.