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

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

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

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

RubyGems

RubyGemsはRubyによるプログラミングのためのパッケージマネジメントツールです。ユーザはこれを使用することで、Rubyライブラリのダウンロードやアップデートや、依存関係の自動解決が可能になります。

Ruby on Rails

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

Q&A

解決済

2回答

8025閲覧

railsの新規ファイル作成時にエラーが出てしまう

fm_028

総合スコア5

Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

RubyGems

RubyGemsはRubyによるプログラミングのためのパッケージマネジメントツールです。ユーザはこれを使用することで、Rubyライブラリのダウンロードやアップデートや、依存関係の自動解決が可能になります。

Ruby on Rails

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

0グッド

1クリップ

投稿2019/11/17 02:19

編集2019/11/17 02:25

前提・実現したいこと

今どっとインストールでrails学び中でrails の新しいファイルを作ろうと思っています。rubyの実行まではうまくいっていましたが、railsをインストールするときにruby2.5以上が必要と言われインストールしました。そのあとrails new myapp を実行したら
An error occurred while installing sassc (2.2.1), and Bundler cannot
continue.
Make sure that gem install sassc -v '2.2.1' --source 'https://rubygems.org/' succeeds before bundling.
と出てしまいファイル作成ができません
ruby 2.6.5
rails 6.0.1
bündle 2.0.2

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

An error occurred while installing sassc (2.2.1), and Bundler cannot
continue.
Make sure that gem install sassc -v '2.2.1' --source 'https://rubygems.org/' succeeds before bundling.
An error occurred while installing sassc (2.2.1), and Bundler cannot
continue.
Make sure that gem install sassc -v '2.2.1' --source 'https://rubygems.org/' succeeds before bundling.

該当のソースコード

ruby

