Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
409 views
in Technique[技术] by (71.8m points)

ruby - Active_Model error in rails

I went back to a rails project I was working on and the command "rails s" started to fail. The Terminal recommended that I run a bundle install. When I did I received the following message:

    Bundler could not find compatible versions for gem "activemodel":
    In Gemfile:
    protected_attributes (>= 0) ruby depends on
    activemodel (< 5.0, >= 4.0.0.beta) ruby

    rails (>= 0) ruby depends on
    activemodel (3.2.12) 

I have updated both ruby and rails. I've re-installed active model and restarted my terminal.

My gems file is very simple:

 gem 'rails'
 gem 'jquery-rails'
 gem 'devise'
 gem 'simple_form'
 gem 'protected_attributes'

group :production do
gem 'pg' 
  end

 group :development, :test do 
gem 'sqlite3'
  end

  group :assets do
  gem 'sass-rails',   '~> 3.2.3'
   gem 'coffee-rails', '~> 3.2.1'
   gem 'bootstrap-sass', '~> 2.2.2.0'
   gem 'bootstrap'
   end
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Remove your Gemfile.lock and run

  • rm Gemfile.lock

    and

  • bundle install


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...