Can't install JSON gem

前端 未结 7 468
被撕碎了的回忆
被撕碎了的回忆 2021-01-02 02:46

I need to install json because I get this error:

Could not find json-1.4.6 in any of the sources

I ran gem install json and b

7条回答
  •  一生所求
    2021-01-02 03:02

    Why did you run gem install json at all? Bundler takes care of that for you and will ensure that the correct version of each gem is installed (since sometimes dependencies require an older version). Run

    gem uninstall json
    bundle install
    

    Also ensure you have source 'https://rubygems.org' at the top of your Gemfile.

    As for the permissions info, you may have to run gem and bundle commands with sudo.

    By the way, I highly recommend taking a look at and using RVM, particularly the gemsets feature. It will make your life infinitely better when developing Ruby apps. If you decide to do so, I'd also suggest trashing all the gems you've install using the system Ruby by running sudo rm -rf /Library/Ruby/Gems/1.8/. It's also important that when using RVM you don't have to use sudo when running gem (or bundle), which is not only safer but less typing too.

提交回复
热议问题