2

Is there a way to get rid of the warning, when I traverse into a folder having a .rvmrc file.

====================================================================================

= NOTICE                                                                           =

====================================================================================

= RVM has encountered a new or modified .rvmrc file in the current directory       =

= This is a shell script and therefore may contain any shell commands.             =

=                                                                                  =

= Examine the contents of this file carefully to be sure the contents are          =

= safe before trusting it! ( Choose v[iew] below to view the contents )            =

====================================================================================

Do you wish to trust this .rvmrc file? (/home/sam/myrailsapp/.rvmrc)

y[es], n[o], v[iew], c[ancel]> y
Sam
  • 8,387
  • 19
  • 62
  • 97
  • It should only ask once, the very first time you enter the directory. Is it happening every time? – Ryan Clark Mar 08 '13 at 17:41
  • I guess in order to help get the answer you need a little more info would help. Are you using rvm? Do you want rvm to switch setups when traversing project directories or no? Do you get any other warning notices? Like uninstalled rubies or nonexistent gemsets? – Ryan Clark Mar 08 '13 at 17:52
  • 1
    It asks me every time, I move into this folder which is frustrating – Sam Mar 09 '13 at 05:30
  • Otherwise it works as expected? You say yes and it uses the desired ruby and gemset? – Ryan Clark Mar 09 '13 at 22:20

4 Answers4

1

There is a bug right now in RVM that keeps it asking you trusting .rvmrc.

Solution is simple - use .ruby-version instead:

1.9.3

or

1.9.3@gemset

Gemset will be created automatically for you.

.ruby-version is only for Ruby versions switching. If you need some scripting when switching Ruby, you still need .rvmrc.

ndnenkov
  • 35,425
  • 9
  • 72
  • 104
srigi
  • 1,682
  • 1
  • 15
  • 30
1

To switch from .rvmrc to .ruby-version + .ruby-gemset

rvm rvmrc to .ruby-version
Sam Backus
  • 1,693
  • 14
  • 19
0

According to the documentation:

To turn off the project specific rvmrc functionality in your $HOME/.rvmrc set:
rvm_project_rvmrc=0

I don't have a RVM instance to try it out, but I guess that's what you are looking for.

I'd also suggest to use rbenv instead of RVM, for the following reasons.

user703016
  • 37,307
  • 8
  • 87
  • 112
Janitrix
  • 203
  • 1
  • 8
  • 2
    This will turn off the use of individual `.rvmrc` flies that are specific to different projects. I think @Sam just wants to turn off the warning. – Ryan Clark Mar 08 '13 at 17:48
  • Yes, I just want to turn-off the notice. I still want the rvm to use the gemset which I specify (e.g. rvm use 1.9.3@myapp) – Sam Mar 09 '13 at 05:33
0

If RVM has been installed with sudo, you'll have to cd to the directory as root.

If you trust the .rvmrc or .ruby-env as root, the notice shouldn't come back.

Eric Duminil
  • 52,989
  • 9
  • 71
  • 124