RVM sourcing line not found for Bash, rerun this command with '--auto-dotfiles' flag to fix it - rvm

Removed rvm. When I reinstall I get this:
RVM sourcing line not found for Bash, rerun this command with '--auto-dotfiles' flag to fix it.
Given that I used [~]$ \curl -sSL https://get.rvm.io | bash -s stable --ruby is it wanting me to run this command with the dotfiles flag?

The "rerun this command" line means to rerun rvm reinstall ruby-2.3.3, with the flag added. This worked for me:
[~]$ \curl -sSL https://get.rvm.io | bash -s stable --ruby --auto-dotfiles
... The idea is to just tack on --auto-dotfiles to the last command you ran.

Related

Does NitrousIO support RBENV?

With Nitrous.io the documentation states that other Ruby version managers may be used instead of RVM.
However, sudo is needed for installing rbenv
Is RVM currently the only option on nitrous.io?
If you do not wish to use RVM which is pre-installed then you can install rbenv. Run the following commands within your Nitrous.IO console:
$ git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
$ echo 'eval "$(rbenv init -)"' >> ~/.bashrc
$ git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
$ source ~/.bashrc
These steps can be found within the Octopress guide which utilizes rbenv on Nitrous.IO.

zsh ssh-add -L parse error near `-L'

I'm trying to run
ssh-add -L
(or any other dashed option), and zsh returns zsh: parse error near `-L'. It's the first time I see zsh do that, and it doesn't do it with any other command.
Any ideas ?
First thing to find out is whether ssh-add is an alias or a shell function, rather than the binary executable /usr/bin/ssh-add.
Second, try to run the same command in a ZSH session without your custom ZSH configuration. To get a clean environment, run
env -i TERM=$TERM LC_ALL=$LC_ALL LANG=$LANG zsh -f
Then try ssh-add -L again and let us know what you see.
Moreover, please post the output of the following:
uname -a
zsh --version

Scripts installed by the deb package have wrong prefix

Building our own deb packages we've run into the issue of having to patch manually some scripts so they get the proper prefix.
In particular,
We're building mono
We're using official tarballs.
The scripts that end up with wrong prefix are: mcs, xbuild, nunit-console4, etc
An example of a wrong script:
#!/bin/sh
exec /root/7digital-mono/mono/bin/mono \
--debug $MONO_OPTIONS \
/root/7digital-mono/mono/lib/mono/2.0/nunit-console.exe "$#"
What should be the correct end result:
#!/bin/sh
exec /usr/bin/mono \
--debug $MONO_OPTIONS \
/usr/lib/mono/2.0/nunit-console.exe "$#"
The workaround we're using in our build-package script before calling dpkg-buildpackage:
sed -i s,`pwd`/mono,/usr,g $TARGET_DIR/bin/mcs
sed -i s,`pwd`/mono,/usr,g $TARGET_DIR/bin/xbuild
sed -i s,`pwd`/mono,/usr,g $TARGET_DIR/bin/nunit-console
sed -i s,`pwd`/mono,/usr,g $TARGET_DIR/bin/nunit-console2
sed -i s,`pwd`/mono,/usr,g $TARGET_DIR/bin/nunit-console4
Now, what is the CORRECT way to fix this? Full debian package creation scripts here.
Disclaimer: I know there are preview packages of Mono 3 here! But those don't work for Squeeze.
the proper way is to not call ./configure --prefix=$TARGET_DIR
this tells all the binaries/scripts/... that the installated files will end up in ${TARGET_DIR}, whereas they really should endup in /usr.
you can use the DESTDIR variable (as in make install DESTDIR=${TARGET_DIR}) to change (prefix) the installation target at install time (files will end-up in ${TARGET_DIR}/${prefix} but will only have ${prefix} "built-in")

dead simple chef rvm installation script fails

What I have: Chef;
What I need: RVM installed for node[:deploy][:user][:name]. I need user-wide install, not system-wide.
What I tried latest:
script 'install_rvm' do
user = node[:deploy][:user][:name]
interpreter '/bin/bash'
code "su -l #{user} -c '\curl https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer | bash -s stable'"
not_if { ::File.exists? "/home/#{user}/.rvm" }
end
When I manually run su -l <username> -c '\curl <long_url> | bash -s stable' on test server surely it works perfectly.
I expect Chef to run the same code, and in logs it seems like it does, but the next execute resource fails because in fact there is no /home/<username>/.rvm present.
Yes I know that in Chef I can specify user as user node[:deploy][:user][:name] instead of changing user with su but for some reason if I do that rvm would try to install itself in /root/.rvm (env not properly reset?).
Well, I would like to ask, why is Chef so extremely crappy even for such dead-simple tasks, but it looks like I've chosen the wrong place, so the question is what am I doing wrong or do I miss something obvious?
why not use chef-rvm from Fletcher Nichol - it is the supported way to deal with RVM in Chef.
Well, at least that worked and may be useful if all better ways to do it with Chef fail for you. Here is the resource for installing ruby
execute 'install_rvm' do
user('root')
user = node[:deploy][:user][:name]
command "su -l #{user} -c '\curl https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer | bash -s stable'"
not_if { ::File.exists? "/home/#{user}/.rvm" }
end
And the bonus one to create gemset if it is not already present:
execute 'rvm_install_ruby' do
user('root')
user = node[:deploy][:user][:name]
ruby = node[:deploy][:ruby]
gemset = node[:deploy][:gemset]
command "su -l #{user} -c 'rvm use #{ruby}##{gemset} --install --create'"
not_if do
if latest_patchlevel = `rvm list`.scan(/(ruby-#{ruby}-p)(\d+)/).map{ |a| a.last.to_i }.sort.last
`rvm list gemsets`.match /ruby-#{ruby}-p#{latest_patchlevel}##{gemset}/
end
end
end

RVM on debian and rails 3

I'm following https://github.com/diaspora/diaspora/wiki/Installing-on-Debian and trying to get RVM installed on debian. Executing
bash < <(curl -s https://rvm.io/install/rvm)
gives me nothing, it does not result in anything. I have curl installed but the command doesn't generate any output.
You can just download https://rvm.io/install/rvm via browser and then execute bash ./rvm . The command you entered actually executes the same.
EDIT: the new way:
curl -L https://get.rvm.io -o rvm-installer
chmod +x rvm-installer
./rvm-installer
rm -f rvm-installer
Which is equivalent to:
curl -L https://get.rvm.io | bash
The former command was using -s without -S which was hiding errors from curl.