1rails new myapp 2 exist 3 identical README.md 4 identical Rakefile 5 identical .ruby-version 6 identical config.ru 7 conflict .gitignore 8Overwrite /home/vagrant/myapp/.gitignore? (enter "h" for help) [Ynaqdhm] 9 force .gitignore 10 identical Gemfile 11 run git init from "." 12Reinitialized existing Git repository in /home/vagrant/myapp/.git/ 13 identical package.json 14 exist app 15 identical app/assets/config/manifest.js 16 identical app/assets/stylesheets/application.css 17 identical app/channels/application_cable/channel.rb 18 identical app/channels/application_cable/connection.rb 19 identical app/controllers/application_controller.rb 20 identical app/helpers/application_helper.rb 21 identical app/javascript/channels/consumer.js 22 identical app/javascript/channels/index.js 23 identical app/javascript/packs/application.js 24 identical app/jobs/application_job.rb 25 identical app/mailers/application_mailer.rb 26 identical app/models/application_record.rb 27 identical app/views/layouts/application.html.erb 28 identical app/views/layouts/mailer.html.erb 29 identical app/views/layouts/mailer.text.erb 30 identical app/assets/images/.keep 31 identical app/controllers/concerns/.keep 32 identical app/models/concerns/.keep 33 exist bin 34 identical bin/rails 35 identical bin/rake 36 identical bin/setup 37 identical bin/yarn 38 exist config 39 identical config/routes.rb 40 identical config/application.rb 41 identical config/environment.rb 42 identical config/cable.yml 43 identical config/puma.rb 44 identical config/spring.rb 45 identical config/storage.yml 46 exist config/environments 47 identical config/environments/development.rb 48 identical config/environments/production.rb 49 identical config/environments/test.rb 50 exist config/initializers 51 identical config/initializers/application_controller_renderer.rb 52 identical config/initializers/assets.rb 53 identical config/initializers/backtrace_silencers.rb 54 identical config/initializers/content_security_policy.rb 55 identical config/initializers/cookies_serializer.rb 56 create config/initializers/cors.rb 57 identical config/initializers/filter_parameter_logging.rb 58 identical config/initializers/inflections.rb 59 identical config/initializers/mime_types.rb 60 create config/initializers/new_framework_defaults_6_0.rb 61 identical config/initializers/wrap_parameters.rb 62 exist config/locales 63 identical config/locales/en.yml 64 append .gitignore 65 identical config/boot.rb 66 identical config/database.yml 67 exist db 68 identical db/seeds.rb 69 exist lib 70 exist lib/tasks 71 identical lib/tasks/.keep 72 exist lib/assets 73 identical lib/assets/.keep 74 exist log 75 identical log/.keep 76 exist public 77 identical public/404.html 78 identical public/422.html 79 identical public/500.html 80 identical public/apple-touch-icon-precomposed.png 81 identical public/apple-touch-icon.png 82 identical public/favicon.ico 83 identical public/robots.txt 84 exist tmp 85 identical tmp/.keep 86 exist tmp/pids 87 identical tmp/pids/.keep 88 exist tmp/cache 89 exist tmp/cache/assets 90 exist vendor 91 identical vendor/.keep 92 exist test/fixtures 93 identical test/fixtures/.keep 94 exist test/fixtures/files 95 identical test/fixtures/files/.keep 96 exist test/controllers 97 identical test/controllers/.keep 98 exist test/mailers 99 identical test/mailers/.keep 100 exist test/models 101 identical test/models/.keep 102 exist test/helpers 103 identical test/helpers/.keep 104 exist test/integration 105 identical test/integration/.keep 106 identical test/channels/application_cable/connection_test.rb 107 identical test/test_helper.rb 108 exist test/system 109 identical test/system/.keep 110 identical test/application_system_test_case.rb 111 exist storage 112 identical storage/.keep 113 exist tmp/storage 114 identical tmp/storage/.keep 115 remove config/initializers/cors.rb 116 remove config/initializers/new_framework_defaults_6_0.rb 117 run bundle install 118The 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`. 119Fetching gem metadata from https://rubygems.org/............ 120Fetching gem metadata from https://rubygems.org/. 121Resolving dependencies......... 122Using rake 13.0.1 123Using concurrent-ruby 1.1.5 124Using i18n 1.7.0 125Using minitest 5.13.0 126Using thread_safe 0.3.6 127Using tzinfo 1.2.5 128Using zeitwerk 2.2.1 129Using activesupport 6.0.1 130Using builder 3.2.3 131Using erubi 1.9.0 132Using mini_portile2 2.4.0 133Using nokogiri 1.10.5 134Using rails-dom-testing 2.0.3 135Using crass 1.0.5 136Using loofah 2.3.1 137Using rails-html-sanitizer 1.3.0 138Using actionview 6.0.1 139Using rack 2.0.7 140Using rack-test 1.1.0 141Using actionpack 6.0.1 142Using nio4r 2.5.2 143Using websocket-extensions 0.1.4 144Using websocket-driver 0.7.1 145Using actioncable 6.0.1 146Using globalid 0.4.2 147Using activejob 6.0.1 148Using activemodel 6.0.1 149Using activerecord 6.0.1 150Using mimemagic 0.3.3 151Using marcel 0.3.3 152Using activestorage 6.0.1 153Using mini_mime 1.0.2 154Using mail 2.7.1 155Using actionmailbox 6.0.1 156Using actionmailer 6.0.1 157Using actiontext 6.0.1 158Using public_suffix 4.0.1 159Using addressable 2.7.0 160Using bindex 0.8.1 161Using msgpack 1.3.1 162Using bootsnap 1.4.5 163Using bundler 2.0.2 164Using byebug 11.0.1 165Using regexp_parser 1.6.0 166Using xpath 3.2.0 167Using capybara 3.29.0 168Using childprocess 3.0.0 169Using ffi 1.11.2 170Using jbuilder 2.9.1 171Using rb-fsevent 0.10.3 172Using rb-inotify 0.10.0 173Using ruby_dep 1.5.0 174Using listen 3.1.5 175Using method_source 0.9.2 176Using puma 4.3.0 177Using rack-proxy 0.6.5 178Using thor 0.20.3 179Using railties 6.0.1 180Using sprockets 4.0.0 181Using sprockets-rails 3.2.1 182Using rails 6.0.1 183Using rubyzip 2.0.0 184Fetching sassc 2.2.1 185Installing sassc 2.2.1 with native extensions 186Gem::Ext::BuildError: ERROR: Failed to build gem native extension. 187 188current directory: 189/home/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sassc-2.2.1/ext 190/home/vagrant/.rbenv/versions/2.6.5/bin/ruby -I 191/home/vagrant/.rbenv/versions/2.6.5/lib/ruby/2.6.0 -r 192./siteconf20191117-26632-j0w1qa.rb extconf.rb 193creating Makefile 194 195current directory: 196/home/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sassc-2.2.1/ext 197make "DESTDIR=" clean 198 199current directory: 200/home/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sassc-2.2.1/ext 201make "DESTDIR=" 202compiling ./libsass/src/ast_sel_unify.cpp 203cc1plus: error: unrecognized command line option "-std=c++11" 204cc1plus: error: unrecognized command line option "-flto" 205make: *** [ast_sel_unify.o] エラー 1 206 207make failed, exit code 2 208 209Gem files will remain installed in 210/home/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sassc-2.2.1 for 211inspection. 212Results logged to 213/home/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/extensions/x86_64-linux/2.6.0/sassc-2.2.1/gem_make.out 214 215An error occurred while installing sassc (2.2.1), and Bundler cannot 216continue. 217Make sure that `gem install sassc -v '2.2.1' --source 218'https://rubygems.org/'` succeeds before bundling. 219 220In Gemfile: 221 sass-rails was resolved to 6.0.0, which depends on 222 sassc-rails was resolved to 2.1.2, which depends on 223 sassc 224 run bundle binstubs bundler 225Could not find gem 'sass-rails (>= 6)' in any of the gem sources listed in 226your Gemfile. 227 run bundle exec spring binstub --all 228Could not find gem 'sass-rails (>= 6)' in any of the gem sources listed in your Gemfile. 229Run `bundle install` to install missing gems. 230 rails webpacker:install 231Could not find gem 'sass-rails (>= 6)' in any of the gem sources listed in your Gemfile. 232Run `bundle install` to install missing gems.

試したこと

ruby,rails,gem,bundleの再インストール

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

ここにより詳細な情報を記載してください。

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

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

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

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

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

guest

回答2

0

こんにちわ。
私も同じ現象でとても悩ましい時間を過ごしましたが、やっと抜け出しましたのでコメントさせていただきます。
私の場合railsのグレードダウン設定でも改善されませんでした。

CentOSのgccバージョンが古いのが原因でsasscのinstallができないようでした。

https://thr3a.hatenablog.com/entry/20180308/1520506543

上記urlを参考にgccをupdateしたら改善されました。

どなたが同じ悩みで訪問される方がいらっしゃるかもなんで便乗させていただきます。

同じ悩みを持っている方がいるだけでも気持ちが軽くなりましたので、、、

ありがとうございました!

投稿2020/02/22 08:57

kim.soonhyang

総合スコア14

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

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

0

ベストアンサー

もしかしたら、railsのバージョンを
rails 6.0.1からrails 5.1.3にダウングレードしてみるといいかもしれません

投稿2019/11/17 09:03

b0YVSKzsAvSiW8w

総合スコア13

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

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

fm_028

2019/11/18 04:15

rails 5.1.3にダウングレードした後、 $gem 'sqlite3' $gem 'sqlite3', '~> 1.3.6' $bundle installをしたら無事に解決できました!! ありがとうございました!!
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.50%

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

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

質問する

関連した質問