konchanxxx / menta

MENTAのタスク管理用リポジトリ
0 stars 0 forks source link

Bundleインストールに関して 現場で使えるrails速習3 #32

Closed RYUTAONO0929 closed 5 years ago

RYUTAONO0929 commented 5 years ago

概要

bundleコマンドを入力してもインストールが始まりません

実現したいこと

3-1-5 p87

困っていること

bundleコマンドを入力し2時間半待ちましたが一向にインストールが始まりません。

困っていることがバグの場合は事象やログ、エラーメッセージをできるだけそのまま(抜粋などしない)下記に記載してください。

ryutaono@DESKTOP-G6D20US:~$ bundle Could not locate Gemfile ryutaono@DESKTOP-G6D20US:~$ bundle Could not locate Gemfile ryutaono@DESKTOP-G6D20US:~$ cd taskleaf ryutaono@DESKTOP-G6D20US:~/taskleaf$ bundle

解決するために行ったこと

cd taskleafでtaskleafファイルへ移動してbundleを実行しました。

問題となっている箇所の予想

rails s でサーバーを立ち上げてからbundleコマンドを入力すべきかもしれない。。。

問題となっているアプリケーションのGitHub URL

RYUTAONO0929 commented 5 years ago

wifiの速度を図ったところ61Mbpsでした。

RYUTAONO0929 commented 5 years ago

再起動して同じことをしましたが改善されませんでした

konchanxxx commented 5 years ago

Gemfileはどうなっていますか?

konchanxxx commented 5 years ago
$ cat Gemfile

とかで出力して欲しいです。

konchanxxx commented 5 years ago

あとはpath指定して依存パッケージをダウンロードする方が一般的なので taskleafのディレクトリで

$ bundle install --path vendor/bundle

とかしてみて欲しいです。bundleだけだとシステム共通のディレクトリにパッケージがインストールされるんですが、path指定することでtaskleafのアプリにだけ影響する環境にパッケージをインストールすることができます。

$ ls -la vendor/bundle

とかすると依存パッケージが確認できるはずです.

RYUTAONO0929 commented 5 years ago

Gemfileはこんな感じです

ryutaono@DESKTOP-G6D20US:~$ cd taskleaf ryutaono@DESKTOP-G6D20US:~/taskleaf$ cat Gemfile cat: Gemfile: Permission denied ryutaono@DESKTOP-G6D20US:~/taskleaf$

konchanxxx commented 5 years ago

あれ、Gemfileに権限がないって出てますね 一つ上のディレクトリ階層に cd .. とかで戻って

$ ls -la .

するとどうなりますか?. でカレントディレクトリの情報を表示します。

RYUTAONO0929 commented 5 years ago

ryutaono@DESKTOP-G6D20US:~$ ls -la . total 16 drwxr-xr-x 1 ryutaono ryutaono 4096 Feb 16 17:12 . drwxr-xr-x 1 root root 4096 Feb 14 18:30 .. -rw------- 1 ryutaono ryutaono 5579 Feb 16 17:46 .bash_history -rw-r--r-- 1 ryutaono ryutaono 220 Feb 14 18:30 .bash_logout -rw-r--r-- 1 ryutaono ryutaono 3891 Feb 15 16:21 .bashrc drwxrwxrwx 1 ryutaono ryutaono 4096 Feb 16 08:39 .bundle drwxrwxrwx 1 ryutaono ryutaono 4096 Feb 16 08:14 .gem -rw-rw-rw- 1 ryutaono ryutaono 19 Feb 16 08:14 .gemrc -rw-r--r-- 1 ryutaono ryutaono 807 Feb 14 18:30 .profile -rw------- 1 ryutaono ryutaono 3 Feb 16 11:35 .psql_history drwxrwxrwx 1 ryutaono ryutaono 4096 Feb 16 08:14 .rbenv -rw-r--r-- 1 ryutaono ryutaono 0 Feb 14 18:31 .sudo_as_admin_successful -rw-rw-rw- 1 ryutaono ryutaono 173 Feb 16 11:14 .wget-hsts lrwxrwxrwx 1 ryutaono ryutaono 11 Feb 15 16:16 Code -> /mnt/c/Code drwxrwxrwx 1 ryutaono ryutaono 4096 Feb 16 11:37 scaffold_app drwxrwxrwx 1 ryutaono ryutaono 4096 Feb 17 13:38 taskleaf ryutaono@DESKTOP-G6D20US:~$

