Issues with Bash and NPM paths - macos

(bash newbie alert)
I'm having a hell of a time getting my dev machine up and running post clean install of 10.10.
I first attempted to install everything via homebrew. After installing Yeoman I was still getting "Yo" command not found errors. I followed these instructions http://d.pr/1hjAi on the Yeoman FAQ however I'm still getting the errors. I then realized I didn't have a .bash_profile, .bashrc or a .profile file in my home directory. I've tried adding just about every path variable I've found on line and nothing seems to fix it. On top of that, adding a path to any of the files mentioned above doesn't seem to update the path.
echo $PATH gives me
/usr/local/share/npm/bin:/usr/local/git/bin:/opt/X11/bin:/usr/local/bin:/sbin:/usr/local/share/npm/bin:/usr/sbin:/usr/local/bin/npm:/bin:/usr/bin:/Library/Frameworks/Python.framework/Versions/Current/bin:~/bin:/usr/local/sbin:/usr/local/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/share/npm/bin:/usr/local/share/npm/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
Any help would be great.

Related

idb-companion: command not found after installing via homebrew

I have installed idb-companion in line with the instructions in their docs, but when I run idb list-targets I get idb: command not found. idb-companion shows up when I brew list. I also tried installing and running the universal .tar.gz folder from their latest release, but got no where. Although I only ran that via the Finder GUI, because I wasn't sure how to execute that from the CLI.
I understand there is some homebrew path I may have to change. I have actually had homebrew issues before and so have usually resorted to installing everything via node where possible. In this case it's not, so I tried the .tar.gz file.
How can I get idb-companion to start working properly?
Most likely it is the case, your python path is not set. You need to set your python path. Faced the same issue was resolved with setting python path.

conda: command not found even though Anaconda is in path (WSL)

I've tried/checked related posts but I can't find what's stopping my Windows Subsystem for Linux from running conda.
These paths (I have verified that they are correct and exist) are in my PATH.
/mnt/c/Users/user/Anaconda3:
/mnt/c/Users/user/Anaconda3/Library/mingw-w64/bin:
/mnt/c/Users/user/Anaconda3/Library/usr/bin:
/mnt/c/Users/user/Anaconda3/Library/bin:
/mnt/c/Users/user/Anaconda3/Scripts
Note that I added the new lines so that it is more readable, the spaces aren't actually present in my PATH.
When I run conda --version on command prompt I get conda 4.7.12, but I get this error when I run the same thing on Linux: conda:command not found
Also, I tried closing and opening my terminal and shifting the paths to the front of PATH (not that it matters but I was desperate), both didn't help.
Already referred to:
How to run Conda?
conda command not found even though path is exported
Anyone has any idea?

killproc command not found error in Ubuntu 12.04

I have a redmine script in /etc/init.d/ folder which was working fine before I broke the ruby and rails packages link. Then I played with ruby gems and finally fixed the broken links. Then I tried to restart redmine script, But strangely, I got the below error
sudo service redmine stop
Shutting down redmine: /etc/init.d/redmine: line 49: killproc: command not found
user#studio:~$ sudo service redmine start
Starting redmine: /etc/init.d/redmine: /usr/local/bin/bundle: /usr/local/bin/ruby: bad interpreter: No such file or directory
/etc/init.d/redmine: line 35: echo_failure: command not found
killproc is part of init.d, so there isn't a missing package at play here. If the process isn't found, it won't run, as well.
However, the next line is more of a red flag. It sounds like your redmine installation is looking for ruby in the incorrect location. This may also be the source of the killproc error as it looks like redmine is not starting up properly.
You can get some more information by running which ruby and comparing that to the path that redmine is looking in. Reinstalling redmine may also resolve the path issue automatically since it sounds like you did a reinstall of rails earlier. Good luck.
My question has two answers, telemark already given answer for my 2nd problem ( ie, I had broken ruby links ). I solved path issues by uninstalling all ruby, rails and gem packages and reinstalled using apt repository. using rvm, chruby, etc everything failed when I switch between users. So I thought of going with the system ruby installation, relying on apt. Fortunately brightbox comes to the rescue.
https://www.brightbox.com/blog/2015/01/05/ruby-2-2-0-packages-for-ubuntu/
Using brightbox and apt solved my path issues.
Then, /etc/init.d/functions, this was missing. It says, No such file or directory. I searched in google and found this link
http://www.linuxfromscratch.org/lfs/view/6.4/scripts/apds02.html
I just copy pasted to /etc/init/functions and given execute permission
sudo chmod a+x /etc/init.d/functions
Thats it!.
UPDATE:
I forgot to mention one important thing, some functions like log_end_message, log_progress_message, etc are not available in functions file. So it's better to include . /lib/lsb/init-functions file.

zsh command not found, likely path issue

