質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Ruby on Rails 5

Ruby on Rails 5は、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Q&A

解決済

1回答

1908閲覧

Rails 起動できない

laminne

総合スコア80

Ruby on Rails 5

Ruby on Rails 5は、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

0グッド

0クリップ

投稿2018/08/18 05:31

前提・実現したいこと

rails s

を実行しようとしたところ、以下のエラーメッセージが発生しました。

発生している問題・エラーメッセージ

[!] There was an error parsing `Gemfile`: You cannot specify the same gem twice with different version requirements. You specified: rails (>= 0) and rails (~> 5.2.1). Bundler cannot continue. # from /home/vagrant/rails/Myapp01/Gemfile:7 # ------------------------------------------- # # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' > gem 'rails', '~> 5.2.1' # # Use sqlite3 as the database for Active Record # -------------------------------------------

Gemfile

1source 'https://rubygems.org' 2git_source(:github) { |repo| "https://github.com/#{repo}.git" } 3 4ruby '2.5.1' 5gem "rails" 6# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 7gem 'rails', '~> 5.2.1' 8# Use sqlite3 as the database for Active Record 9gem 'sqlite3' 10# Use Puma as the app server 11gem 'puma', '~> 3.11' 12# Use SCSS for stylesheets 13gem 'sass-rails', '~> 5.0' 14# Use Uglifier as compressor for JavaScript assets 15gem 'uglifier', '>= 1.3.0' 16# See https://github.com/rails/execjs#readme for more supported runtimes 17# gem 'mini_racer', platforms: :ruby 18 19# Use CoffeeScript for .coffee assets and views 20gem 'coffee-rails', '~> 4.2' 21# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks 22gem 'turbolinks', '~> 5' 23# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder 24gem 'jbuilder', '~> 2.5' 25# Use Redis adapter to run Action Cable in production 26# gem 'redis', '~> 4.0' 27# Use ActiveModel has_secure_password 28# gem 'bcrypt', '~> 3.1.7' 29 30# Use ActiveStorage variant 31# gem 'mini_magick', '~> 4.8' 32 33# Use Capistrano for deployment 34# gem 'capistrano-rails', group: :development 35 36# Reduces boot times through caching; required in config/boot.rb 37gem 'bootsnap', '>= 1.1.0', require: false 38 39group :development, :test do 40 # Call 'byebug' anywhere in the code to stop execution and get a debugger console 41 gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] 42end 43 44group :development do 45 # Access an interactive console on exception pages or by calling 'console' anywhere in the code. 46 gem 'web-console', '>= 3.3.0' 47 gem 'listen', '>= 3.0.5', '< 3.2' 48 # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring 49 gem 'spring' 50 gem 'spring-watcher-listen', '~> 2.0.0' 51end 52 53group :test do 54 # Adds support for Capybara system testing and selenium driver 55 gem 'capybara', '>= 2.15' 56 gem 'selenium-webdriver' 57 # Easy installation and use of chromedriver to run system tests with Chrome 58 gem 'chromedriver-helper' 59end 60 61# Windows does not include zoneinfo files, so bundle the tzinfo-data gem 62gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

試したこと

まだサーバーが起動しているのかと

cat tmp/pids/server.pid

としたのですが、

server.pid_ No such file or directory

補足情報(FW/ツールのバージョンなど)

Vagrant 1.8.6・CentOS 6.10

ちなみにbundle installを実行したところ、

Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this applicationfor all non-root users on this machine.

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

You cannot specify the same gem twice with different version requirements.

エラーメッセージのとおりです。バージョンの書かれていないgem 'rails'の行を消しておきましょう。

投稿2018/08/18 05:37

maisumakun

総合スコア145183

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

laminne

2018/08/18 05:45

無事起動できました。ありがとうございました。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問