Problems configuring rvm and `bundler not installed` - rvm

I am a novice having major problems with rvm. bundle install gives me the error
`ERROR: Gem bundler is not installed, run `gem install bundler` first.
even though I know it is installed, as it shows up if I run gem list -l. I suspect that's returning a list of system gems, which would suggest that rvm is definitely the problem. Trying gem install bundler again doesn't help. I've looked around at other people who have had similar problems and can't find an answer that helps whatever situation I'm in. rvm info gives me this output:
# rvm info
system:
system:
uname: "Linux box576.bluehost.com 2.6.32-20130101.60.1.bh6.x86_64 #1 SMP Tue Jan 1 22:59:09 EST 2013 x86_64 x86_64 x86_64 GNU/Linux"
system: "unknown/libc-2.12/x86_64"
bash: "/ramdisk/bin/bash => GNU bash, version 4.1.2(1)-release (x86_64-redhat-linux-gnu)"
zsh: "/usr/bin/zsh => zsh 4.3.10 (x86_64-redhat-linux-gnu)"
rvm:
version: "rvm 1.18.8 (master) by Wayne E. Seguin <wayneeseguin#gmail.com>, Michal Papis <mpapis#gmail.com> [https://rvm.io/]"
updated: "22 hours 59 minutes ago"
homes:
gem: "/home7/contenw6/ruby/gems"
ruby: "/home7/contenw6/.rvm/rubies/ruby-1.9.3-p194"
binaries:
ruby: "/home7/contenw6/.rvm/rubies/ruby-1.9.3-p194/bin/ruby"
irb: "/home7/contenw6/.rvm/rubies/ruby-1.9.3-p194/bin/irb"
gem: "/home7/contenw6/.rvm/rubies/ruby-1.9.3-p194/bin/gem"
rake: "/home7/contenw6/.rvm/rubies/ruby-1.9.3-p194/bin/rake"
environment:
PATH: "/usr/local/jdk/bin:/home7/contenw6/.rvm/gems/ruby-1.9.3-p194#projecta/bin:/home7/contenw6/.rvm/gems/ruby-1.9.3-p194#global/bin:/home7/contenw6/.rvm/rubies/ruby-1.9.3-p194/bin:/home7/contenw6/.rvm/bin:/home7/contenw6/perl5/bin:/usr/lib64/qt-3.3/bin:/ramdisk/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11R6/bin:/home7/contenw6/ruby/gems/bin:/home7/contenw6/bin"
GEM_HOME: "/home7/contenw6/ruby/gems"
GEM_PATH: "/home7/contenw6/ruby/gems:/usr/lib/ruby/gems/1.8"
MY_RUBY_HOME: "/home7/contenw6/.rvm/rubies/ruby-1.9.3-p194"
IRBRC: "/home7/contenw6/.rvm/rubies/ruby-1.9.3-p194/.irbrc"
RUBYOPT: ""
gemset: ""
If I do rvm use 1.9.3-p194#projecta --default the environment section now looks like this:
environment:
PATH: "/home7/contenw6/.rvm/gems/ruby-1.9.3-p194#projecta/bin:/home7/contenw6/.rvm/gems/ruby-1.9.3-p194#global/bin:/home7/contenw6/.rvm/rubies/ruby-1.9.3-p194/bin:/home7/contenw6/.rvm/bin:/usr/local/jdk/bin:/home7/contenw6/perl5/bin:/usr/lib64/qt-3.3/bin:/ramdisk/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11R6/bin:/home7/contenw6/ruby/gems/bin:/home7/contenw6/bin"
GEM_HOME: "/home7/contenw6/.rvm/gems/ruby-1.9.3-p194#projecta"
GEM_PATH: "/home7/contenw6/.rvm/gems/ruby-1.9.3-p194#projecta:/home7/contenw6/.rvm/gems/ruby-1.9.3-p194#global"
MY_RUBY_HOME: "/home7/contenw6/.rvm/rubies/ruby-1.9.3-p194"
IRBRC: "/home7/contenw6/.rvm/rubies/ruby-1.9.3-p194/.irbrc"
RUBYOPT: ""
gemset: "projecta"
but when I log in and try again it reverts back to the first output above. I've clearly screwed something up somewhere, and I have no idea how to fix my installation or where the problem is coming from. Any help would be greatly appreciated.

this looks like your previous ruby settings, check your ~/.bashrc or ~/.zshenv for any variables set that might contain the mentioned paths
if you do not find anything try checking in /etc:
grep -rn "/home7/contenw6/ruby/gems" /etc
update from comments:
sed -i'' '/GEM_HOME=/ d;' ~/.bashrc
rm ~/.gemrc

This one was helped me
cd ~/.rvm/bin
rm bundle
Then return to you project folder install a bundler gem and run bundle w/o problems

Related

rpmbuild install: cannot create directory

I'm creating an RPM file but when using install I get some permission errors.
This is my spec file:
%define buildroot %{_tmppath}/nagios-1-1-root-%(%{__id_u} -n)
Summary: Nagios blabla
Name: nagios
Version: 1
Release: 1
License: PROPRIETARY
Group: Applications/Accessories
Source: nagios-1.tar.gz
Packager: Nicholas Lievens <lievens.nicholas#gmail.com>
AutoReqProv: no
Requires: gcc gcc-c++ glibc glibc-common glibc-devel gd gd-devel php53 php53-cli php53-mysql php53-gd php53-pdo graphviz httpd libdbi-dbd-mysql libdbi-devel mysql mysql-server mysql-devel git
%description
Nagios!
%prep
%setup
%build
./configure --with-init-dir=/etc/init.d --with-nagios-user=nagios --with-nagios-group=nagios
make all
%install
make install DESTDIR=${RPM_BUILD_ROOT}
make install-init DESTDIR=${RPM_BUILD_ROOT}
make install-config DESTDIR=${RPM_BUILD_ROOT}
make install-commandmode DESTDIR=${RPM_BUILD_ROOT}
make install-webconf DESTDIR=${RPM_BUILD_ROOT}
make install-devel DESTDIR=${RPM_BUILD_ROOT}
#htpasswd -b -c /usr/local/nagios/etc/htpasswd.users nagiosadmin nagiosadmin
%files
%defattr(755,root,root)
/etc/init.d/nagios
%{_prefix}/var
%{_prefix}/var/spool/checkresults
%{_prefix}/var/rw
%{_prefix}/etc
%{_prefix}/bin
%{_prefix}/sbin
%{_prefix}/libexec
%{_prefix}/lib
%{_prefix}/include/nagios
%{_prefix}/share
%{_prefix}/etc
%defattr(644,root,root)
%config(noreplace) %{_prefix}/etc/*.cfg
%defattr(750,root,nagios)
/etc/nagios
/etc/nagios/objects
%defattr(755,nagios,nagios)
/var/log/nagios
/var/log/nagios/archives
%defattr(2775,nagios,nagios)
/var/spool/nagios
###%files www
%defattr(755,root,root)
%{_prefix}/sbin
%{_prefix}/sbin/*
%{_prefix}/share/nagios
%defattr(-,root,root)
%{_prefix}/share/nagios/*
%config(noreplace) /etc/httpd/conf.d/nagios.conf
%defattr(-,root,root)
%{_prefix}/include/nagios
%{_prefix}/include/nagios/locations.h
Some things are commented out just for debugging reasons.Could anyone tell why I'm getting the output:
install: cannot create directory `/var/spool/nagios': Permission
denied error: Bad exit status from /var/tmp/rpm-tmp.80635 (%install)
Are you trying to build this on RHEL 5? If so, you need to add this line somewhere in the header:
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Otherwise $RPM_BUILD_ROOT will not be populated.