I recently switched to zsh from bash and couldn't install any npm bundles. I found some stack overflows telling me to reset the path in my zsh profile, which I did. Now I can't execute any commands, including bundle install.
Things I've tried:
PATH=/usr/bin:/bin:/usr/sbin:/sbin
export path
from the command line
Modifying ~/.zshrc to add
PATH=/usr/bin:/bin:/usr/sbin:/sbin
export PATH
, then saving and restarting iTerm.
When I echo $PATH, this is what I get: /usr/bin:/bin:/usr/sbin:/sbin
Restarting my terminal after each change, I still get: zsh: command not found: bundle
Help would be greatly appreciated!
UPDATE: I tried switching to another computer and cloning the repo down and am getting the same error when I try to bundle install. If I switch to another repo on the other computer (where I didn't mess with the path), bundle install works. On my initial computer (with the path edits), none of the repos allow bundle install.
Do you know where is your bundle program (you can use locate or find) ? It can be in another directory that is not in your path. For example, it can be in /usr/local/bin so you should add this path to your $PATH.

Cocoapods user-install: cannot run pod command

I have installed Cocoapods on OS X Mavericks using the --user-install option (to avoid having to use sudo for the installation) following the instructions at http://guides.cocoapods.org/using/getting-started.html#getting-started . I have also created a .profile file in my home directory with the following:
export GEM_HOME=$HOME/gems
export PATH=$GEM_HOME/bin:$PATH
Cocoapods successfully installs, but I am unable to run the pod command.
When running it from the command line it says No such file or directory. From what I understand, it should be installed into the /Users/me/gems/bin folder. However, this folder does not exist at all - the only Ruby related folder in my home directory is /Users/me/.gem.
I have tried running /Users/me/.gem/ruby/2.0.0/gems/cocoapods-0.29.0/bin/pod but that results in the following error:
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require': cannot load such file -- bundler/setup (LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from .gem/ruby/2.0.0/gems/cocoapods-0.29.0/bin/pod:14:in `<main>'
...but from what I understand, I shouldn't be running it from that location directly.
Any assistance for a Cocoapods newbie appreciated!
So after a lot of research and trying different things I have managed to get this working. I am not quite sure what eventually fixed the problem, or whether it was a combination of things, but for anyone else encountering this same problem here's what I did:
Installed the Xcode command line tools for Mavericks. The option to install this is no longer available in Xcode 5, so you need to download them from https://developer.apple.com/downloads . Some people seem to say they are already installed as part of Xcode 5 from the Mac App Store, whereas others say you need to manually install them. Either way, I figured that installing them again won't hurt.
The error message above talked about not being able to load bundler/setup. So, I (re?)installed the bundler ruby gem gem install bundler --user-install. Interestingly, when I then attempted to run the /Users/me/.gem/ruby/2.0.0/gems/cocoapods-0.29.0/bin/pod command again I got a different error: /Users/me/.gem/ruby/2.0.0/gems/cocoapods-0.29.0/Gemfile not found.
What was really handy is that after the installation of bundler a message appeared saying /Users/me/.gem/ruby/2.0.0/bin in your PATH, gem executables will not run. So, I checked out the contents of that folder and it contains the pod executable! Adding it to the PATH would certainly be handy, but I just ran it directly with the full path (after changing to my Xcode project folder containing the Podfile): /Users/me/.gem/ruby/2.0.0/bin/pod install and it all works!
When I ran pod install for the first time it showed a message saying Setting up CocoaPods master repo and stayed there for quite some time - I thought it had actually hung. However, it eventually completed. If you are unsure whether it is doing anything, or has hung, do ls -la ~/.cocoapods/repos/master/.git/objects/pack/ and look at the time modified/size of the file it is downloading (thanks to this comment for the hint).
Another tip for new players - when I tried to install a pod (in my case, BlocksKit) I got a message saying [!] The platform of the target Pods (iOS 4.3) is not compatible with BlocksKit (2.1.0) which has a minimum requirement of OS X 10.7 - iOS 5.0. This was a surprising message, since my project targets iOS 7.0. Apparently you don't need to specify the platform anymore, so I entirely removed the platform line from the Podfile and it all works.
Hope that this helps other people just getting started with CocoaPods!
After installing Mavericks, I got error with already installed cocoapods. So I ran this command to install the new updated cocoapods version, and it works now.
sudo gem install cocoapods
Thanks to the pointers in these answers, I found that the instructions for installing CocoaPods provided on the CocoaPods web site are incorrect, regarding the contents of the .profile file, specifically the path.
As Skoota noted in the question, the path $GEM_HOME/bin does not exist. A comment by Videre gives the important clue: the correct path is $GEM_HOME/ruby/2.0.0/bin.
The correct .profile contents, which works for me at least, is:
export GEM_HOME=$HOME/.gem
export PATH=$GEM_HOME/ruby/2.0.0/bin:$PATH
It is also worth noting that you must quit and relaunch the Terminal application for changes to the .profile file to take effect.
add:
export COCOAPODS_NO_BUNDLER=1
to your .zprofile or .bash_profile
FWIW - I ran into very similar problems. None of the above helped me so maybe others could benefit from my process.
Eventually just ran sudo gem uninstall cocoapods, deleting everything that I did before.
Followed the steps for creating the .profile file
For good measure, closed Terminal and rebooted everything.
Ran gem install cocoapods which somehow didn't run into errors this time
Checked the install by running gem which cocoapods which fortunately returned the correct path
ran pod setup which didn't raise any errors again .
Not entirely sure what actually worked and what didn't but maybe someone will find this useful.
I use homebrew to install cocapods
First install homebrew (paste this code in terminal and hit enter)
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Second enter this
$ brew install cocoapods

Resources