こうなります

konchanxxx commented 5 years ago

あ、コードや出力を ``` バッククォート3つで前後囲むとみやすくなります。 https://qiita.com/uasi/items/251f4e66ceb95c043b3d

konchanxxx commented 5 years ago

パーミッションがおかしなことなっているはずなので

$ chmod -R 755 ./taskleaf

とかしてほしいです

konchanxxx commented 5 years ago

それはシングルクォートですね

RYUTAONO0929 commented 5 years ago

$ chmod -R 755 ./taskleaf

入力しました

konchanxxx commented 5 years ago

それで

cd ./taskleaf
cat Gemfile

したらどうなりますか?

konchanxxx commented 5 years ago

前方がシングルクォートになってますね

RYUTAONO0929 commented 5 years ago
-rw-r--r-- 1 ryutaono ryutaono 3891 Feb 15 16:21 .bashrc
drwxrwxrwx 1 ryutaono ryutaono 4096 Feb 16 08:39 .bundle
drwxrwxrwx 1 ryutaono ryutaono 4096 Feb 16 08:14 .gem
-rw-rw-rw- 1 ryutaono ryutaono   19 Feb 16 08:14 .gemrc
-rw-r--r-- 1 ryutaono ryutaono  807 Feb 14 18:30 .profile
-rw------- 1 ryutaono ryutaono    3 Feb 16 11:35 .psql_history
drwxrwxrwx 1 ryutaono ryutaono 4096 Feb 16 08:14 .rbenv
-rw-r--r-- 1 ryutaono ryutaono    0 Feb 14 18:31 .sudo_as_admin_successful
-rw-rw-rw- 1 ryutaono ryutaono  173 Feb 16 11:14 .wget-hsts
lrwxrwxrwx 1 ryutaono ryutaono   11 Feb 15 16:16 Code -> /mnt/c/Code
drwxrwxrwx 1 ryutaono ryutaono 4096 Feb 16 11:37 scaffold_app
drwxrwxrwx 1 ryutaono ryutaono 4096 Feb 17 13:38 taskleaf
ryutaono@DESKTOP-G6D20US:~$ chmod -R 755 ./taskleaf
ryutaono@DESKTOP-G6D20US:~$ cd ./taskleaf
ryutaono@DESKTOP-G6D20US:~/taskleaf$ cat Gemfile
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '2.5.0'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.2.2'
# Use postgresql as the database for Active Record
gem 'pg', '>= 0.18', '< 2.0'
# Use Puma as the app server
gem 'puma', '~> 3.11'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'mini_racer', platforms: :ruby

# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# 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', '~> 4.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use ActiveStorage variant
# gem 'mini_magick', '~> 4.8'

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

# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.1.0', require: false

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

group :development do
  # Access an interactive console on exception pages or by calling 'console' anywhere in the code.
  gem 'web-console', '>= 3.3.0'
  gem 'listen', '>= 3.0.5', '< 3.2'
  # 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

group :test do
  # Adds support for Capybara system testing and selenium driver
  gem 'capybara', '>= 2.15'
  gem 'selenium-webdriver'
  # Easy installation and use of chromedriver to run system tests with Chrome
  gem 'chromedriver-helper'
end

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

gem 'slim-rails'
gem 'html2slim'
konchanxxx commented 5 years ago

バッククォート3つで前後挟む感じですー

konchanxxx commented 5 years ago

''' ではなく ``` ですね

konchanxxx commented 5 years ago

Gemfileが参照できているみたいなので実行できそうです taskleafのディレクトリで bundle install --path vendor/bundle したらどうなりますか?

