2016-07-26 5 views
9

레일 5로 업그레이드하려고합니다. Gemfile.lock 파일을 삭제하고 내 Gemfile을 다음과 같이 편집했습니다.Rails 5로 업그레이드하려고 할 때 "Bundler가"railties "호환 오류를 찾을 수 없습니다."오류

source 'https://rubygems.org' 


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 
gem 'rails', '5.0.0' 
# Use sqlite3 as the database for Active Record 
gem 'sqlite3' 
# Use SCSS for stylesheets 
gem 'sass-rails', '~> 5.0' 
# Use Uglifier as compressor for JavaScript assets 
gem 'uglifier', '>= 1.3.0' 
# Use CoffeeScript for .coffee assets and views 
gem 'coffee-rails', '~> 4.1.0' 
# See https://github.com/rails/execjs#readme for more supported runtimes 
# gem 'therubyracer', platforms: :ruby 

# Use jquery as the JavaScript library 
gem 'jquery-rails' 
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks 
gem 'turbolinks' 
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder 
gem 'jbuilder', '~> 2.0' 
# bundle exec rake doc:rails generates the API under doc/api. 
gem 'sdoc', '~> 0.4.0', group: :doc 

# Use ActiveModel has_secure_password 
# gem 'bcrypt', '~> 3.1.7' 

# Use Unicorn as the app server 
# gem 'unicorn' 

# Use Capistrano for deployment 
# gem 'capistrano-rails', group: :development 

gem 'addressable' 
gem 'postgresql' 
gem 'pundit' 
gem 'omniauth-oauth2', '~> 1.3.1' 
gem 'omniauth-google-oauth2' 
gem 'omniauth-facebook' 
gem 'omniauth-twitter' 
gem 'omniauth-linkedin-oauth2' 
gem 'jquery-rails' 
gem 'jquery-ui-rails' 
gem 'jquery-modal-rails' 
gem 'will_paginate' 
gem 'bootstrap-sass' 
gem 'autoprefixer-rails' 
gem 'whenever', :require => false 
gem 'compass-rails' 

group :development do 
    gem 'rails_layout' 
end 

및 실행 아래에만 아래의 오류

$ bundle install 
Your Gemfile lists the gem jquery-rails (>= 0) more than once. 
You should probably keep only one of them. 
While it's not a problem now, it could cause errors if you change the version of just one of them later. 
Fetching gem metadata from https://rubygems.org/......... 
Fetching version metadata from https://rubygems.org/... 
Fetching dependency metadata from https://rubygems.org/.. 
Resolving dependencies.............. 
Bundler could not find compatible versions for gem "railties": 
    In Gemfile: 
    coffee-rails (~> 4.1.0) was resolved to 4.1.1, which depends on 
     railties (< 5.1.x, >= 4.0.0) 

    jquery-modal-rails was resolved to 0.0.1, which depends on 
     railties (< 5.0, >= 3.2.0) 

    jquery-rails was resolved to 4.1.1, which depends on 
     railties (>= 4.2.0) 

    rails (= 5.0.0) was resolved to 5.0.0, which depends on 
     railties (= 5.0.0) 

    sass-rails (~> 5.0) was resolved to 5.0.6, which depends on 
     railties (< 6, >= 4.0.0) 

    web-console (~> 2.0) was resolved to 2.3.0, which depends on 
     railties (>= 4.0) 

를 얻기 위해 "번들 설치"내가 어떻게 제대로 내 Gemfile 그래서 난 레일 5로 업그레이드 할 수 있습니다 수정합니까?

+1

나에게있어서의 문제 quiet_assets gem을 제거하는 방법은 없습니다. 또한 레일스 작곡가를 사용하는 경우 조용한 로깅을 위해 no를 입력해야합니다. (Rails 5) – earth2jason

답변

2

반복되는 jquery-rails gem 중 하나를 제거하고 번들 설치를 다시 실행하십시오. 또한

// remove this line  
gem 'jquery-rails' 

당신의 보석이에 대한 '커피 레일'라인 변경 : 다시 설치

source 'https://rubygems.org' 


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 
gem 'rails', '~> 5.0.0' 
# Use mysql as the database for Active Record 
gem 'mysql2', '>= 0.3.18', '< 0.5' 
# Use Puma as the app server 
gem 'puma', '~> 3.0' 
# Use SCSS for stylesheets 
gem 'sass-rails', '~> 5.0' 
# Use Uglifier as compressor for JavaScript assets 
gem 'uglifier', '>= 1.3.0' 
# Use CoffeeScript for .coffee assets and views 
gem 'coffee-rails', '~> 4.2' 
# See https://github.com/rails/execjs#readme for more supported runtimes 
# gem 'therubyracer', platforms: :ruby 

# Use jquery as the JavaScript library 
gem 'jquery-rails' 
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks 
gem 'turbolinks', '~> 5' 
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder 
gem 'jbuilder', '~> 2.5' 
# Use Redis adapter to run Action Cable in production 
# gem 'redis', '~> 3.0' 

# Use Capistrano for deployment 

group :development, :test do 
    # Call 'byebug' anywhere in the code to stop execution and get a debugger console 
    gem 'byebug', platform: :mri 
end 

group :development do 
    # Access an IRB console on exception pages or by using <%= console %> anywhere in the code. 
    gem 'web-console' 
    gem 'listen', '~> 3.0.5' 
    # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring 
    gem 'spring' 
    gem 'spring-watcher-listen', '~> 2.0.0' 
end 

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem 
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] 
+0

아무 것도하지 않습니다. 그것을 제거하고 동일한 오류가 발생했습니다. 왜 "jquery-rails"를 제거하면 "coffee-rails"와 관련된 오류를 해결할 수 있습니까? –

+0

2 배의 jquery-rails gem이 있기 때문에 Gemfile을 지울 수 있습니다. 다른 답변을 편집했습니다. –

+0

나는 당신의 Gemfile을 사용 했었지만 나의 보석에 다시 추가 할 때 에러가 발생한다. 나는 그 줄을 "gem 'jquery-modal-rails'로 좁혔습니다." 이를 포함하면 Rails 5에서 오류가 발생합니다. 슬프게도이 보석이 필요합니다. –

2

시도 :

gem 'coffee-rails', '~> 4.2' 

을 나는 레일 (5) 프로젝트는 Gemfile에 따라 문제없이 실행이 난간 보석 :

gem install railties