How do I keep my RVM environment from losing its settings?

I installed ZSH today and RVM, I set up Ruby 1.9.3 to be my default. When I type rvm use 1.9.3 --default and then went into my rails project and ran rails s it worked fine. If I close my terminal and then come back to my rails project and try rails s I get the following error:
/Users/jeff/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find railties (>= 0) amongst [bigdecimal-1.1.0, io-console-0.3, json-1.5.4, minitest-2.5.1, rake-0.9.2.2, rdoc-3.9.4] (Gem::LoadError)
from /Users/jeff/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
from /Users/jeff/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems.rb:1229:in `gem'
from /Users/jeff/.rvm/gems/ruby-1.9.3-p125/bin/rails:18:in `<main>'
I would then type rvm use 1.9.3 and the error would go away, I did some research and found that rvm info was losing all of my rvm environment variables, here is the output of rvm info:
system:
system:
uname: "Darwin binfalse.local 11.3.0 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64 x86_64"
bash: "/bin/bash => GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin11)"
zsh: "/opt/local/bin/zsh => zsh 4.3.17 (x86_64-apple-darwin11.3.0)"
rvm:
version: "rvm 1.10.3 by Wayne E. Seguin <wayneeseguin#gmail.com>, Michal Papis <mpapis#gmail.com> [https://rvm.beginrescueend.com/]"
updated: "51 minutes 38 seconds ago"
homes:
gem: "not set"
ruby: "not set"
binaries:
ruby: "/Users/jeff/.rvm/rubies/ruby-1.9.3-p125/bin/ruby"
irb: "/Users/jeff/.rvm/rubies/ruby-1.9.3-p125/bin/irb"
gem: "/Users/jeff/.rvm/rubies/ruby-1.9.3-p125/bin/gem"
rake: "/Users/jeff/.rvm/gems/ruby-1.9.3-p125/bin/rake"
environment:
PATH: "/Users/jeff/.rvm/gems/ruby-1.9.3-p125/bin:/Users/jeff/.rvm/gems/ruby-1.9.3-p125#global/bin:/Users/jeff/.rvm/rubies/ruby-1.9.3-p125/bin:/Users/jeff/.rvm/bin:/opt/local/bin:/opt/local/sbin:/Library/PostgreSQL/9.0/bin:/usr/local/mysql/bin:/usr/local/mysql:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin"
GEM_HOME: ""
GEM_PATH: ""
MY_RUBY_HOME: ""
IRBRC: ""
RUBYOPT: ""
gemset: ""
How do I make it so my env settings are not lost? Works just fine with bash.
This is issue with loading RVM in proper place of configuration files.
You can fix it by calling:
rvm get stable --auto # OR:
rvm get head --auto
And restart computer - this is important as it forces reload of all config files.