RYUTAONO0929 commented 5 years ago
ryutaono@DESKTOP-G6D20US:~/taskleaf$ bundle install --path vendor/bundle
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`.
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Fetching rake 12.3.2
Installing rake 12.3.2
Fetching concurrent-ruby 1.1.4
Installing concurrent-ruby 1.1.4
Fetching i18n 1.5.3
Installing i18n 1.5.3
Fetching minitest 5.11.3
Installing minitest 5.11.3
Fetching thread_safe 0.3.6
Installing thread_safe 0.3.6
Fetching tzinfo 1.2.5
Installing tzinfo 1.2.5
Fetching activesupport 5.2.2
Installing activesupport 5.2.2
Fetching builder 3.2.3
Installing builder 3.2.3
Fetching erubi 1.8.0
Installing erubi 1.8.0
Fetching mini_portile2 2.4.0
Installing mini_portile2 2.4.0
Fetching nokogiri 1.10.1
Installing nokogiri 1.10.1 with native extensions
Fetching rails-dom-testing 2.0.3
Installing rails-dom-testing 2.0.3
Fetching crass 1.0.4
Installing crass 1.0.4
Fetching loofah 2.2.3
Installing loofah 2.2.3
Fetching rails-html-sanitizer 1.0.4
Installing rails-html-sanitizer 1.0.4
Fetching actionview 5.2.2
Installing actionview 5.2.2
Fetching rack 2.0.6
Installing rack 2.0.6
Fetching rack-test 1.1.0
Installing rack-test 1.1.0
Fetching actionpack 5.2.2
Installing actionpack 5.2.2
Fetching nio4r 2.3.1
Installing nio4r 2.3.1 with native extensions
Fetching websocket-extensions 0.1.3
Installing websocket-extensions 0.1.3
Fetching websocket-driver 0.7.0
Installing websocket-driver 0.7.0 with native extensions
Fetching actioncable 5.2.2
Installing actioncable 5.2.2
Fetching globalid 0.4.2
Installing globalid 0.4.2
Fetching activejob 5.2.2
Installing activejob 5.2.2
Fetching mini_mime 1.0.1
Installing mini_mime 1.0.1
Fetching mail 2.7.1
Installing mail 2.7.1
Fetching actionmailer 5.2.2
Installing actionmailer 5.2.2
Fetching activemodel 5.2.2
Installing activemodel 5.2.2
Fetching arel 9.0.0
Installing arel 9.0.0
Fetching activerecord 5.2.2
Installing activerecord 5.2.2
Fetching mimemagic 0.3.3
Installing mimemagic 0.3.3
Fetching marcel 0.3.3
Installing marcel 0.3.3
Fetching activestorage 5.2.2
Installing activestorage 5.2.2
Fetching public_suffix 3.0.3
Installing public_suffix 3.0.3
Fetching addressable 2.6.0
Installing addressable 2.6.0
Fetching io-like 0.3.0
Installing io-like 0.3.0
Fetching archive-zip 0.11.0
Installing archive-zip 0.11.0
Fetching bindex 0.5.0
Installing bindex 0.5.0 with native extensions
Fetching msgpack 1.2.6
Installing msgpack 1.2.6 with native extensions
Fetching bootsnap 1.4.0
Installing bootsnap 1.4.0 with native extensions
Using bundler 2.0.1
Fetching byebug 11.0.0
Installing byebug 11.0.0 with native extensions
Fetching regexp_parser 1.3.0
Installing regexp_parser 1.3.0
Fetching xpath 3.2.0
Installing xpath 3.2.0
Fetching capybara 3.13.2
Installing capybara 3.13.2
Fetching ffi 1.10.0
Installing ffi 1.10.0 with native extensions
Fetching childprocess 0.9.0
Installing childprocess 0.9.0
Fetching chromedriver-helper 2.1.0
Installing chromedriver-helper 2.1.0
Fetching coffee-script-source 1.12.2
Installing coffee-script-source 1.12.2
Fetching execjs 2.7.0
Installing execjs 2.7.0
Fetching coffee-script 2.4.1
Installing coffee-script 2.4.1
Fetching method_source 0.9.2
Installing method_source 0.9.2
Fetching thor 0.20.3
Installing thor 0.20.3
Fetching railties 5.2.2
Installing railties 5.2.2
Fetching coffee-rails 4.2.2
Installing coffee-rails 4.2.2
Fetching hpricot 0.8.6
Installing hpricot 0.8.6 with native extensions
Fetching html2slim 0.2.0
Installing html2slim 0.2.0
Fetching multi_json 1.13.1
Installing multi_json 1.13.1
Fetching jbuilder 2.8.0
Installing jbuilder 2.8.0
Fetching rb-fsevent 0.10.3
Installing rb-fsevent 0.10.3
Fetching rb-inotify 0.10.0
Installing rb-inotify 0.10.0
Fetching ruby_dep 1.5.0
Installing ruby_dep 1.5.0
Fetching listen 3.1.5
Installing listen 3.1.5
Fetching pg 1.1.4
Installing pg 1.1.4 with native extensions
Fetching puma 3.12.0
Installing puma 3.12.0 with native extensions
Fetching sprockets 3.7.2
Installing sprockets 3.7.2
Fetching sprockets-rails 3.2.1
Installing sprockets-rails 3.2.1
Fetching rails 5.2.2
Installing rails 5.2.2
Fetching rubyzip 1.2.2
Installing rubyzip 1.2.2
Fetching sass-listen 4.0.0
Installing sass-listen 4.0.0
Fetching sass 3.7.3
Installing sass 3.7.3
Fetching tilt 2.0.9
Installing tilt 2.0.9
Fetching sass-rails 5.0.7
Installing sass-rails 5.0.7
Fetching selenium-webdriver 3.141.0
Installing selenium-webdriver 3.141.0
Fetching temple 0.8.0
Installing temple 0.8.0
Fetching slim 4.0.1
Installing slim 4.0.1
Fetching slim-rails 3.2.0
Installing slim-rails 3.2.0
Fetching spring 2.0.2
Installing spring 2.0.2
Fetching spring-watcher-listen 2.0.1
Installing spring-watcher-listen 2.0.1
Fetching turbolinks-source 5.2.0
Installing turbolinks-source 5.2.0
Fetching turbolinks 5.2.0
Installing turbolinks 5.2.0
Fetching uglifier 4.1.20
Installing uglifier 4.1.20
Fetching web-console 3.7.0
Installing web-console 3.7.0
Bundle complete! 20 Gemfile dependencies, 84 gems now installed.
Bundled gems are installed into `./vendor/bundle`
Post-install message from i18n:

HEADS UP! i18n 1.1 changed fallbacks to exclude default locale.
But that may break your application.

Please check your Rails app for 'config.i18n.fallbacks = true'.
If you're using I18n (>= 1.1.0) and Rails (< 5.2.2), this should be
'config.i18n.fallbacks = [I18n.default_locale]'.
If not, fallbacks will be broken in your app by I18n 1.1.x.

For more info see:
https://github.com/svenfuchs/i18n/releases/tag/v1.1.0

Post-install message from sass:

Ruby Sass is deprecated and will be unmaintained as of 26 March 2019.

* If you use Sass as a command-line tool, we recommend using Dart Sass, the new
  primary implementation: https://sass-lang.com/install

* If you use Sass as a plug-in for a Ruby web framework, we recommend using the
  sassc gem: https://github.com/sass/sassc-ruby#readme

* For more details, please refer to the Sass blog:
  http://sass.logdown.com/posts/7081811

ryutaono@DESKTOP-G6D20US:~/taskleaf$
RYUTAONO0929 commented 5 years ago

こんな感じです

RYUTAONO0929 commented 5 years ago

この状態で次の

$ bundle exec erb2slim app/views/layouts/ --delete

に進めればよいでしょうか

konchanxxx commented 5 years ago

はい、インストールできているので大丈夫だと思います:bow:

konchanxxx commented 5 years ago

権限が変わっていた原因はわからないですが、sudoコマンドとかを使うとこういったケースが発生することがあります。 https://www.atmarkit.co.jp/ait/articles/1611/28/news036.html