RVM Upgrade Warning Files containing `PATH=` with no `$PATH` inside - ruby-on-rails

I am curious as to how to fix the path of my files. I was given the WARNING message from rvm get stable --autolibs=enable and am not sure how to approach the warning.
Here is the message:
Upgrade Notes:
/Users/user/.bash_profile:1:export PATH=/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/Users/user/.rvm/gems/ruby-2.1.1/bin:/Users/user/.rvm/gems/ruby-2.1.1#global/bin:/Users/user/.rvm/rubies/ruby-2.1.1/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/user/.rvm/bin:/Users/user/mongodb/bin
* WARNING: Above files contains `PATH=` with no `$PATH` inside, this can break RVM,
for details check https://github.com/wayneeseguin/rvm/issues/1351#issuecomment-10939525
to avoid this warning append #PATH.
I'm really curious to see if this is part of the reason why I am seeing so many gem installation issues.
How do I fix this path and check?

Edit your .bash_profile. Change the line
export PATH=/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/Users/user/.rvm/gems/ruby-2.1.1/bin:/Users/user/.rvm/gems/ruby-2.1.1#global/bin:/Users/user/.rvm/rubies/ruby-2.1.1/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/user/.rvm/bin:/Users/user/mongodb/bin
to
export PATH="/usr/local/mysql/bin:/Users/user/mongodb/bin:$PATH"
. Note what I did:
I took out all the /Users/user/.rvm/… directories; you probably want RVM to manage those itself.
I took out /usr/local/bin, /usr/local/sbin, /usr/bin, /bin, /usr/sbin, and /sbin; those are almost certainly already on the PATH that the shell starts with (before running .bash_profile). It's possible /usr/sbin and /sbin are not already there; if so, you might want to add them in .bash_profile.
I put double quotes around it in case any part of it has spaces (which would be a bad idea, but it's a good idea to safeguard against it just in case).
I put :$PATH at the end -- its absence is what RVM was complaining about. This makes it so /usr/local/mysql/bin and /Users/user/mongodb/bin are added to the PATH that's supplied to the shell, rather than replacing it. And since the :$PATH part is at the very end, bash will search your custom PATH entries first and default system locations last.

Related

Updated my path and now my program can't find my gems

I was having some trouble installing the gem libv8. Apparently I need to have python installed. I installed Python and was attempting to update my path with command from another forum:
SET PATH=C:[Ruby Directory]\bin;C:[Python Directory]
or in my case:
SET PATH=C:\Ruby192\bin;C:\Python27
I am not strong with paths and I can't figure out what I did. Now my environment can't find my Ruby directory.
Can someone explain what I did and how I might fix it?
That is most likely because your PATH variable already had a bunch of stuff that you simply throwed away with that line:
echo %PATH%
# a bunch of stuff
SET PATH=C:\Ruby192\bin;C:\Python27
echo %PATH%
# C:\Ruby192\bin;C:\Python27
You can try to append to it instead instead:
set PATH=%PATH%;C:\Ruby192\bin;C:\Python27
echo %PATH%
# a bunch of stuff plus C:\Ruby192\bin;C:\Python27
This change will be avalid for your terminal session only. Closing it and open again should restore the default path. If you need to make it permanent, you need to change your path throught the windows (for example, following this instructions)

How to use luadoc in ubuntu/linux?

As the title says, how to use luadoc in ubuntu/linux? I generated documentation in windows using batch file but no success in ubuntu. Any ideas?
luadoc
Usage: /usr/bin/luadoc [options|files]
Generate documentation from files. Available options are:
-d path output directory path
-t path template directory path
-h, --help print this help and exit
--noindexpage do not generate global index page
--nofiles do not generate documentation for files
--nomodules do not generate documentation for modules
--doclet doclet_module doclet module to generate output
--taglet taglet_module taglet module to parse input code
-q, --quiet suppress all normal output
-v, --version print version information
First off, I have little experience with Luadoc, but a lot of experience with Ubuntu and Lua, so I'm basing all my points off of that knowledge and a quick install that I've just done of luadoc. Luadoc, as far as I can see, is a Lua library (so can also be used in Lua scripts as well as bash). To make documentation (in bash), you just run
luadoc file.lua
(where file is the name of your file that you want to create documentation for)
The options -d and -t are there to choose where you want to put the file and what template you want to use (which I have no clue about, I'm afraid :P). For example (for -d):
luadoc file.lua -d ~/Docs
As far as I can see, there is little else to explain about the actual options (as your code snippet explains what they do well enough).
Now, looking at the errors you obtained when running (lua5.1: ... could not open "index.html" for writing), I'd suggest a few things. One, if you compiled the source code, then you may have made a mistake somewhere, such as not installing dependencies (which I'd be surprised about, because otherwise you wouldn't have been able to make it at all). If you did, you could try getting it from the repos with
sudo apt-get install luadoc
which will install the dependencies too. This is probably the problem, as my working copy of luadoc runs fine from /usr/bin with the command
./luadoc
which means that your luadoc is odd, or you're doing something funny (which I cannot work out from what you've said). I presume that you have lua5.1 installed (considering the errors), so it's not to do with that.
My advice to you is to try running
luadoc file.lua
in the directory of file.lua with any old lua file (although preferably one with at least a little data in) and see if it generates an index.html in the same folder (don't change the directory with -d, for testing purposes). If that DOESN'T work, then reinstall it from the repos with apt-get. If doing that and trying luadoc file.lua doesn't work, then reply with the errors, as something bigger is going wrong (probably).

XCode file paths point to nonexistent directories

Right now I'm running XCode 3.2.6. I'm working off of someone else's code, and when I open the project it around 150 files have the wrong path (even when set to "relative to enclosing group."
Instead of using /appname/folder the point to /../../Documents/appname/folder.
I'm aware that some other people have had similar issues with XCode 3.2 in the past, which is why I'm upgrading to Lion now so I can use 4.0. However, has anyone found a fix for this in 3.2?
Also, I was wondering if there was a file that held all of the paths so I could run a script through it?
Thanks
You will notice that the .xcodeproj file itself is actually a Bundle (a.k.a. a directory). If you cd to this directory in Terminal, you can use grep to figure out which files contain the paths using grep -r -i "path here". These files are formatted in XML and some other similar format, so it should be pretty easy to use sed or something to fix some of the paths. And of course, I ALWAYS suggest backing up any files before you autonomously replace stuff in them.

Path corrupted after installing rvm?

It's pretty weird, but i got my PATH corrupted after installing rvm on Mac OS. I really don't understand why but i get command not found in every command i type, from 'port' to 'git'. That behaviour is really really weird, do you have any idea why this happens ? ( i installed using this : http://beginrescueend.com/rvm/install/)
It sounds like your .bash_profile was overwritten or somehow changed. I assume you have git installed as a macport. My guess is that the path to all macport installed executables was removed from your $PATH variable.
Make sure that you have the following line in your .bash_profile file:
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
Yes. Unfortunately the rvm installer DOES overwrite the contents of .bashrc and .bash_profile.
Happened to me too, but luckily I had a back up .bash_profile with all of my aliases, functions, and path defns.
Something needs to be fixed here.

.bash_profile on Mac OS X Leopard breaks Rails?

I am relatively new to dealing with command line issues, compiling programs, and UNIX. Coming from a PHP background, I just fired off MAMP and never worried about this kind of stuff.
I am diving into Rails, and running into some issues. I tried to create a .bash_profile in my home directory to create some shortcuts for myself. I added /usr/local/git/bin to my .profile file, but it seems to have no effect on my PATH variable inside a new terminal window (i.e. it only lasts the session).
The .bash_profile seemed to persist across logins, but once I had that setup, Rails stopped working as expected! I would run rails server in my application's root directory, and Rails would create a new app called 'server' with another directory tree inside my existing app. It does this even with an empty .bash_profile. But I delete the .bash_profile, and everything works like normal.
I am in over my head here - I have very little understanding of how this all works. Any advice on where to look? Or am I missing something obvious?
Post what you added to your .bash_profile. To pre-pend something to your path the syntax is:
export PATH=/usr/local/bin:$PATH
to append you swap the "/usr/local/bin" and $PATH
export PATH=$PATH:/usr/local/bin
After you make changes to your .bash_profile you can make them available in the current terminal session by running source .bash_profile. Then if you run echo $PATH you can see the updated PATH. You should try running rails --version in your different configurations to see if the version is changing. That may account for your odd behavior.
also checkout:
path-helper as extend PATH is sooo 2010

Resources