Typed in "ruby -version" in terminal and got an error after switching bootdisk from HD to SSD. How do I resolve this? - ruby-on-rails

Installed a 2nd HD(SSD) on my MBP 15" and cloned all my files into it except the "User" folder. Deleted all the files I cloned from my original HD and left the users there and booted up my computer using SSD. Everything works, except when I check my ruby version, I get the following spilling out:
$ ruby -version
dyld: Library not loaded: /Users/jb/.rvm/rubies/ruby-2.1.0/lib/libruby.2.1.0.dylib
Referenced from: /Volumes/HardDrive/Users/jb/.rvm/rubies/ruby-2.1.0/bin/ruby
Reason: image not found
Trace/BPT trap: 5
What's going on here and how would I go about solving this?

On OS X binaries (such as ruby) contain the full path of the shared libraries they use, so when you run ruby it's trying to load libruby from that path - it doesn't know that the entire volume has been mounted at a different path
The easiest thing is probably to reinstall ruby - rvm reinstall ruby-2.1.0 should do it
In theory you should be able to use install_name_tool to rewrite the shared library paths in the binaries but it is almost certainly more trouble than it's worth.

Related

No `typer` after building and installing Erlang/OTP

I built and installed OTP-20.2.2 on Fedora 27 following the instructions.
After installation, however, there doesn't seem to be a typer executable. Everything else (erl, dialyzer, etc.) seems to be there.
brew install erlang on a Mac also doesn't give a typer executable.
Does something special need to be done to get typer?
Since OTP-20, you should find the executable file : typer.beam in the directory erl9.X/lib/dialyzerY-Z/ebin. In previous versions it was in its own directory.

NCO, Library not loaded

I am trying to run the NCO executable ncks in the terminal window. I found that I needed to create a .bashrc file to initially get started in addition to installing NCO from MacPorts. Now when I run ncks I get this error.
dhcp-v219-194:~ mlaf$ ncks
dyld: Library not loaded: #rpath/libssh2.1.dylib
Referenced from: /Users/matthewlaffin/anaconda/bin/ncks
Reason: image not found
Trace/BPT trap: 5
I am new to terminal and NCO but I have read that there could be an error in the path name which results in NCO not being able to find the Library. Does anyone have any insight into how to fix this?
The error message is from (ana)conda, not from MacPorts, because the ncks executable /Users/matthewlaffin/anaconda/bin/ncks is in your (ana)conda directory, and it is trying to find an (ana)conda library that apparently not installed. Not sure why. See this issue for a possible solution.
If you did not have (ana)conda installed, then presumably your default NCO would be from MacPorts, and the MacPorts installation works so long as your PATH and LD_LIBRARY_PATH are correctly set.

Updating a dylib to reference correct versions of other dylibs (Homebrew)

