rails s: Could not find rake-10.4.2 in any of the sources (Bundler::GemNotFound)

混江龙づ霸主 提交于 2019-12-05 00:06:32

I had this problem using rbenv for my ruby 2.2.0 install. Fixed through trial and error.

I tried doing gem install rake but this didn't fix it. So I did:

gem uninstall rake
rbenv global 2.1.1
rbenv rehash
rbenv uninstall rake #this time gives error "rake is a default gem"
rbenv global 2.2.0
rbenv rehash
gem install rake
rails s #works this time

My expectation is that there was maybe a conflict somewhere in PATH or similar that was resolved with a complete remove

I've had that error with multi_json before. Fixed it by doing manual install gem install multi_json

I think your gems bundled with project (BUNDLED_PATH defined in projects .bundle/config).

If you need to run bundled version of rails server, you must type in console

bundle exec rails s

Or, alternatively, you can generate bin stubs of bundled gem commads by

bundle --binstubs

and run generated stub

bin/rails s

I needed only to correct the enable script.

cd /opt/rh/ruby-22
rpm -q -f enable
rh-ruby22-runtime-2.0-6.el6.x86_64
diff enable~ enable
1c1
< export PATH=/opt/rh/rh-ruby22/root/usr/bin${PATH:+:${PATH}}
---
> export PATH=/opt/rh/ruby/root/usr/local/bin/:/opt/rh/rh-ruby22/root/usr/bin${PATH:+:${PATH}}
scl enable rh-ruby22 bash

http://www.softwarecollections.org/

zubair khan
cd /usr/share/metasploit-framework/

Then use the following command

bundle install
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!