when I run
rvm install 1.9.2
I get an error trying to run autoconf. This is the stacktrace:
kenmare:ruby-1.9.2-p0 lee$ rvm install 1.9.2-p0
/Users/lee/.rvm/rubies/ruby-1.9.2-p0, this may take a while depending on your cpu(s)...
ruby-1.9.2-p0 - #fetching
ruby-1.9.2-p0 - #extracted to /Users/lee/.rvm/src/ruby-1.9.2-p0 (already extracted)
Running autoconf
Error running 'autoconf', please check /Users/lee/.rvm/log/ruby-1.9.2-p0/autoconf.error.log
Skipping configure step, 'configure' does not exist, did autoconf not run successfully?
ruby-1.9.2-p0 - #compiling
Error running 'make ', please check /Users/lee/.rvm/log/ruby-1.9.2-p0/make.error.log
There has been an error while running make. Halting the installation.
Any ideas? Thanks!
UPDATE: Sorry it was late and didn't give some obvious info. I am on a mac running 10.6.4. The autoconf log says:
autoconf: no input file
To the answer regarding make, when I run
which make
/usr/bin/make
And I have am running 1.8.7 successfully with rvm. I only receive this problem when installing 1.9.2.
Thanks again!
This happened to me because my rvm version was old
rvm list known
wasn't showing ruby 1.9.3 as one of the options for me
I did:
rvm get head
I figured it out. The key is this line:
ruby-1.9.2-p0 - #extracted to /Users/lee/.rvm/src/ruby-1.9.2-p0 (already extracted)
Apparently if there is an error during your first attempt the directory for the 1.9.2 package is not removed. (In my case, the autoconf files were not properly downloaded.) Any subsequent attempts see the directory and does not attempt to download the package again.
You need to remove the ruby-1.9.2-p0 directory. I assume this could be a problem with any version.
Hope this helps someone else.
I just had a similar problem. In addition to what Lee did to solve, I also had to remove the corresponding ruby's tar file from .rvm/archives so it would download a fresh copy that was not corrupt/incomplete.
In my case I had to upgrade RVM. Running this in the shell took care of upgrading:
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
Related
Does anyone have had this same error before while installing ruby 2.0.0 in rails 4.0?
all this in a MAC OS X 10.8.2
Error running 'make -j4'
couldn't find any answers.
I agree with devnull, we would need a log of some sort to narrow down your problem.
Though I did just install ruby 2.0 on a mac 10.8.4 yesterday using RVM.
Try following the instructions here. That made it very simple.
FWIW, here's the process I went through. Some of the commands might be specific to my environment and you may have to adjust accordingly. This process was a mix and mash of recommendations from various sources, but also following along with whatever the output spit out. I found that I was unable to install ruby 2.0 just from following other stack overflow threads as written, so I had to improvise, somewhat. Hope this helps.
Made sure i downloaded the latest Xcode and Command Line tool (seems to be the general recommendation out there)
run 'brew doctor'
run 'brew update'
run 'rvm requirements'
run 'rvm get head'
Kept seeing this error "Can not automatically remove lines with 'rvm_autolibs_flag=' from '/etc/rvmrc', please clean it manually."
run 'rvmsudo --debug' #as recommended in terminal, but this still wasn't fixing the problem, so i tried....
run 'rvmsudo rvm get head' #because the output recommended 'prefix the command with rvmsudo to fix it'
run 'rvm requirements'
run 'rvm install 2.0.0' #error "There is no checksum for 'http://production.cf.rubygems.org/rubygems/rubygems-2.0.5.tgz' or 'rubygems-2.0.5.tgz', it's not possible to validate it.......If that does not resolve the issue and you wish to continue with unverified download
add '--verify-downloads 1' after the command."
run 'rvm reinstall 2.0.0 --verify-downloads 1'
run 'rvm default 2.0.0'
And it finally worked. My Ruby verison is now ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12.4.0].
Just got a new macbook pro and im having troubles installing rails..
I got ruby 1.8.7 already installed and when i try to write 'gem install rails' i get:
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions into the /Library/Ruby/Gems/1.8 directory.
I also tried to install a higher version of ruby and it said:
Nirs-MacBook-Pro:~ nirohayon$ rvm install 1.9.3
Fetching yaml-0.1.4.tar.gz to /Users/nirohayon/.rvm/archives
Extracting yaml-0.1.4.tar.gz to /Users/nirohayon/.rvm/src
Configuring yaml in /Users/nirohayon/.rvm/src/yaml-0.1.4.
Error running ' ./configure --prefix="/Users/nirohayon/.rvm/usr" ', please read /Users/nirohayon/.rvm/log/ruby-1.9.3-p125/yaml/configure.log
Compiling yaml in /Users/nirohayon/.rvm/src/yaml-0.1.4.
Error running 'make ', please read /Users/nirohayon/.rvm/log/ruby-1.9.3-p125/yaml/make.log
Database file /Users/nirohayon/.rvm/config/packages does not exist.
Installing Ruby from source to: /Users/nirohayon/.rvm/rubies/ruby-1.9.3-p125, this may take a while depending on your cpu(s)...
ruby-1.9.3-p125 - #fetching
ruby-1.9.3-p125 - #extracted to /Users/nirohayon/.rvm/src/ruby-1.9.3-p125 (already extracted)
ruby-1.9.3-p125 - #configuring
Error running ' ./configure --prefix=/Users/nirohayon/.rvm/rubies/ruby-1.9.3-p125 --enable-shared --disable-install-doc --with-libyaml --with-opt-dir=/Users/nirohayon/.rvm/usr ', please read /Users/nirohayon/.rvm/log/ruby-1.9.3-p125/configure.log
There has been an error while running configure. Halting the installation.
ls: /Users/nirohayon/.rvm/rubies/*/bin/ruby: No such file or directory
PLEASE help me, i used windows before and also pretty new to rails, so i dont know much about which path should i direct my terminal. i need a step by step explanation to put rails up and standing on my mac.
Thanks so much!
Nir
Your use of RVM looks a lot like you don't have the developer tools installed. Grab XCode from the App Store, the install the command line tools!
If you really want to install rails on the platform-provided ruby, all you need to do is to sudo gem install rails, for you need to use administrator privileges to isntall gems in the system gemset.
This tutorial helped me install on mac before with OS X 10.6 (I believe). The only thing that was a trouble was the C compiler, which I figured out was the problem from looking up one of the errors.
Probably you will find by looking up the output Error running 'make ', please read /Users/nirohayon/.rvm/log/ruby-1.9.3-p125/yaml/make.log by typing vi /Users/nirohayon/.rvm/log/ruby-1.9.3-p125/yaml/make.log type esc key followed by typing :q! to quit.
As previous answer suggested, you need to get a compiler. I don't know about Xcode specifics, but I tracked down an installer for GCC compiler for Mac on Github I believe but it is probably better straight from Apple packages, (tutorial here)
Also note that if you end up having to use sudo at all, you've probably gone off-track from the guide to install RVM on your system. In which case your path will be somewhere other than in the home directory and the instruction to adjust your source with echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"' >> ~/.bash_profile will not work. Which may end up being somewhere like "/usr/local/rvm/scripts/rvm"
I'm very new to OS X and RoR and ran into a few errors while following Hartl's RoR Tutorial.
I've installed Git and RVM but am getting errors while installing Ruby - and consequently can't install Ruby Gems and Rails either.
I've read the log files but can't figure out what the issue is...it seems my machine can't run make and has issues with --version. Some files don't exist either.
Much thanks for your help :)
User-MacBook-Air:~ haseebjaved$ rvm install 1.9.2
Fetching yaml-0.1.4.tar.gz to /Users/haseebjaved/.rvm/archives
Extracting yaml-0.1.4.tar.gz to /Users/haseebjaved/.rvm/src
Configuring yaml in /Users/haseebjaved/.rvm/src/yaml-0.1.4.
Error running ' ./configure --prefix="/Users/haseebjaved/.rvm/usr" ', please read /Users/haseebjaved/.rvm/log/ruby-1.9.2-p318/yaml/configure.log
Compiling yaml in /Users/haseebjaved/.rvm/src/yaml-0.1.4.
Error running 'make ', please read /Users/haseebjaved/.rvm/log/ruby-1.9.2-p318/yaml/make.log
Database file /Users/haseebjaved/.rvm/config/packages does not exist.
/Users/haseebjaved/.rvm/scripts/functions/build: line 28: --version: command not found
Installing Ruby from source to: /Users/haseebjaved/.rvm/rubies/ruby-1.9.2-p318, this may take a while depending on your cpu(s)...
ruby-1.9.2-p318 - #fetching
ruby-1.9.2-p318 - #extracted to /Users/haseebjaved/.rvm/src/ruby-1.9.2-p318 (already extracted)
ruby-1.9.2-p318 - #configuring
Error running ' ./configure --prefix=/Users/haseebjaved/.rvm/rubies/ruby-1.9.2-p318 --enable-shared --disable-install-doc --with-libyaml --with-opt-dir=/Users/haseebjaved/.rvm/usr ', please read /Users/haseebjaved/.rvm/log/ruby-1.9.2-p318/configure.log
There has been an error while running configure. Halting the installation.
/Users/haseebjaved/.rvm/scripts/functions/build: line 28: --version: command not found
You do not have any compiler installed, your best choice is osx-gcc-installer, it will provide you all tools needed for compilation.
Also be sure to not play with Xcode above 4.1 - it does not provide GCC compiler (only LLVM), and even ruby-1.9.3-p125 is not fully ready for clang(LLVM) so expect erros with it.
You can open a ticket to fix the msg to be more informative - I should be able to improve it.
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 adding ruby 1.9.2 to a Mac running 10.6.8 and hitting a problem with rvm rubygems latest. I've run the following with no problem:
$ rvm install 1.9.2
$ rvm use 1.9.2
$ ruby --version
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin10.8.0]
Then hit this error:
$ rvm rubygems latest
Removing old Rubygems files...
Installing rubygems-1.8.10 for system ...
ERROR: Error running 'GEM_PATH=":#global" GEM_HOME="" "/usr/local/rvm/rubies//bin/ruby" "/usr/local/rvm/src/rubygems-1.8.10/setup.rb"', please read /usr/local/rvm/log/system/rubygems.install.log
WARN: Installation of rubygems did not complete successfully.
ln: /usr/local/rvm/rubies//lib/ruby/gems/: No such file or directory
The obvious thing here is the extra forward-slash in the bin/ruby and lib/ruby paths. Any ideas where this is coming from and how to fix it?
Note that I've also got the following line at the end of my .bash_profile file:
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function
I'm doing all of this so that I can run Octopress. I've also got a Rails 2.3.8 project that I am developing on this same machine. This is the first time I've dealt with anything other then the system version of ruby (1.8.7).
I've had the same problem, and although I didn't really fully understood why it was happening, attacking the main symptom solved it for me.
It seems that you have already another version of ruby installed on your system. The line on the rvm rubygems script that generates the error is this:
__rvm_run "rubygems.install" \
"GEM_PATH=\"$GEM_PATH:${GEM_PATH%%#*}#global\" GEM_HOME=\"$GEM_HOME\" \"${rvm_ruby_binary}\" \"${rvm_src_path}/$rvm_gem_package_name/setup.rb\"" \
"Installing $rvm_gem_package_name for ${rvm_ruby_string} ..."
https://github.com/wayneeseguin/rvm/blob/master/scripts/rubygems#L104
I think that internally rvm is losing itself and creating paths with the double slash on it, probably because RVM is appending the RVM local dir with the output of some command similar to which ruby (or whatever the path rvm is searching for may be). I really don't know why it does that (doesn't RVM work in a system with ruby installed?).
Anyhow, to fix that in my machine I simply ran sudo aptitude purge ruby (you would of course run the MAC equivalent of that), to remove the ruby version that was messing with rvm.
If you have something related with ruby installed on your computer, I think a good idea would be to remove them all, and use RVM to manage all your ruby related goodness.
On linux (debian/ubuntu), a good approach is typing dpkg -l | grep ruby to see which packages related to ruby are installed on your machine, and then purge them all.
After that, run
$ rvm use 1.9.2
$ rvm rubygems latest
Everything should work like a charm. At least uninstalling ruby worked for me.
Hope it helps.
I just ran rvm default which allowed everything to work properly. I fields is right that rvm hasn't set something completely or at all. This has actually fixed this problem for me consistently.