I'm trying to make a gemset the default whenever I start a new terminal in Mac OS X:
rvm use 1.9.3#rails3.2 --create --default
That seems to work, the rails3.2 gemset becomes the current gemset:
$ rvm gemset list
gemsets for ruby-1.9.3-p0 (found in /Users/me/.rvm/gems/ruby-1.9.3-p0)
global
=> rails3.2
$
But when I open up a new terminal, the rails3.2 gemset is no longer the current:
$ rvm gemset list
gemsets for ruby-1.9.3-p0 (found in /Users/me/.rvm/gems/ruby-1.9.3-p0)
global
rails3.2
$
What do I do?
Have you tried specifying rvm --default use after the gemset is created so passing:
rvm --default use ruby-1.9.3-p0#rails3.2
and then seeing if that sticks? Using create and default at the same time isn't something I've tried before, it's the only thing that strikes me as out of place.
Given the discussion below I'd offer this as a means for dealing with the problem. (Personally, I'd probably implode rvm and start over.) But, if you wanted to try to make a go of it with this install then I'd look at your .rvm folder, specifically in .rvm/environments/default which will contain all the environment variables exported for the default environment. Here you'll find rvm_gemset_name this may be set incorrectly and isn't updated for some reason (permissions?) or is set correctly in which case its some other environment issue. You could try manually setting it here in the file if its not correct.
You can use this command.
rvm use --default <ruby version>#<gemset name>
or
rvm --default use <ruby version>#<gemset name> or
rvm use <ruby version>#<gemset name> --default
Use following command to make a gemset as default.
rvm use <ruby version>#<gemset name> --default
eg.
rvm use 1.8.7-p370#mygemset --default
Interesting that nobody has mentioned rvm alias. Try your version-specific variation of this, works for me:
$ rvm alias create default ruby-2.3.0#rails_4_2_6
# me logs out, fetches another coffee
# me logs in
$ rvm list
rvm rubies
ruby-2.2.4 [ x86_64 ]
=* ruby-2.3.0 [ x86_64 ]
$ rvm gemset list
gemsets for ruby-2.3.0 (found in /home/aclarke/.rvm/gems/ruby-2.3.0)
(default)
global
=> rails_4_2_6
rubyracer related issue might as well come with libv8.
To get around this issue:
Step 1: Run the following command to uninstall any existing installation of libv8:
gem uninstall libv8
Install rubyracer by running the following command:
gem install therubyracer -v 0.12.2
Install libv8 by running the following command:
gem install libv8 -v 3.16.14.15 -- --with-system-v8
Try bundle install now:
bundle install
You can use this command
$ rvm use rubyversion#gemsetname --create --ruby-version
For example :
ruby version = ruby-2.1.2
gemset name = gem320
It would be
$ rvm use ruby-2.1.2#gem320 --create --ruby-version.
Even if you open other tab also, it will preserve the settings.
Related
Just installed rvm. When I use: rvm use 1.9.3, I get:
Gemset '' does not exist, 'rvm gemset create ' first, or append '--create'.
When I do: rvm gemset create test, I get:
Can not create gemset before using a ruby. Try 'rvm use <some ruby>'.
Running:
rvm use 1.9.3 --install --create
will solve the problem, there had to be an error during installation which prevented creating default/global gemsets, did you notice anything?
I am on Linux Mint 12.
I installed RVM and ran these commands:
rvm 1.9.2
rvm --default use 1.9.2
but ruby -v still outputs ruby 1.8.7.
sudo apt-get install ruby1.9.2 returns saying 1.9.1 is the latest version.
How do I get Ruby to be running on 1.9.2?
When I run rvm list like suggested at "Ruby 1.9.2 keeps reverting back to 1.8.7 after installing it using RVM", it outputs:
rvm rubies
ruby-1.8.7-p352 [ x86_64 ]
=> ruby-1.9.2-p290 [ x86_64 ]
So I think I must have a configuration issue. My OS seems to be defaulting to the wrong version of Ruby.
I ran:
sudo apt-get remove ruby
But had no change.
You add string [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" into ~/.bashrc? First, show your echo $PATH output. If this looks like (rvm paths before system paths):
/home/ayunin/.rvm/gems/ruby-1.9.3-rc1/bin:/usr/bin:/bin:/usr/bin/X11
Then you ran into the magick. Restart your terminal, and show ruby version. If does not work - you can launch rvm implode and reinstall all, yes.
It looks like Linux Mint 12 has ruby-rvm already installed (at least on my machine) so could this be a problem?
you can stick with that but then I think you will need to add your username to the rvm group with usermod -a -G username rvm.
I removed removed ruby-rvm completely (with apt-get) and then followed the installation instructions from https://rvm.beginrescueend.com/rvm/install/ for 'single user' thus all my rvm files are located in ~/.rvm/bin/rvm
I added the line for rvm in my .bashrc and tested with 1type rvm | head -1`.
After that rvm install 1.9.2 just worked and I installed it into ~/.rvm/rubies/ruby-1.9.2
After that rvm use --default 1.9.2 set all up correctly.
I have global gems and various gemsets. I want to remove all gems of a gemset. Is there a way do to this, besides uninstalling the gemset?
Use the gemset empty command:
rvm gemset empty mygems
This command removes all the ruby gems installed locally in 1-step
Works well in Ubuntu 10.10
gem list | cut -d" " -f1 | xargs gem uninstall -aIx
PS - removes all local gems. Use sudo accordingly.
you can also use rvm --force gemset empty
rvm gemset empty <gemset name>
This will remove all gems from your mentioned gemset.
rvm gemset empty <gemset> works, but only if you specify a gemset name.
If you want to empty the default gemset, you need to pass an empty string for the gemset name.
rvm gemset empty mygems ""
Isn't removing all the gems out of a gemset essentially the same operation as deleting a gemset and then adding it back? Why not just do this:
$ rvm gemset mygemset
$ rvm gemset delete mygemset
$ rvm gemset create mygemset
This is the safest way to uninstalling all gems of a gemset
Step 1
If you gem version is less then 2.1.
gem update --system
gem --version
Step 2
gem uninstall --all
references
I've run into a lot of issues whilst attempting to install RVM on Ubuntu 9.10. Here's the steps I've tried doing:
install ruby (via ruby site, no package manager)
download rvm
install rvm (make edit to .bashrc)
use rvm to install ruby version & gems
Is there any crucial step that I seem to be missing?
Be sure to have selected an installed ruby (the --default portion tells rvm you want this ruby to be your default ruby version). Something like:
rvm --default use 1.9.2
Also this command will tell you which ruby is currently selected:
rvm list
And hopefully you'll see something like:
rvm rubies
ruby-1.9.2-p0 [ x86_64 ]
=> ruby-1.8.7-p302 [ x86_64 ]
At this point, you'll be able to install gems and hopefully have a successful rvm install and working environment.
I've had issues in the past where I didn't have an rvm ruby selected and was still working with my distribution's ruby and gems and got mixed up easily. Make sure you're ruby and gem commands are working out of your ~/.rvm folder whith the following commands:
which ruby
which gem
Good luck!
What are the issues you're running into? Sometimes I forget to switch into the correct rvm environment (e.g. rvm ree), so it helps to place a .rvmrc file in project directories.
I would start off by removing ubuntu's ruby installation so that you don't have to worry about conflicts (although rvm will setup your PATH correctly). Following the instructions at RVM, run the following command to install rvm,
bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )
and then install system dependencies as listed in rvm notes. and then install the specific ruby version you want (e.g. rvm install ree or rvm install 1.9.1)
Important : for a good installation try this :
type rvm | head -n1
Must return : rvm is a function
else add this line
[[ -s "/usr/local/rvm/scripts/rvm" ]] && . "/usr/local/rvm/scripts/rvm"
in your profile.
I installed RVM with a few versions of Ruby-interpreters some time ago.
How I can to update it, because new versions are already released?
I found only one way: rvm install 1.9.2-rc1 && rvm remove 1.9.2-preview1, but my gems are lost.
Can I update branches time to time? I haven't found any tips in the documentation.
Use the rvm upgrade 1.9.2-preview1 1.9.2-rc1 command or watch this screencast
[Edit: rvm has a new command to upgrade-- you likely want to use the answer by andy318]
AFAIK, there is no automatic way to do this at the moment, but something like this enables you to keep your gems:
rvm use 1.9.2-preview1
rvm gemset export
rvm install 1.9.2-rc1
rvm use 1.9.2-rc1
rvm gemset import
rvm remove 1.9.2-preview1
Now, for automating updates, you would have to detect version changes, that is easy, as you can simply use the return value of rvm use 1.9.2. Finding out what the new version is (1.9.2-rc1) is unnecessary, as it is aliased as 1.9.2. The trick is to find the latest installed version of 1.9.2. You could do something like this in a cron job:
# make sure you source rvm first
rvm update --head
rvm reload
if [ ! rvm use 1.9.2 ]; then
for ruby_version in `rvm list strings`; do
# find the latest version of 1.9.2
case $ruby_version in
ruby-1.9.2-*) latest192=$ruby_version;;
esac
done
rvm use $latest192
rvm gemset export 192.gems
rvm install 1.9.2
rvm use 1.9.2
rvm gemset import 192
rvm remove $latest192
fi
Did not try that, but I have similar code in my update script. I also slipped in a gem update and other stuff.
Feel free to visit the #rvm IRC channel on Freenode.
Current rvm version provides an easier way to do this. The 'upgrade' option will migrate gem sets, wrappers and environment files -
$ rvm upgrade 1.9.2-p136 1.9.2-p180
To find out if there is a more recent stable version of a ruby implementation for you to upgrade to, first get the latest version of RVM and then enumerate the known versions of Ruby.
$ rvm get stable
$ rvm list known
You can compare this the ruby versions installed on your system
$ rvm list rubies
you can install latest rvm and ruby by :
$ \curl -L https://get.rvm.io | bash -s stable --ruby
and check all the ruby version with stability
$ rvm list known
can also check details here : http://www.ruby-lang.org/en/downloads/
$ rvm install ruby 2.0.0-p247
Use when you want to download specific version or know this is stable.
There's a fantastic RVM GUI called JewelryBox that I use to manage my Ruby versions
http://jewelrybox.unfiniti.com
I think that is:
rvm all do gemset update