仮想環境を構築中です。初心者なのでよろしくお願いします。(ホストOSはwindows10です。)
インストールした内容は下記になります。
vagrant1.9.5
virtualbox5.1.22
centos7
ruby2.2.7
rails5.1.1
MySQL5.6.36
[vagrant@localhost ~]$ rails new ringo -d mysql --skip-bundle を実行。
bundle installしようとした手順。
Windows PowesShellを立ち上げる。
cd Kinoko (今後、複数の仮想マシンを作ることを想定して作り、それらをまとめるフォルダに移動)
cd Ringo (仮想マシンを作るためのフォルダも作りそこに移動)
C:¥Users¥abc¥Kinoko¥Ringo>
vagrant up
PuTTYを立ち上げる。
ssh接続完了。
[vagrant@localhost ~]$ と表示。
Cyberduck立ち上げる。
/home/vagrantに移動
ringoディレクトリにgemfileができているのを確認。
PuTTYに戻り
[vagrant@localhost ~]$ bundle install を実行。
Could not locate Gemfile
ディレクトリにGemfileが無いようなエラーが出ました。そこで、
[vagrant@localhost ~]$ cd ringoでringoディレクトリに移動し[vagrant@localhost ringo]$ bundle install実行。
動き始めた!と思ったら・・・・
①そもそもこのディレクトリに移動したのがダメだったのか?
. . Fetching mysql2 0.4.6 Installing mysql2 0.4.6 with native extensions . . Gem::Ext::BuildError: ERROR: Failed to build gem native extension. . . ----- mysql client is missing. You may need to 'apt-get install libmysqlclient-dev' or 'yum install mysql-devel', and try again. ----- *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. . . extconf failed, exit code 1 Gem files will remain installed in /home/vagrant/.rbenv/versions/2.2.7/lib/ruby/gems/2.2.0/gems/mysql2-0.4.6 for inspection. Results logged to /home/vagrant/.rbenv/versions/2.2.7/lib/ruby/gems/2.2.0/extensions/x86_64-linux/2.2.0-static/mysql2-0.4.6/gem_make.out An error occurred while installing mysql2 (0.4.6), and Bundler cannot continue. Make sure that `gem install mysql2 -v '0.4.6'` succeeds before bundling. In Gemfile: mysqls2
上記エラーが出ます。
[vagrant@localhost ringo]$ gem install mysql2 -v '0.4.6'
と実行してみました。
Building native extensions. This could take a while... ERROR: Error installing mysql2: ERROR: Failed to build gem native extension. . . ----- mysql client is missing. You may need to 'apt-get install libmysqlclient-dev' or 'yum install mysql-devel', and try again. ----- *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. . . extconf failed, exit code 1 Gem files will remain installed in /home/vagrant/.rbenv/versions/2.2.7/lib/ruby/gems/2.2.0/gems/mysql2-0.4.6 for inspection. Results logged to /home/vagrant/.rbenv/versions/2.2.7/lib/ruby/gems/2.2.0/extensions/x86_64-linux/2.2.0-static/mysql2-0.4.6/gem_make.out
エラーが出ます。また、ネットで検索して意味不明なまま[vagrant@localhost ringo]$ yum install mysql-devel
も実行してみたらいいとあったのでやってみましたが
Loaded plugins: fastestmirror You need to be root to perform this command.
と出てきました。どうしたらいいのか対処方法がわからずに嵌っております。どこをどうすればいいのでしょうか?
$ bundle installするにはどうすればいいのでしょうか?どなたか解決方法教えていただけませんでしょうか?
よろしくお願いします。
追記
また、ローカルディスクのC:¥Users¥abc¥Kinoko¥Ringo の中にはringoディレクトリはなかったのですがそれも関係あるのでしょうか?Ringoフォルダには.vagrantとvagrantfileしか無かったので不安です。
/home/vagrantからringoフォルダをコピーしておいた方がいいのかも教えていただければと思います。無くても大丈夫なのであればいいのですが・・・
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/05/25 08:18