0

Webサイトを作成していますが、バージョン5ではなくRuby on Railsバージョン4を誤ってインストールしていて、私のシステムで現在持っているバージョンには欠けている機能のいくつかを使用するために最新のバージョンを使用しています。私は、このガイド以下試してみましたRuby on Rails 4.2.7.1から5.0.1へのアップグレード - まだレールを使用しようとしています4.2.7.1

:私はrvmをインストールして起動この節まで順番に全ての予選、走っ

http://railsapps.github.io/updating-rails.html

rvm use [email protected] --create 
gem install rails 
rails -v 

私は問題に走りました。 rvm use [email protected] --create出力:

ruby-2.3.1 - #gemset created /home/dev/.rvm/gems/[email protected] 
ruby-2.3.1 - #generating rails5.0 wrappers.......... 
Using /home/dev/.rvm/gems/ruby-2.3.1 with gemset rails5.0 

ファイン。私はその後、直接rails -vを実行したときに、私が得る、しかし

Fetching: rails-5.0.1.gem (100%) 
Successfully installed rails-5.0.1 

Fetching: railties-5.0.1.gem (100%) 
Successfully installed railties-5.0.1 

Could not find proper version of railties (4.2.7.1) in any of the sources 
Run `bundle install` to install missing gems. 

とき私Gem install railsも決定的、を含むすべての36個の宝石をインストールし、エラーなしで進行しますただし、bundle installを実行すると、システムはレール4.2.7.1に戻ります。

レールをインストールするには何か特別な作業が必要ですか?4.2.7.1とシステムをレールの元のバージョンに戻すのを停止するにはどうすればよいですか?私は非常にレールを使用していないので、私は構成に特に慣れていません。おそらく私は自分のアプリ内で設定ファイルを変更する必要がありますか?

+1

あなたの 'Gemfile'には何がありますか? – Iceman

+1

@Iceman Ah Ha!私は問題を発見したと思う!ありがとう... –

答えて

3

古いバージョン番号が含まれていたGemfileに問題がありました。私は、次のように更新:

source 'https://rubygems.org' 


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 
gem 'rails', '5.0.1' 
# Use mysql as the database for Active Record 
gem 'mysql2', '>= 0.3.13', '< 0.5' 
# Use SCSS for stylesheets 
gem 'sass-rails', '~> 5.0.6' 
# Use Uglifier as compressor for JavaScript assets 
gem 'uglifier', '>= 3.0.4' 
# Use CoffeeScript for .coffee assets and views 
gem 'coffee-rails', '~> 4.2.1' 
# 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.4.1' 
# bundle exec rake doc:rails generates the API under doc/api. 
gem 'sdoc', '~> 0.4.1', 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 

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

group :development do 
    # Access an IRB console on exception pages or by using <%= console %> in views 
    gem 'web-console', '~> 2.0' 

    # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring 
    gem 'spring' 
end 

はその後bundle install続いbundle updateを実行し、現在のRails 5.0.1を持っています。 Gemfileを見ることを提案してくれたIcemanに感謝します!

関連する問題