Rails is not using my global Ruby version

前端 未结 3 1617
执笔经年
执笔经年 2021-01-12 04:18

I want to use Rails with Ruby 2.1.0, but it\'s using Ruby 1.9.3 (the system\'s version).

I\'m using rbenv to manage my Ruby versions. My steps were something along t

3条回答
  •  囚心锁ツ
    2021-01-12 04:51

    You didn't tell how you installed rbenv, but I think it is per-user installation (which is default). In this case you should install gems without using sudo. When you did sudo gem install rails, it was installed in system ruby, not rbenv's selected one.

    Solution - install rails without sudo:

    rbenv global 2.1.0
    gem install rails
    rbenv rehash
    

提交回复
热议问题