I'm trying to get a Ruby on Rails project running on my Mac OS Sierra (10.13.3) machine. When I navigate to the Rails folder, RVM tells me the following:
Required ruby-1.9.3-p392 is not installed.
To install do: 'rvm install "ruby-1.9.3-p392"'
However, when I do that install, I get the following:
$ rvm install "ruby-1.9.3-p392"
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.13/x86_64/ruby-1.9.3-p392.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Installing requirements for osx.
Updating system..........
Installing required custom packages: homebrew/versions.
Error running 'requirements_osx_brew_install_custom homebrew/versions',
please read /Users/petercormack/.rvm/log/1518211184_ruby-1.9.3-p392/install_custom.log
Requirements installation failed with status: 1.
When I look at that log file, I see the following:
[2018-02-09 12:36:30] requirements_osx_brew_install_custom
requirements_osx_brew_install_custom ()
{
\typeset __tap;
for __tap in "$#";
do
brew tap "${__tap}" || return $?;
done
}
current path: /Users/petercormack/podcastsi18n
PATH=/usr/local/opt/qt#5.5/bin:/Users/petercormack/.node/bin:/usr/local/bin:/Applications/Postgres.app/Contents/Versions/latest/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/petercormack/.rvm/bin:/usr/local/Cellar/openssl/1.0.2j/bin/openssl
command(2): requirements_osx_brew_install_custom homebrew/versions
+ typeset __tap
+ for __tap in '"$#"'
+ brew tap homebrew/versions
Error: homebrew/versions was deprecated. This tap is now empty as all its formulae were migrated.
+ return 1
So. RVM seems to be stuck on this idea of installing homebrew/versions, which has been completely removed by Homebrew. I've updated Homebrew. I've updated RVM. I've tried to trick Homebrew into having that tap available (not successful). I've tried to trick RVM into thinking that's not a required custom package (couldn't figure out how). Nothing seems to be working. Help!
EDIT
I got around the problem by actually upgrading the project to use ruby-2.1.0 . Worked like a charm, but of course didn't actually resolve the original issue. Thank you for the answers below, and hopefully they'll help out some other poor soul in the same situation!
I tripped up on this as well. While it's not a final answer with the help of a kind soul on Github I was able to find a temporary solution to this issue.
If you are running macOS 10.10 or later then you should run brew install gcc49. This will help RVM as it now won't try to tap the deprecated homebrew versions repository. If you are on an earlier version have a look at this function in RVM for the appropriate version of gcc to install.
I have documented the issue I was encountering over here:
https://github.com/rvm/rvm/issues/4303
Had the same problem. This happens only when installing a ruby version older than 2.0. I was able to get past this using rvm autolibs read-only then install the ruby again. This will tell rvm to use existing dependencies and to skip the error if something is missing. Just then try to manually install all the required packages using Brew.
https://rvm.io/rvm/autolibs
I had the same problem when I tried to install Ruby 3.0 . For me just updating RVM to the latest version fixed the issue:
rvm get stable
Related
After upgrading to Big Sur I am getting errors running my Ruby server rotating through different files either with
cannot load such file --
or
Interrupted system call --
These errors rotate various files each time I run bundle exec rackup. I have tried uninstalling/reinstalling RVM, XCode Command Line Tools, and even tried switching to rbenv. Same outcome.
Any ideas?
It seems to get solved by uninstalling Kaspersky.
Also, it seems that the ruby applications are not the only ones facing this issue.
There are other security solutions too, eg. Avira.
https://github.com/rbenv/ruby-build/issues/1710
https://github.com/dart-lang/sdk/issues/44509
I was able to solve this problem for an rbenv ruby installation after noticing a similar-ish issue listed at the end of the ruby-build wiki. Adding MAKE_OPTS=-j1 finally worked, though it took much longer; The whole build ran with one process. The final command I used (though I don't know if calling ruby-build directly was necessary):
MAKE_OPTS=-j1 RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl) --with-readline-dir=$(brew --prefix readline) --with-libyaml-dir=$(brew --prefix libyaml)" \
ruby-build --verbose 2.6.6 ~/.rbenv/versions/2.6.6/
# to hook it up with rbenv:
rbenv rehash
I know this isn't your exact problem, but perhaps re-installing ruby would help.
Not a complete resolution yet, but we did find out that the issue seems specific to the newrelic-ruby-agent and have opened an issue (https://github.com/newrelic/newrelic-ruby-agent/issues/528) with them to do further investigation.
As a workaround, we are able to run locally by setting NEW_RELIC_AGENT_ENABLED=false in the env.list
Uninstalling Avira solved the problem I was having with rbenv install 3.0.0 on macOS 11.2. (See ruby-build #1710 (comment).) Thanks to #alex for the tip.
I got this error in brew install lima
this may not look like answer, but running up that command again and again brew install lima I kept getting different errors, I ran that command 7-8 times, and was able to finally install lima.
When I try running rails console I get this error:
/Users/TuzsNewMacBook/.rvm/gems/ruby-2.3.7/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require':
dlopen(/Users/TuzsNewMacBook/.rvm/rubies/ruby-2.3.7/lib/ruby/2.3.0/x86_64-darwin18/readline.bundle, 9):
Library not loaded: /usr/local/opt/readline/lib/libreadline.7.dylib (LoadError)
A quick search got me to this post and I've tried a few things:
brew reinstall postgresql (this is indeed the DB for this project)
and
cd /usr/local/opt/readline/lib
ln libreadline.8.0.dylib libreadline.6.2.dylib
(my version of readline is 8)
and
brew link readline --force
But none of these have fixed it.
I recently added pry-coolline, guard and guard-livereload gems to my project if that makes any difference (rails console loaded fine before those). I'm running on the latest macos.
(Update) I’m using pry rails as my rails console, if that makes any difference.
Any help? Thanks.
the error seems to be thrown when searching for /usr/local/opt/readline/lib/libreadline.7.dylib.
Have you tried to symlink that?
So something like:
cd /usr/local/opt/readline/lib
ln -s libreadline.8.0.dylib libreadline.7.dylib
Just tried that on macOS Mojave, ruby 2.5.3p105 and Rails 5.2.2 and worked.
Reinstalling my Ruby version seems to have fixed it:
rvm reinstall 2.3.7
can you try
cd /usr/local/opt/readline/lib
ln -s libreadline.8.dylib libreadline.7.dylib
you are on the right track but it seems like rails is looking for libreadline.7.dylib and libreadline.7.dylib is not there in the folder.
Yes, the best answer is to reinstall.
You can get the version easily by typing:
ruby -v
With rbenv, the command is i.e.:
rbenv install 2.3.7
with rvm:
rvm reinstall 2.3.7
A very simple solution that doesn't involve rebuilding your RVM gemset OR sym-linking libraries.
Add to your Gemfile:
gem 'rb-readline'
If you are doing bundler groups
group :development do
gem 'rb-readline'
end
Then run
> bundle
Let me know if that doesn't work.
Most often in Ruby-applications, this is caused by gems that have extensions (the gems saying "Building native extensions.."), that are built using a specific version of, in this case, readline.
Basically, there are two solutions:
Either, you can symlink version 8 of the gem, to the version missing. This will work in many cases, but if backwards compatibility is broken, it will not.
Or, if the gem actually supports version 8, you can reinstall that specific gem, or "pristine" it by running gem pristine --all.
EDIT: In scope of your "what I've tried", reinstalling PostgreSQL, is also one of the binaries, built using a specific version, that may also require a rebuild, to work with a system library, such as readline.
Got this issue:
dyld: Library not loaded: /usr/local/opt/mpfr/lib/libmpfr.4.dylib
doing...
cd /usr/local/opt/mpfr/lib/
ln -s libmpfr.dylib libmpfr.4.dylib
did the trick for me for macOS Catalina
Background: This has happened when I tried to install tig, but I think this is a common issue that you may have that you need to manually link the installed software into the right path that another software wants.
If you can not find readline installed on your Mac, you should run
brew install readline
After you installed deadline, brew will ask you to link it. But actually you can not link by running
brew link readline
Even you can not link by running
sudo brew link readline
Mac OS will warn you this is extremely dangerous and stop you to do.
The Latest version of readline is version 8, so you will see the error message like
Library not loaded: /usr/local/opt/readline/lib/libreadline.8.dylib
The brew installed deadline at
/usr/local/Cellar/readline/8.0.4
So you have to manually link it to the place that your software wants by using command ls
ln -s /usr/local/Cellar/readline/8.0.4 /usr/local/opt/readline
Enjoy!
So Ive checked a few answers here but I dont think they can work with a vanilla Mojave mac install. Im using 10.14.4 while I did these:
get homebrew from https://brew.sh
$ brew install coreutils : this installs the gnu coreutils pkg for mac, we want the greadlink from this because macOSX's readlink is not the same as the gnu readlink. Its extremely confusing but such is the life in macland.
$ echo 'alias readlink=greadlink' >> ~/.bash_aliases I found macs readlink to be a bit lacking so I overrode the existing readlink by aliasing greadlink. (you can make this usable by all users by $ alias readlink=greadlink >> /etc/bashrc which will enable every user to be able to use it.
$ ln -s /usr/local/opt/readline/lib/libreadline.8.dylib /usr/local/opt/readline/lib/libreadline.7.dylib I linked the already linked .8. file instead of '.8.0.' file because if it were to get updated to .8.1. then my readlink wont break or miss features on the library. Im pretty sure we will format our macs before 9+ comes out.
I would recommend against manually symlink'ing native libraries. Aas of OS X 10.4, the standard include library path /usr/include is no longer used and is locked by SIP (making it difficult to move things to).
Apple ships a “legacy installer” for you to be able to install the headers in the “old location”, which will also resolve your path to correctly find headers installed via brew.
cp /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg ~/Desktop && open ~/Desktop/macOS_SDK_headers_for_macOS_10.14.pkg`
See here for a detailed write-up on what is going on.
My problem was just the same when running lftp.
Just running brew upgrade has solved my problem, as it has updated (among others):
readline 8.0.0_1 -> 8.0.1
lftp 4.8.4 -> 4.8.4_2
I am trying to install the rmagick gem. When I run "gem install rmagick" it gives me the following error:
In file included from rmagick.c:13:
./rmagick.h:1210:51: error: unknown type name 'MagickPixelPacket'
extern void Color_to_MagickPixelPacket(Image *, MagickPixelPacket *, VALUE);
followed by a few similar complaints about missing methods and incorrect parameters(I can post the rest if they seem helpful).
To me, this seems like a version problem, which makes sense because I had ImageMagick 6 installed as well as version 7, so I uninstalled version 6 but the problem persists.
I also had to symlink the following for rmagick to find the required .h files, in case that's significant:
ln -s /usr/local/include/ImageMagick-7/MagickCore /usr/local/include/magick
ln -s /usr/local/include/ImageMagick-7/MagickWand /usr/local/include/wand
I'm on a Macbook, installing things with brew. My current ImageMagick version is 7, but I'm suspicious of some leftover version 6 things causing problems.
Any thoughts? I'm happy to give more information if necessary, but I can't think of anything else at the moment.
Each distribution manages the Ruby gems it's own way, ex :
Debian requires the installation of libmagickwand-dev for this gem
What you whant to look for is see if the gem requires additionnal dependencies or not on Mac ( had similar problems with bundle on Debian )
Thanks to Brad and Matthieu for your suggestions! MiniMagick does seem like a good solution, and Matthieu is definitely right about there being different dependencies from system to system; in my case I ended up giving up on trying to use ImageMagick 7 with RMagick, but I did get it to work with ImageMagick 6. Here's what worked for me:
brew remove imagemagick
PKG_CONFIG_PATH=/usr/local/opt/imagemagick#6/lib/pkgconfig
brew install imagemagick#6
gem install rmagick
Many thanks to this SE post: https://stackoverflow.com/a/41788501/5054505
For the record, I am on OSX Yosemite
Also, see this RMagick issue: https://github.com/rmagick/rmagick/issues/256.
Hopefully this will be fixed soon, but for now it seems like reverting to version 6 is the popular approach.
I'm getting this error when I try to run any brew command.
Holger-Sindbaeks-MacBook-Air:~ holgersindbaek$ brew help
-bash: /usr/local/bin/brew: /usr/bin/ruby: bad interpreter: No such file or directory
I have absolutely no idea on how to fix this and been searching for a long time without answer.
I got this error (much the same):
/usr/local/bin/brew: /usr/local/Library/brew.rb: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby: bad interpreter: No such file or directory
/usr/local/bin/brew: line 26: /usr/local/Library/brew.rb: Undefined error: 0
and fixed by the solution below:
Open brew.rb:
$ sudo vim /usr/local/Library/brew.rb
Change the first line's 1.8 to Current:
Before:
#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -W0
After:
#!/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby -W0
Then brew works for me. Hope it helps if any other one got this issue. :)
If you get the error
Homebrew requires Leopard or higher. For Tiger support, see:
https://github.com/mistydemeo/tigerbrew
change the MACOS check from <10.5 to <10.
Tip by #TimCastelijns:
10.5 doesn't work because in comparison, it's higher than 10.10 (.1 vs .5). I added a check (and MACOS_VERSION != 10.10) instead of lowering from 10.5 to 10.
What you are getting means that Homebrew has not been able to locate the Ruby interpretter at the specified location.
Install Apple Developer Kit (comes with Xcode) which should be available to you as an optional install (or you can simply download it from Apple). This will install the Ruby interpreter for you.
In case you already have Xcode installed, this means that one of these things is happening:
You have a broken Ruby installation
You have more than one Ruby installation
Your installation has not been configured properly.
To identify if this is the first case, you can run ruby and see if you get any response.
If you don't, your installation is broken and you need to reinstall it. If you do, you then run which ruby. This should give you the absolute path to your Ruby executable. If this is anything other than /usr/bin/ruby then homebrew (and a bunch of other programs) will not be able to find it.
In case you have not ever tampered with your Ruby installation, you can check to see if /usr/bin/ruby already exists or not: cat /usr/bin/ruby. If you get No such file or directory, then you can easily create a symbolic link to your Ruby installation. Assuming the output of which ruby to by /usr/local/bin/ruby, you create the symbolic link this way: sudo ln -s /usr/local/bin/ruby /usr/bin/ruby and all should be well.
If there is a file at that location, you can run file /usr/bin/ruby to see if it's a real file, a symbolic link, or a corrupted file. If it is a symbolic link, your installation should be working, and since it's not, it probably is either a corrupted symlink or it's a bogus file.
You can remedy that by first deleting it (sudo rm /usr/bin/ruby) and then creating a new symlink to the correct location (sudo ln -s /usr/local/bin/ruby /usr/bin/ruby).
If non of the above works, you should consult the homebrew team after a clean install of Xcode and removing any traces of a Ruby installation on your system.
EDIT
Alternatively, as pointed out by the other answers, the issue might be because of a bad ruby version in your Homebrew settings.
A quick fix might be updating your Homebrew:
cd /usr/local
git pull -q origin refs/heads/master:refs/remotes/origin/master
If this does not help, you might want to get your hands dirty and manually fix the problem by:
Editing brew.rb from /user/local/Library/brew.rb
Changing /1.8/ to /Current/ in the first line, which will cause the hashbang to point to the current Ruby version as the executor
If this does not help, either, you can also modify the MACOS check and change it from 10.5 to 10 to avoid the infamous "Homebrew requires Leopard or higher" error.
DISCLAIMER
A bunch of thanks to other contributors in the answers below and their commenters. I am not committing plagiarism, simply aggregating the answers into one integrated article to help others.
Fix:
sudo gem install cocoapods
At the risk of oversimplifying things, try running
gem install bundler
I was transitioning my Ruby environment from RBENV to RVM and it worked for me.
This happened because I needed to update brew - in the updated version it already uses Current ruby
cd /usr/local
git pull -q origin refs/heads/master:refs/remotes/origin/master
This solved the problem
You need to change the path for Ruby.Framework
I solved it with commands as mentioned.
brew install cocoapods --build-from-source
brew link --overwrite cocoapods
If you have a lower version below Xcode 11, you have to remove it before you use the above commands.
Reference: Ruby Framework issue
None of the above worked for me, so I kept browsing and found this answer,
https://stackoverflow.com/a/24225960/1359088
which did fix brew for me. He says in step 1 to install XCode 6 command line tools, but doesn't say how; use this command:
xcode-select --install
I got the same issue when updated to MacOSX High Sierra & using Xcode 9 with that. High Sierra update ruby gem to version 2.3 but xcpreety command of Xcode 9 still using Ruby 2.0 which is unable to find now & gives bad interpreter.
Just go to Terminal & run
sudo gem install xcpretty
Restart Xcode & do fresh clean build it works for me.
Hope it helps!!!
After upgrading to macOS High Sierra, get it fixed with following commands:
sudo gem install cocoapods
In my case seems like fastlane installed incorrectly with brew install fastlane system didn't write correct path to fastlane. I fixed it with alias fastlane=~/.fastlane/bin/fastlane
I solved it with commands as mentioned.
1.) Uninstall your GEM.
gem unistall GEM
2.) Then Install your GEM.
sudo gem install GEM -n /usr/local/bin
I got bad interpreter: No such file or directory error when used xcpretty and xcpretty-travis-formatter on upgraded MacOS.
To solve it
gem install xcpretty
gem install xcpretty-travis-formatter
That is why I can recommend you to reinstall failed component gem install <name>
#For example error looks like
/usr/local/bin/xcpretty-travis-formatter: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby: bad interpreter: No such file or directory
#use
gem install xcpretty-travis-formatter
I'm having big trouble in configuring Ruby and MySQL on MacOSX. Just a fact, I'm new on MacOSX and Ruby On Rails.
So, first I was having problems to install mysql2 gem, after get the gem installed I was trying developer a test, and when I tried start the WEBrick got this error saying that couldn't load a MySQL lib called "libmysqlclient.18.dylib". Googlin' about the error I saw that everyone was recommending using Ruby through RVM. I installed RVM and tried install ruby 1.9.3 and get this error:
ERROR: The provided CC(/usr/bin/gcc) is LLVM based, it is not yet fully supported by ruby and gems, please read rvm requirements.
I'm almost giving up learn Rails, setup a development environment shouldn't be that painful. On Windows I got no problems.
Unfortunately, you're trying Rails at a bit of a bad time. There's a lot of transition at the moment, as others have mentioned Xcode 4.2 was recently released and has a new compiler, also Ruby 1.9.3 came out.
I've been developing Ruby and Rails for some years now, but trying to get up and running again after installing Lion clean this week has been more problematic than in the past.
First, make sure RVM is up to date (as the issue should be fixed):
rvm get head
Then try installing like so:
CC=/usr/bin/gcc-4.2 rvm install 1.9.3 --enable-shared
EDIT:
Note, working through my own issues I believe the first command probably fixed the problem. The second wouldn't have provided any benefit over:
rvm install 1.9.3
As on my clean install, /usr/bin/gcc-4.2 doesn't exist.
Also I wanted to add that I ended up compiling the older GCC manually for those situations where the new compiler fails. I followed this very informative blog post.
add --with-gcc=clang as a parameter:
rvm install ruby-1.9.3 --with-gcc=clang
Did you install the latest Xcode from Mac Store?
here is a nice guide i followed to update my ruby/Rails to 1.9.2/3.0
guide
good luck
Part of the problem is that with Mac OS X 10.7 (Lion), Apple switched C compilers, and some things don't build well with the new (LLVM) compiler yet. See http://eddorre.com/posts/rails-ultimate-install-guide-on-os-x-lion-using-rvm-homebrew-and-pow for decent instructions (note: I haven't followed these exact instructions, but they're a pretty good summary of the things I did do to get Rails working on Lion).
Once you have the C compiler issue dealt with, everything else should be pretty effortless.
Bonus tip: avoid MySQL. PostgreSQL is better in nearly every respect.
Thanks Delamenko finally got it to work
SUMMARY FOR STACK OVERFLOW
I was trying to install SiriProxy on a clean Lion installation on Xcode from App Store
I kept getting errors like :
The provided CC(/usr/bin/gcc) is LLVM based.
bash-3.2$ rvm install 1.9.3
ERROR: The provided CC(/usr/bin/gcc) is LLVM based, it is not yet fully supported by ruby and gems, please read `rvm requirements`.
After 2 days finally got it working with these two lines
http://stackoverflow.com/questions/8000145/ruby-rvm-llvm-and-mysql
bash-3.2$ rvm get head
bash-3.2$ CC=/usr/bin/gcc-4.2 rvm install 1.9.3 --enable-shared
Before that I had tried every stackoverflow article on Ruby and Lion so doing these may have done some setup that helped the above 2 steps work:
Things I tried included:
Running Install Xcode.app (I had downloaded from App Store - running this does futher installation)
Installing
https://github.com/kennethreitz/osx-gcc-installer/downloads may help for installing GCC.
Set up CC in
more /Users//.bash_profile
bash-3.2$ more /Users/<USERNAME>/.bash_profile
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function
export CC=/usr/share/TargetConfigs/bin/gcc
First line came from SiriProxy install instruction
https://github.com/plamoni/SiriProxy
2nd line export CC never seemed to work. So dont add.
It had many versions each pointing
I finally used CC=/usr/bin/gcc-4.2 rvm install 1.9.3 --enable-shared
See Arkku's answer - I tried everything here first, then did what he said and all is well.
As of Lion 10.7.3, Xcode 4.2 and Ruby 1.9.3p0 it's what works.