Skip to content

Instantly share code, notes, and snippets.

@janjongboom
Created July 15, 2012 13:09
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save janjongboom/3116835 to your computer and use it in GitHub Desktop.
Save janjongboom/3116835 to your computer and use it in GitHub Desktop.
Use Ruby 1.9.3 on Cloud9 IDE
**Cloud9 now has rvm, so you can switch easily (`rvm use X`), no need for this gist anymore**
# first thing to do is to get your VM's GUID
# do a 'pwd' in the console and grab the part after /var/lib/stickshift
# -> replace all GUID calls in this file :-)
create file: .gemrc
install: --no-rdoc --no-ri
update: --no-rdoc --no-ri
gemhome: /var/lib/stickshift/GUID/app-root/data/.gems
gempath:
- /var/lib/stickshift/GUID/app-root/data/gems/1.8
cp .gemrc ../
# install rvm
curl -L https://get.rvm.io | bash -s stable --ruby
# so this needs to be done every time apparently, add it to bashrc or something
# RUN IT IN TERMINAL! (Open via ALT+T)
source /var/lib/stickshift/GUID/app-root/data/.rvm/scripts/rvm
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bash_profile
rvm use 1.9.3
ruby --version
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
Ruby is now in ~/.rvm/rubies/ruby-1.9.3-p194/bin/ruby in case you want to run it that way
# add to ~/.bashrc
source $HOME/.rvm/scripts/rvm
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bash_profile
rvm use 1.9.3
Copy link

ghost commented Jul 16, 2012

After following these directions (which was difficult due to the lack of copy&paste in the terminal. And confusing, due to the differences between the command line/console thingy and the terminal), I am seeing these warnings:

It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.

Copy link

ghost commented Jul 16, 2012

Trying to install libyaml fails with a message to the effect of Libtool library used but LIBTOOL is undefined. I would have copy & pasted it, but that doesn't seem to work from the terminal.

Copy link

ghost commented Jul 16, 2012

Apparently copy & paste works from chrome :D

src/Makefile.am:2: Libtool library used but `LIBTOOL' is undefined
src/Makefile.am:2:   The usual way to define `LIBTOOL' is to add `AC_PROG_LIBTOOL'
src/Makefile.am:2:   to `configure.ac' and run `aclocal' and `autoconf' again.
src/Makefile.am:2:   If `AC_PROG_LIBTOOL' is in `configure.ac', make sure
src/Makefile.am:2:   its definition is in aclocal's search path.
make: *** [Makefile.in] Error 1

@janjongboom
Copy link
Author

Hi @bm5k, I don't think it's required, I don't have it installed and works fine for me. I'll see what is required to get it installed though.

@bnoordhuis
Copy link

@bm5k: That looks like a bug in the libyaml automake script. It's probably written for an older (or possibly newer) version of autotools than what the C9 VMs ship with.

Copy link

ghost commented Jul 16, 2012

@janjongboom for now, I am progressing without it.

@bnoordhuis I don't know enough about the environment C9 provides in its workspaces to know the answer to that.

@bnoordhuis
Copy link

@bm5k: Just tried it, seems to work for me. You may have to run autoreconf -ivf first.

Copy link

ghost commented Jul 17, 2012

Can all instances of /var/lib/stickshift/GUID/app-root/data/ be safely replaced with $HOME in the script above?

@janjongboom
Copy link
Author

Yeah pretty sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment