Archive for the ‘Linux’ category

RVM woes on Ubuntu 11.04

May 19th, 2011

Having had an epiphany the other day, I needed this morning to start work on a new prototype.  This post isn’t about that prototype.

It IS about the new setup I was using to do that prototype.  I figured this was a good chance to try out RVM in a Rails project, as well as try out Ubuntu 11.04, as well as install the OS in French.  So, with the new VM up and running, I follow RVM’s installation instructions, anticipation building with each scrolling character.  And then… BAM!

ethan@ubuntu11:~/rvmsource$ bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
Cloning into rvm…
remote: Counting objects: 4765, done.
remote: Compressing objects: 100% (2433/2433), done.
remote: Total 4765 (delta 3086), reused 3183 (delta 1672)
Receiving objects: 100% (4765/4765), 1.57 MiB | 322 KiB/s, done.
Resolving deltas: 100% (3086/3086), done.
WARNING:
Could not source ‘/home/ethan/.rvm/scripts/base’ as file does not exist.
RVM will likely not work as expected.
WARNING:
Could not source ‘/home/ethan/.rvm/scripts/version’ as file does not exist.
RVM will likely not work as expected.
WARNING:
Could not source ‘/home/ethan/.rvm/scripts/selector’ as file does not exist.
RVM will likely not work as expected.
WARNING:
Could not source ‘/home/ethan/.rvm/scripts/cd’ as file does not exist.
RVM will likely not work as expected.
WARNING:
Could not source ‘/home/ethan/.rvm/scripts/cli’ as file does not exist.
RVM will likely not work as expected.
WARNING:
Could not source ‘/home/ethan/.rvm/scripts/override_gem’ as file does not exist.
RVM will likely not work as expected.
cat: /home/ethan/.rvm/VERSION: Aucun fichier ou dossier de ce type

A few Google searches turned up a few people having a similar problem but no solutions.  But whould’ve thunk it that installing the OS in French would actually have some practical value?  Google must’ve seen that and then dumped me on to this forum, wherein one of the posters linked to this post, which basically says to just follow the directions that RVM spit out as part of the big error message.  Who’d've thunk THAT?  I sure didn’t.  I just focused on the error message itself in my searches.

WARNING:  you have a ‘return’ statement in your ~/.bashrc
This could cause some features of RVM to not work.

This means that if you see something like:

‘[ -z "$PS1" ] && return’

then you change this line to:

if [[ -n "$PS1" ]] ; then

# … original content that was below the ‘&& return’ line …

fi # <= be sure to close the if at the end of the .bashrc.

# This is a good place to source rvm v v v
[[ -s "/home/ethan/.rvm/scripts/rvm" ]] && source “/home/ethan/.rvm/scripts/rvm”  # This loads RVM into a shell session.

It looks like RVM tries to run outside of a standard shell session, and the way .bashrc is configured by default on Ubuntu 11.04 prevents that sort of thing.  When you’re done with your edits your .bashrc should look something like this:

# ‘[ -z "$PS1" ] && return’ <—– delete this line.  It isn’t commented out in the original

if [[ -n "$PS1" ]] ; then

# the rest of your old .bashrc contents

fi

[[ -s "/home/ethan/.rvm/scripts/rvm" ]] && source “/home/ethan/.rvm/scripts/rvm”  # This loads RVM into a shell session.

After making that change I re-ran the installation instructions, and PRESTO!  Or maybe I should say, Voilà!  As always, YMMV.  I really don’t think it was the double install that fixed the problem.  And be sure to replace “ethan” with whatever your actual path is.  That happens to be mine, because, well, that’s my name.

Git, GitHub, and Windows

August 4th, 2008

A blog post isn’t quite the format in which to go into the length details of why, so it sufficeth me to say that Git is great source control software. Local commits. 1 command to initialize a repo.  Branching and merging isn’t so ridiculous that you never do it.

GitHub also seems pretty neat, though I confess to be a GitHub newb (or noob– I forget which is derogatory. I don’t mean that one). GitHub allows free hosting of open-source Git repositories. I don’t really plan on making the project I’m working on open source– and for no particular reason– so that’ll get changed when I want to close things down. It does cost money to host closed-source projects. Point being, off-site backup is a Good Thing, a quality especially noticeable when one accidental rm -Rf’s their repository. Oops. Good thing I had basically only clicked New Project in Visual Studio.

So, this post is supposed to matter because you get some useful information and not just some narcissism. If you’re a Windows user at least part of the time, it’s readily apparent that Git wasn’t written for Windows users. Do the author check. It’s slightly confusing to get Git working, and rather than re-invent the wheel– though I’m not afraid of beating dead clichés– checkout the work of some dude named Kyle Cordes.

His post works as advertised. I did skip all the bit about being added to his repository, as I wanted to do my own. Also, I stopped the whole thing at “Approach 1: GUI.” It was pretty easy getting the repo into git-hub by following git-hub’s instructions.

rm -what-is-it-again?

June 6th, 2008

I’ve been mostly a Windows user my whole life up to this point. That was due mostly to fate. My parents had only PCs (unless you count the TI-99/4A), so not being of much economic independence at the age of 5, those are what I used too. I suppose there were computer days at elementary school too, where we used Apple 2es, but all we really learned on those was how to boot up Oregon Trail.

At university I got exposure to Linux. I had grown used to graphical interfaces by that point, so harkening back to command-line days was odd. I never caught Linux myself though, being turned off to the OS because I couldn’t stand that average Linux user that I met. Their arrogance and support for Linux seemed to stem from the simple fact that it isn’t Windows, so it must be better. That’s like saying that puke isn’t feces, so it’s good to eat. Or like saying that voting for Obama is good, because he isn’t Bush.

Anyway, the Linuzealots would extol the command line and how much easier it was to get things done. Maybe they enjoy sifting through man pages. Now don’t get me wrong, I like technical challenges– that’s why I’m a programmer. I don’t like figuring out how to use cryptic and poorly-documented tools though. I like accomplishing things.

If the command line is so great, why is it so hard to remove (or delete if you’re a Windows user) a non-empty directory from the command line? I can NEVER remember the switch for doing so. I just googled it a second ago, and thought I got somewhere, but when I typed -r in (what the result claimed the switch was) it started prompting me on every file. Grrr! So I just typed “open .” and deleted it graphically.

When you consider the time it took to do that and then come rant about it here, well, I just don’t think the command line is all that more efficient/productivity enhancing.

Of course, if I ever get a technical reader who could tell me what the blooming flag is, feel free to post it! That is fact what I was really hoping to do– figure it out and then post it here so I would know where to look the next time.

Edit: I have since found out that it’s rm -Rf that I wanted.