Question

I am trying to setup Octopress on my Mac. The default version of Ruby on my Mac was 1.8.7 but I have upgraded it to 2.0.0.

If I do:

which ruby

it prints:

/Users/liqiushi/.rvm/rubies/ruby-2.0.0-p247/bin/ruby

After cloning my existed sources from github and 'cd'ing into that folder, I got the following error:

You are using '.rvmrc', it requires trusting, it is slower and it is
not compatible with other ruby managers, you can switch to
'.ruby-version' using 'rvm rvmrc to [.]ruby-version' or ignore this
warning with 'rvm rvmrc warning ignore
/Users/liqiushi/Documents/photosynthesiis.github.com/.rvmrc', '.rvmrc'
will continue to be the default project file in RVM 1 and RVM 2, to
ignore the warning for all files run 'rvm rvmrc warning ignore
all.rvmrcs

ruby-1.9.3-p448 is not installed.
To install do: 'rvm install ruby-1.9.3-p448'

If I do:

ruby -v

in the Octopress folder it prints:

ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]

And, if I do:

which ruby

It prints:

/usr/bin/ruby

Can anyone tell how to make Octopress use the Ruby I just upgraded in my Mac instead of using 1.8.7?

Was it helpful?

Solution

Octopress is using your system ruby, ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0].

You're using RVM, the ruby-2.0.0-p247 is a ruby you've installed. The repository has an .rvmrc file saying it wants ruby-1.9.3-p448. Try installing it, or change what the .rvmrc wants.

edit: The error message tells you what to do:

ruby-1.9.3-p448 is not installed.
To install do: 'rvm install ruby-1.9.3-p448'

OTHER TIPS

RVM has a "default" Ruby that, immediately after installation, you should have set using:

rvm use 2.0.0 --default

See RVM's rvm help use command and "Setting the default Ruby" for more information. That covers the cases where you don't have a .rvmrc file in the directory.

For directories where it exists, you can remove the file:

rm ./.rvmrc

Or edit it to contain the information for the version you do want RVM to use when you cd into the directory. See RVM's "RVM Best Practices" for good tips on dealing with RVM in general and the tip of the discussion about using .rvmrc files. RVM's "rvmrc" capability is pretty nice. The previous link 'splains it nicely and details settings you can adjust to make your life a lot easier.

In that page you'd find:

As of RVM 1.8.0, after a survey where greater than 80% of respondants wanted the feature on by default, automatic loading of project .rvmrc files is opt-out by default (therefore on). In order to disable this feature, set the following value in either /etc/rvmrc or ~/.rvmrc:

rvm_project_rvmrc=0
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top