Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

/usr/bin/ruby: bad interpreter: No such file or directory

I am using capistrano for deployment of rails application. But while i am deploying my rails code into server i am getting following error.

The deploy has failed with an error: Exception while executing on host 00.00.00.00: bundle exit status: 126
bundle stdout: /home/rod/.rvm/scripts/set: /usr/local/bin/bundle: /usr/bin/ruby: bad interpreter: No such file or directory
/home/rod/.rvm/scripts/set: line 19: /usr/local/bin/bundle: Success

How can i solve this issue?

like image 367
Jagadish Avatar asked Sep 26 '16 13:09

Jagadish


2 Answers

It's an issue related to ruby upgrade but bundle package path was old. To resolve it you should reinstall the bundler package again using gem.

Uninstall from system

sudo gem uninstall bundler

Install again

sudo gem install bundler
like image 194
Raju Ram Avatar answered Nov 13 '22 20:11

Raju Ram


After MacOSX High Sierra update got this issue. High Sierra updates 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

insert your password it will update your xcpretty to ruby v2.3 & that will resolve the issue. Restart Xcode & do fresh clean build it works for me. Hope it helps!!!

like image 1
Piyush Avatar answered Nov 13 '22 18:11

Piyush