I'm trying to build a program that uses QT and OpenCV. It compiles correctly, but when I run the application I get:
Starting /Users/Me/MyApp/Contents/MacOS/Foo...
dyld: Library not loaded: /usr/local/lib/libavformat.54.29.104.dylib
Referenced from: /usr/local/lib/libopencv_highgui.2.4.3.dylib
Reason: image not found
The program has unexpectedly finished.
/Users/Me/MyApp/Contents/MacOS/Foo exited with code 0
I've had a look in my /usr/local/lib, the files are properly linked there, the issue is that libav is now at a higher version and opencv doesn't reflect this (e.g. looking at the opencv dylib in a hex editor I see that it wants what it says above, but what's actually in my lib folder is e.g. version 54.59.106. I've tried runnning brew update/upgrade and relinking everything, but no luck.
I can make a quick fix by copying the offending dylibs and renaming them to older versions. This does cause the program to open correctly, but it's a bit of a hack.
Obviously I could probably fix this with a reinstall of the relevant libraries, but that takes precious time.. from this thread it seems like the only option, but I don't know if that's been fixed yet: https://github.com/mxcl/homebrew/issues/11832
Seems like the only way to fix this was to run:
brew rm ffmpeg && brew install ffmpeg
brew rm opencv && brew install opencv
Probably didn't need to repour ffmpeg, but I didn't see any harm in it. Turns out this happens sometimes when a package updates to a major new version and the other package hasn't also been updated yet.

rails 3 paperclip imagemagick problem

I have been trying to get paperclip working for a few days now with no luck! From what I am aware this error below is related to imagemagick. I have tried to uninstall and install imagemagick both with macports and manually. Also, have Paperclip.options[:command_path] = "/usr/local/bin" set. It's starting to drive me nuts!
Photo /var/folders/A7/A7X8PAnOFsCTHkFpeODoO++++TI/-Tmp-/stream,65411,0.jpeg is not recognized by the 'identify' command.
I'm running snow leopard.
This appears when I run the rails server..
"/Users/michaelorcutt/shudder/vendor/plugins/paperclip/lib/paperclip.rb:50: warning: already initialized constant VERSION"
I've seen this problem when I was configuring ImageMagick for Rails 3 on OSX. After installing ImageMagick from mac ports and then the binary things still didn't work correctly. What finally did the trick ? finding the location of the identify binary.
which identify
put that path into your :
Paperclip.options[:command_path] =
And it should finally work.
Here is the list of things that needs to be checked for error "NotIdentifiedByImageMagickError":
Ensure that Imagemagick is installed on your system and its in the ENV path
try the command $ which identify Or $which convert.
For Ubuntu its usally in /usr/local/bin or /usr/bin.
Note the path of the above command and update the config/environments/development.rb (if
you are working in dev mode) with the following line.
Paperclip.options[:command_path]= '/usr/bin'
Incase, if you are still facing the issue check the installation of ImageMagick. If you installed from the source, the may be try packaged installation ( sudo apt-get install imagemagick)
~arunky
I currently use Paperclip, ImageMagick from macports in my Snow Leopard and havent seen that issue, are you sure that file is jpg? Try renaming it to jpg (it would be stupid, but you have to rule out everything).
Try opening several of your JPG files in a text editor, and open that one and see if the first 4 characters match (or better yet do it in a binary editor). Maybe it is a file your operating system or other software recognizes as image, but is not an actual jpg and ImageMagick is confused.

Can't install ruby 1.9.1 on MacOSX 10.6

I can't seem to be get Ruby installed on my Mac. These are the steps I've taken so far:
Downloaded the package from Ruby's site (http://www.ruby-lang.org/en/downloads/)
Unpacked it running { tar xzvf ruby-1.9.1-p376.tar.gz }
Went into the new ruby folder, and configured using {./configure}
This is where the error happens. When I run the configure, it gives me the error:
/usr/local/include/fuse/fuse_common.h:32:2: error: #error Please add -D_FILE_OFFSET_BITS=64 to your compile flags!
In file included from /usr/local/include/fuse/fuse.h:857,
from <command-line>:0:
/usr/local/include/fuse/fuse_compat.h:69:24: error: sys/statfs.h: No such file or directory
As a result, I can't make the package nor install it. I have no idea what is wrong. Any help is greatly appreciated. Thanks!
Have you tried RVM? It lets you manage multiple versions of ruby and will take of installing them and managing any gem versions for you. It's pretty magic!
After you've installed it all you need to do is:
`rvm install 1.9`
Done!
If the last line of configure output is
config.status: creating Makefile
then you have a makefile and you can try building it.
I got the fuse.h error, and just ran make to build a working ruby:
[neilk#maczombie ~]$ ruby --version
ruby 1.9.1p376 (2009-12-07 revision 26041) [i386-darwin10.2.0]
Looks like others have run into this issue.
If you want need the binary, you could try rubyosx.
I guessing that the issue is that you have FUSE (or MacFUSE) installed in /usr/local and for whatever reason, the configure phase is doing something that's including it. If you're not trying to build ruby with some local extensions, but you want to build ruby yourself, try moving aside /usr/local (at least temporarily).
sudo mv /usr/local /usr/local.aside
(Beware, randomly messing with /usr and /usr/local directories can lead to trouble.)
What happens if you set C_Flags or CPP_Flags before doing your ./configure?
This isnt ananswer so much as a suggested alternative... use macports :-)

Resources