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

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

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

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

Q&A

1回答

527閲覧

環境設定は出来ていると思うのですが、Railsのインストールが上手くいきません

dorgan

総合スコア8

Ruby on Rails

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

0グッド

0クリップ

投稿2017/07/03 04:43

###前提・実現したいこと

Rails Tutorialをやっているのですが、rails server立ち上げの際のbundle installがうまく行きません。環境設定等が出来ているつもりではあるのですが、$ gem install rails -v 5.0.3のコマンドすら機能しません。サーバーが立ち上がるところまでどうにかたどり着きたいです。

###発生している問題・エラーメッセージ
ERROR: Error installing nio4r:
The 'nio4r' native gem requires installed build tools.

Please update your PATH to include build tools or download the DevKit
from 'http://rubyinstaller.org/downloads' and follow the instructions
at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'

###該当のソースコード
C:\Users\matsukazu1112\untitled1>bundle install
The dependency byebug (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for x86-mingw32, x64-mingw32 but the dependency is only for ruby. To add those platforms
to the bundle, run bundle lock --add-platform ruby.
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 "activesupport":
In snapshot (Gemfile.lock):
activesupport (= 5.1.2)

In Gemfile:
web-console x86-mingw32 was resolved to 3.5.1, which depends on
actionview (>= 5.0) x64-mingw32 was resolved to 5.1.2, which depends on
activesupport (= 5.1.2) x86-mingw32

web-console x86-mingw32 was resolved to 3.5.1, which depends on actionview (>= 5.0) x64-mingw32 was resolved to 5.1.2, which depends on activesupport (= 5.1.2) x86-mingw32 web-console x86-mingw32 was resolved to 3.5.1, which depends on actionview (>= 5.0) x64-mingw32 was resolved to 5.1.2, which depends on activesupport (= 5.1.2) x86-mingw32 web-console x86-mingw32 was resolved to 3.5.1, which depends on actionview (>= 5.0) x64-mingw32 was resolved to 5.1.2, which depends on activesupport (= 5.1.2) x86-mingw32 rails (~> 5.0.3) x64-mingw32 was resolved to 5.0.3, which depends on activesupport (= 5.0.3) x86-mingw32

Running bundle update will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.

C:\Users\matsukazu1112\untitled1>gem update --system
Latest version currently installed. Aborting.

C:\Users\matsukazu1112\untitled1>gem install bundler
Successfully installed bundler-1.15.1
Parsing documentation for bundler-1.15.1
Done installing documentation for bundler after 7 seconds
1 gem installed

C:\Users\matsukazu1112\untitled1>bundle install
The dependency byebug (>= 0) will be unused by any of the platforms Bundler is installing for. Bund
ler is installing for x86-mingw32, x64-mingw32 but the dependency is only for ruby. To add those pl
atforms to the bundle, run bundle lock --add-platform ruby.
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 "activesupport":
In snapshot (Gemfile.lock):
activesupport (= 5.1.2)

In Gemfile:
web-console x86-mingw32 was resolved to 3.5.1, which depends on
actionview (>= 5.0) x64-mingw32 was resolved to 5.1.2, which depends on
activesupport (= 5.1.2) x86-mingw32

web-console x86-mingw32 was resolved to 3.5.1, which depends on actionview (>= 5.0) x64-mingw32 was resolved to 5.1.2, which depends on activesupport (= 5.1.2) x86-mingw32 web-console x86-mingw32 was resolved to 3.5.1, which depends on actionview (>= 5.0) x64-mingw32 was resolved to 5.1.2, which depends on activesupport (= 5.1.2) x86-mingw32 web-console x86-mingw32 was resolved to 3.5.1, which depends on actionview (>= 5.0) x64-mingw32 was resolved to 5.1.2, which depends on activesupport (= 5.1.2) x86-mingw32 rails (~> 5.0.3) x64-mingw32 was resolved to 5.0.3, which depends on activesupport (= 5.0.3) x86-mingw32

Running bundle update will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.

C:\Users\matsukazu1112\untitled1>bundle update
The dependency byebug (>= 0) will be unused by any of the platforms Bundler is installing for. Bund
ler is installing for x86-mingw32, x64-mingw32 but the dependency is only for ruby. To add those pl
atforms to the bundle, run bundle lock --add-platform ruby.
Fetching gem metadata from https://rubygems.org/...........
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies...
Using rake 12.0.0
Using concurrent-ruby 1.0.5
Using i18n 0.8.4
Using minitest 5.10.2
Using thread_safe 0.3.6
Using builder 3.2.3
Using erubis 2.7.0
Using mini_portile2 2.2.0
Using rack 2.0.3
Fetching nio4r 2.1.0
Installing nio4r 2.1.0 with native extensions
Using websocket-extensions 0.1.2
Using mime-types-data 3.2016.0521
Using arel 7.1.4 (was 8.0.0)
Using bundler 1.15.1
Using method_source 0.8.2
Using thor 0.19.4
Using sqlite3 1.3.13 (x64-mingw32)
Fetching puma 3.9.1
Installing puma 3.9.1 with native extensions
Using sass 3.4.24
Using tilt 2.0.7
Using execjs 2.7.0
Using coffee-script-source 1.12.2
Using turbolinks-source 5.0.3
Using multi_json 1.12.1
Fetching bindex 0.5.0
Installing bindex 0.5.0 with native extensions
Using rb-fsevent 0.10.2
Using ffi 1.9.18 (x64-mingw32)
Using tzinfo 1.2.3
Using nokogiri 1.8.0 (x64-mingw32)
Using rack-test 0.6.3
Using sprockets 3.7.1
Gem::InstallError: The 'nio4r' native gem requires installed build tools.

Please update your PATH to include build tools or download the DevKit
from 'http://rubyinstaller.org/downloads' and follow the instructions
at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'

An error occurred while installing nio4r (2.1.0), and Bundler cannot continue.
Make sure that gem install nio4r -v '2.1.0' succeeds before bundling.

In Gemfile:
rails was resolved to 5.0.4, which depends on
actioncable was resolved to 5.0.4, which depends on
nio4r

C:\Users\matsukazu1112\untitled1>ruby -v
ruby 2.2.6p396 (2016-11-15 revision 56800) [x64-mingw32]

C:\Users\matsukazu1112\untitled1>atsukazu1112\untitled1>ruby -v
指定されたパスが見つかりません。

C:\Users\matsukazu1112\untitled1>ruby 2.2.6p396 (2016-11-15 revision 56800) [x64-mingw32]
ruby: No such file or directory -- 2.2.6p396 (LoadError)

C:\Users\matsukazu1112\untitled1>
C:\Users\matsukazu1112\untitled1>gem install nio4r -v '2.1.0'
'`gem' は、内部コマンドまたは外部コマンド、
操作可能なプログラムまたはバッチ ファイルとして認識されていません。

C:\Users\matsukazu1112\untitled1>gem install nio4r -v '2.1.0
ERROR: Error installing nio4r:
The 'nio4r' native gem requires installed build tools.

Please update your PATH to include build tools or download the DevKit
from 'http://rubyinstaller.org/downloads' and follow the instructions
at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'

###試したこと
Bundle installを行うとbundle updateを先にするように指示をされ、bundle updateを行うと、'gem install nio4r -v'2.1.0'というメッセージが表示され、developmentkitの設定に問題があるというメッセージが表示されます。Developmentkitとrubyともに手順通りCドライブ直下にインストールしてあるのですが、何か想定される原因がありましたら教えていただけますでしょうか。初心者なので仕組みが理解できておらず申し訳ございません。

###環境
ruby 2.2.6p396 (2016-11-15 revision 56800) [x64-mingw32]
Developmentkit

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

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

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

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

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

guest

回答1

0

windowsは窓から投げ捨てたので、よく覚えていませんが
DevelopmentkitのPATHが通っていないようです。

コマンドプロンプトを使い
cd C:\devkit
ruby dk.rb init
ruby dk.rb install
をしましたか?

やってもうまくいかない場合まずwindowsを再起動してみて
それでもうまくいかない場合、
手動でPATHを設定してください。
C:¥devkit¥をwindowsのpathに追加
さらに再起動してそれでも、うまくいかなかったら。
rubyの64-bit版をアンインストールしてください
参考サイト
それでも無理だったら
Windowsを窓から投げ捨ててMacを購入してください。

投稿2017/07/03 04:59

編集2017/07/03 05:03
moke

総合スコア2241

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

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

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

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

ただいまの回答率
85.51%

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

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

質問する

関連した質問