`add_frozen_gem_path': undefined method `source_index' for Gem:Module (NoMethodError) OR Gem.source_index is deprecated

社会主义新天地 提交于 2019-12-03 18:23:28

Ruby 1.9.2 isn't that new, you should use 1.9.3-p448. Rubygems 1.8.25 is very old, and should be used with Ruby 1.8 only AFAIK. You are probably using a very old distro. Try using rvm to install the latest Ruby 1.9 and Rubygems. Here's a brief quick-start guide. Refer to the docs in case of troubles.

\curl -L https://get.rvm.io | bash -s stable
rvm install 1.9
rvm use 1.9 --default
rvm rubygems latest --verify-downloads 1
gem install bundler
bundle exec ./script/server

I resolved it by the command

rvm install rubygems 1.4.2 --force

Update mysgl adapter in mysql.yml file to mysql2

development:
      adapter: mysql2
      database: app_db
      username: root
      password: root
      host: localhost

The install mysql2 adapter

gem install activerecord-mysql2-adapter

Then, install the missing gems from config/environment.rb:

rake gems:install

give execute permission to the server file inside you project folder as:

chmod u+x ./script/server

Start the server: chmod u+x ./script/server ./script/server start or ./script/server or exec script/server

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