RVM gemset forgotten immediately

I'm having a problem very similar to this question, but rather than forgetting upon reboot, rvm doesn't appear to be aware of the gemset in the first place.
I've got several gemsets created, and those directories are indeed being created and used when I $ rvm install rails -v 3.1.1 or whatever, but $ rvm gemset list produces this:
gemsets for system (found in /Network/Servers/xxx/Volumes/ServerData/Home/yyy/.rvm/gems/system)
*
I can rvm use 1.9.2#rails311, and rvm switches to that ruby, with its associated gemset; when I run $ rvm info, I get what's pasted below, but $ bundle install throws dependency errors that make it seem as though it's not finding the gemset.
Also, I have added the user account to the rvm group, and I don't get any permissions errors upon creating the gemsets, or installing gems to them, and all gems are actually getting downloaded and stored in the proper gemsets.
ruby-1.9.2-p318#rails311:
system:
uname: "Darwin www.yyy.zzz 11.3.0 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64 x86_64"
bash: "/bin/bash => GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin11)"
zsh: "/bin/zsh => zsh 4.3.11 (i386-apple-darwin11.0)"
rvm:
version: "rvm 1.10.3 by Wayne E. Seguin <wayneeseguin#gmail.com>, Michal Papis <mpapis#gmail.com> [https://rvm.beginrescueend.com/]"
updated: "1 day 2 hours 32 minutes 20 seconds ago"
ruby:
interpreter: "ruby"
version: "1.9.2p318"
date: "2012-02-14"
platform: "x86_64-darwin11.3.0"
patchlevel: "2012-02-14"
full_version: "ruby 1.9.2p318 (2012-02-14) [x86_64-darwin11.3.0]"
homes:
gem: "/Network/Servers/www/Volumes/ServerData/Home/yyy/.rvm/gems/ruby-1.9.2-p318#rails311"
ruby: "/Network/Servers/www/Volumes/ServerData/Home/yyy/.rvm/rubies/ruby-1.9.2-p318"
binaries:
ruby: "/Network/Servers/www/Volumes/ServerData/Home/yyy/.rvm/rubies/ruby-1.9.2-p318/bin/ruby"
irb: "/Network/Servers/www/Volumes/ServerData/Home/yyy/.rvm/rubies/ruby-1.9.2-p318/bin/irb"
gem: "/Network/Servers/www/Volumes/ServerData/Home/yyy/.rvm/rubies/ruby-1.9.2-p318/bin/gem"
rake: "/Network/Servers/www/Volumes/ServerData/Home/yyy/.rvm/gems/ruby-1.9.2-p318#rails311/bin/rake"
environment:
PATH: "/Network/Servers/www/Volumes/ServerData/Home/yyy/.rvm/gems/ruby-1.9.2-p318#rails311/bin:/Network/Servers/www/Volumes/ServerData/Home/yyy/.rvm/gems/ruby-1.9.2-p318#global/bin:/Network/Servers/www/Volumes/ServerData/Home/yyy/.rvm/rubies/ruby-1.9.2-p318/bin:/Network/Servers/www/Volumes/ServerData/Home/yyy/.rvm/bin:/Network/Servers/www/Volumes/ServerData/Home/yyy/.rvm/gems/ruby-1.9.2-p318#rails303/bin:/Network/Servers/www/Volumes/ServerData/Home/yyy/.rvm/gems/ruby-1.9.2-p318#rails313/bin:/Network/Servers/www/Volumes/ServerData/Home/yyy/.rvm/gems/ruby-1.9.2-p318/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/opt/local/bin:/opt/local/sbin:/opt/local/lib/postgresql84/bin"
GEM_HOME: "/Network/Servers/www/Volumes/ServerData/Home/yyy/.rvm/gems/ruby-1.9.2-p318#rails311"
GEM_PATH: "/Network/Servers/www/Volumes/ServerData/Home/yyy/.rvm/gems/ruby-1.9.2-p318#rails311:/Network/Servers/www/Volumes/ServerData/Home/yyy/.rvm/gems/ruby-1.9.2-p318#global"
MY_RUBY_HOME: "/Network/Servers/www/Volumes/ServerData/Home/yyy/.rvm/rubies/ruby-1.9.2-p318"
IRBRC: "/Network/Servers/www/Volumes/ServerData/Home/yyy/.rvm/rubies/ruby-1.9.2-p318/.irbrc"
RUBYOPT: ""
gemset: "rails311"
Many thanks for any insights you may have to offer.
this looks like a known RVM issue https://github.com/wayneeseguin/rvm/issues/762
I should get some time to fix it within week or two, please review the ticket and give/comment any insight you think might be important

