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.
Related
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
I have following (and have shortened the full path to "/.../"):
$ gem environment
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.21
- RUBY VERSION: 1.9.2 (2012-02-14 patchlevel 318) [x86_64-linux]
- INSTALLATION DIRECTORY: /.../.rvm/gems/ruby-1.9.2-p318#rails-3.0
- RUBY EXECUTABLE: /.../.rvm/rubies/ruby-1.9.2-p318/bin/ruby
- EXECUTABLE DIRECTORY: /.../.rvm/gems/ruby-1.9.2-p318#rails-3.0/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /.../.rvm/gems/ruby-1.9.2-p318#rails-3.0
- /.../.rvm/gems/ruby-1.9.2-p318#global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
As you can see I have #global and #rails-3.0 gemsets. Passenger 3.0.11 is installed in the #global gemset, and I have a .rmvrc file in my application root:
rvm ruby-1.9.2-p318#rails-3.0
However, after running $ bundle install and restarting the app via $ touch tmp/restart.txt I keep getting the Passenger error screen with the following:
Error message: Could not find aaronh-chronic-0.3.9 in any of the sources (Bundler::GemNotFound)
This gem is installed in the #rails-3.0 gemset
Gemfile here.
$ gem list here
If I install the aaronh-chronic gem in the #global gemset, then it just complains about the next one in line. It's like it is only checking the #global gemset instead of first looking in my #rails-3.0 gemset. How can I get it to use both gemsets? (Full backtrace here.)
UPDATE: Here is my Passenger Apache configuration:
# In /etc/apache2/mods_available/passenger.load
LoadModule passenger_module /.../.rvm/gems/ruby-1.9.2-p318#global/gems/passenger-3.0.11/ext/apache2/mod_passenger.so
# In /etc/apache2/mods_available/passenger.conf
<IfModule mod_passenger.c>
PassengerRoot /.../.rvm/gems/ruby-1.9.2-p318#global/gems/passenger-3.0.11
PassengerRuby /.../.rvm/wrappers/ruby-1.9.2-p318#global/ruby
</IfModule>
Try bundle update and gem update --system.
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
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.
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!