gemset

Загрузка rvmrc и текущего gemset при открытии нового окна терминала в папке проекта

В разработке я пользуюсь rvm и активно использую gemsets. Достаточно в корень проекта положить файл .rvmrc с настройками, например, “rvm ruby-1.9.2@gemsetname” , который автоматически обработается при заходе в папку и загрузятся необходимая версия ruby и gemset.

Но, если открыть новое окно терминала сразу в папке проекта, то .rvmrc не обработается и загружаются ruby и gemset по умолчанию.

Есть простое решение: надо добавить в конец .bashrc следующую команду:

rvm rvmrc load

Voila!

#Repost @jewels_and_sparkle
・・・
#bonhamsjewels #newyork #finejewelry #auction #lot65 April 15th presents a one of a kind #gemset #enamel #diamond and #gold #insect #bug and #flower #necklace that converts into a #brooch and #earrings $12k-18k estimate #highfashion #fashion #luxuryjewelry #oneofakind #bonhamsny #bonhams #jewelryisart #jewelrycandy #showstopper #springtime #bling

#100happydays day 18. Finally remade these earrings after having a major fall out with the original settings and stones earlier last week. Much happier now, but the real question is whether or not to oxidise them. Help? #earrings #jewellery #techniques #stone #setting #amethyst #amazonite #pebbles #djcad #design. #gemset #silver #metal

RVMでGemSetsを使う

【1】RVMを利用してrubyを切り替え。(systemのrubyではgemsetを使えないっぽいから)

[root@server ~]# rvm use ree
Using /usr/local/rvm/gems/ree-1.8.7-2010.02

【2】gemsetの一覧確認

[root@server ~]# rvm gemset list

gemsets for ree-1.8.7-2010.02 (found in /usr/local/rvm/gems/ree-1.8.7-2010.02)
global

【3】新規gemsetを作成

Redmine専用のgemsetを作りたいから、redmineって名称で今回は新規作成。

[root@server ~]# rvm gemset create redmine
'redmine' gemset created (/usr/local/rvm/gems/ree-1.8.7-2010.02@redmine).

できたか確認

[root@server ~]# rvm gemset list
gemsets for ree-1.8.7-2010.02 (found in /usr/local/rvm/gems/ree-1.8.7-2010.02)
global
redmine

redmineっていうgemsetができてるからOK

【4】作成したgemsetを利用する

[root@server ~]# rvm gemset use redmine
Now using gemset 'redmine'

または

[root@server ~]# rvm use ree@redmine
Using /usr/local/rvm/gems/ree-1.8.7-2010.02 with gemset redmine

@以下に使用したいgemset名をつける

【5】どのgemsetを利用しているかの確認

[root@server ~]# rvm gemdir
/usr/local/rvm/gems/ree-1.8.7-2010.02@redmine

どのディレクトリを利用してるかで確認した。

【6】デフォルトで利用するように設定

[root@server ~]# rvm user use ree@redmine --default
Using /usr/local/rvm/gems/ree-1.8.7-2010.02 with gemset redmine

これで、利用するrubyとgemsetの指定ができてる。

参考にしたのはこのページ

第40回 RVM(Ruby Version Manager)による環境構築(2)

RVM: How to remove all gems from default gemset

To remove all gems from a gemset you use the gemset empty command:

$ rvm gemset empty <my_gemset_name>

And to remove the gems from default gemset, you must supply an empty string as the gemset name:

$ rvm gemset empty ""

{Daily Jewel} 19th Century Gemset Mermaid Pendant of Amazing!!!!

19th Century Gemset Mermaid Pendant A very rare late 19th century gemset, enamel and diamond pendant designed as a finely casted mermaid with polychrome enamel tail, a ruby and diamond belt, a diamond necklace and flared diamond set tunic with ruby rim, supporting an emerald and diamond drop, mounted in silver and gold. Source: Masterart.com via Epoque Jewels, Photo belongs to Epoque Jewels

Dot Dot Dash- The Rock Pool Ring, made from Sterling Silver with a Diamond set into the centre. #picoftheday #uk #unique #ukjewellery #unitedkingdom #uniquejewellery #ring #rockpool #exspensive #womansjewellery #sterlingsilver #gemsetting #handmade #jewellery #bristoljewellery #polishing @karlkarterjewellery @elleusa @streetstyled @the_luxury_life

Ruby Version Managers

What You’ll Be Creating

Different Ruby Version Managers

The RVM

The first thing that we discussed in the video was the Ruby Version Manager. Additional discussion around this pointed out that:

  • This was the first version manager version for Ruby
  • This introduced the concept of “GemSets”

RBENV

It’s also worth taking note of RBENV which can be found on GitHub.

This particular project uses the concept of “shims” for managing the various Ruby versions. Additionally, it’s lighter-weight and it’s less intrusive than RVM.

CHRuby

You can find CHRuby on GitHub, as well. As far as all of the version managers installed, this is by far the lightest one of them all and it’s the one that we use in the video above.

Conclusion

Each of these version managers allow us to have different versions of Ruby installed in our home directory, instead of having to install Ruby to the system with the OS package manager or manually. 

In this tutorial, we used chruby in this tutorial to experiment with managing multiple installed Ruby versions.



from Tuts+ Code http://ift.tt/1K0uqrt