Capistrano can't find a JavaScript runtime

I have a problem with Capistrano deploying to a server with RVM and gemsets
executing `deploy:assets:precompile'
* executing "cd /var/app/releases/20111229233555 && rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile"
*** [err ::] rake aborted!
*** [err ::] Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes.
*** [deploy:update_code] rolling back
failed: "rvm_path=$HOME/.rvm/ $HOME/.rvm/bin/rvm-shell '1.9.2#mygemset' -c 'cd /var/app/releases/20111229234715 && rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile'"
This is my Capfile
$:.unshift(File.expand_path('./lib', ENV['rvm_path']))
require 'rvm/capistrano'
set :rvm_bin_path, "$HOME/.rvm/bin"
set :rvm_ruby_string, '1.9.2#mygemset'
set :rvm_type, :user
load 'deploy/assets'
When I log in as the very same user which is used by Capistrano the failing command is executed without any problems.
It seems that Capistrano is using some other environment.
Here is my ~/.rvmrc file:
rvm_gemset_create_on_use_flag=1 rvm_trust_rvmrcs_flag=1
Is there a way how to check which ruby and gemset is used at the execution time?
node.js is and V8 are installed on the system, and all needed gems are in Gemfile:
here is my rvm info:
ruby:
interpreter: "ruby"
version: "1.9.2p290"
date: "2011-07-09"
platform: "x86_64-linux"
patchlevel: "2011-07-09 revision 32553"
full_version: "ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]"
homes:
gem: "/home/capistrano/.rvm/gems/ruby-1.9.2-p290#mygemset"
ruby: "/home/capistrano/.rvm/rubies/ruby-1.9.2-p290"
binaries:
ruby: "/home/capistrano/.rvm/rubies/ruby-1.9.2-p290/bin/ruby"
irb: "/home/capistrano/.rvm/rubies/ruby-1.9.2-p290/bin/irb"
gem: "/home/capistrano/.rvm/rubies/ruby-1.9.2-p290/bin/gem"
rake: "/home/capistrano/.rvm/gems/ruby-1.9.2-p290#mygemset/bin/rake"
setting up PATH in the deploy.rb solved this issue:
default_environment['PATH'] = "/usr/local/bin:/usr/bin:/bin:/opt/bin:$PATH"
it's a Gentoo distribution and the PATH var seems to be empty when using cap deploy, so I copied the content of server PATH and now it works
This issue went away for me when I installed nodejs (using apt-get) on my server. As I stated in this Stackoverflow answer, it's the most practical choice because you don't need to include any dependencies in your Gemfile.

Ubuntu RVM install issue rvm_ruby_src_path not set

Following instructions from http://web2linux.com/installing-rails-3-on-ubuntu-10-04-lucid-lynx/ I get to the following line:
rvm install 1.9.2
returns:
ruby-1.9.2-p0 - #fetching
ruby-1.9.2-p0 - #extracting ruby-1.9.2-p0 to
mv: cannot move `/tmp/rvm_src_18035/ruby-1.9.2-p0' to `': No such file or directory
~/.rvm/scripts/manage: line 1237: ruby-1.9.2-p0 - #extracted to : command not found
Running autoconf
Error running 'autoconf', please check ~/.rvm/log/ruby-1.9.2-p0/autoconf*.log
Skipping configure step, 'configure' does not exist, did autoconf not run successfully?
ruby-1.9.2-p0 - #compiling
Error running 'make ', please check ~/.rvm/log/ruby-1.9.2-p0/make*.log
There has been an error while running make. Halting the installation.
looking at .rvm/scripts/manage it seems that $rvm_ruby_src_path is not set. Am I missing anything in my setup? Below are more details on my environment:
$ rvm info
system:
system:
uname: "Linux host 2.6.32-24-generic #42-Ubuntu SMP Fri Aug 20 14:21:58 UTC 2010 x86_64 GNU/Linux"
bash: "/bin/bash => GNU bash, version 4.1.5(1)-release (x86_64-pc-linux-gnu)"
zsh: " => not installed"
rvm:
version: "rvm 1.0.7 by Wayne E. Seguin (wayneeseguin#gmail.com) [http://rvm.beginrescueend.com/]"
homes:
gem: "not set"
ruby: "not set"
binaries:
ruby: "/usr/bin/ruby"
irb: "/usr/bin/irb"
gem: "/usr/bin/gem"
rake: "/usr/bin/rake"
environment:
PATH: "~/.rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
GEM_HOME: ""
GEM_PATH: ""
BUNDLE_PATH: ""
MY_RUBY_HOME: ""
IRBRC: ""
RUBYOPT: ""
gemset: ""
$ ruby -v
ruby 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux
$ gem environment
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.7
- RUBY VERSION: 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux]
- INSTALLATION DIRECTORY: /usr/lib/ruby/gems/1.8
- RUBY EXECUTABLE: /usr/bin/ruby1.8
- EXECUTABLE DIRECTORY: /usr/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /usr/lib/ruby/gems/1.8
- ~/.gem/ruby/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- "gem" => "--no-ri --no-rdoc"
- REMOTE SOURCES:
- http://rubygems.org/
I just reinstalled my mac, and got the same problem.
Edit: after I run rvm update && rvm reload, it works!