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

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

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

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

Q&A

1回答

3364閲覧

Railsを起動させたいです

WagatsumaItsuki

総合スコア4

Ruby on Rails

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

0グッド

0クリップ

投稿2020/01/04 07:54

前提・実現したいこと

前提

  • こちらのページからRuby+Devkit 2.6.5-1 (x64) をDownloadしました。
  • $gem install bundlerを打ち込みboudlerをインストールしました。
  • $ gem install railsを打ち込みrailsをインストールしました。

実現したいこと

Railsの起動
AWSCloud9のPreviewにおいて「Yay You're On Rails」の画面を表示させたいです。

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

ec2-user:~/environment/ECM (master) $ rails s -p $PORT -b $IP

を打ち込んだところ

Could not find gem 'sass-rails (>= 6)' in any of the gem sources listed in your Gemfile. Run `bundle install` to install missing gems.

と返されてしまいます

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

全くの初心者のため、解決に向けて何を提示したら良いのかもわかっていない状態です。以下にコードをすべてつけておきますので参考にしていただけたらと思います。

ec2-user:~/environment $ rails new ECM create create README.md create Rakefile create .ruby-version create config.ru create .gitignore create Gemfile run git init from "." Initialized empty Git repository in /home/ec2-user/environment/ECM/.git/ create package.json 【略】 create tmp/storage/.keep remove config/initializers/cors.rb remove config/initializers/new_framework_defaults_6_0.rb run bundle install 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.... Using rake 13.0.1 【略】 Using listen 3.1.5 Using method_source 0.9.2 Fetching puma 4.3.1 Installing puma 4.3.1 with native extensions Fetching rack-proxy 0.6.5 Installing rack-proxy 0.6.5 Using thor 1.0.1 Using railties 6.0.2.1 Using sprockets 4.0.0 Using sprockets-rails 3.2.1 Using rails 6.0.2.1 Using rubyzip 2.0.0 Fetching sassc 2.2.1 Installing sassc 2.2.1 with native extensions ec2-user:~/environment $ rails new ECM ^C ec2-user:~/environment $ cd ECM ec2-user:~/environment/ECM (master) $ ec2-user:~/environment/ECM (master) $ $ rails s -p $PORT -b $IP bash: $: command not found ec2-user:~/environment/ECM (master) $ rails s -p $PORT -b $IP Could not find gem 'sass-rails (>= 6)' in any of the gem sources listed in your Gemfile. Run `bundle install` to install missing gems. ec2-user:~/environment/ECM (master) $ bundle info [gemname] Could not find gem 'sass-rails (>= 6)' in any of the gem sources listed in your Gemfile. ec2-user:~/environment/ECM (master) $ bundle install 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... Using rake 13.0.1 【略】 Fetching sassc 2.2.1 Installing sassc 2.2.1 with native extensions ^Cec2-user:~/environment/ECM (master) $ rails s -p $PORT -b $IP Could not find gem 'sass-rails (>= 6)' in any of the gem sources listed in your Gemfile. Run `bundle install` to install missing gems. ec2-user:~/environment/ECM (master) $ bundle install 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... Using rake 13.0.1 【略】 Using rubyzip 2.0.0 Fetching sassc 2.2.1 Installing sassc 2.2.1 with native extensions ^Cec2-user:~/environment/ECM (master) $ rails s -p $PORT -b $IP Could not find gem 'sass-rails (>= 6)' in any of the gem sources listed in your Gemfile. Run `bundle install` to install missing gems. ec2-user:~/environment/ECM (master) $ sudo gem install ruby-mysql Fetching: ruby-mysql-2.9.14.gem (100%) Successfully installed ruby-mysql-2.9.14 Parsing documentation for ruby-mysql-2.9.14 Installing ri documentation for ruby-mysql-2.9.14 Done installing documentation for ruby-mysql after 1 seconds 1 gem installed ec2-user:~/environment/ECM (master) $ sudo gem install bundler Fetching: bundler-2.1.3.gem (100%) ERROR: Error installing bundler: bundler requires Ruby version >= 2.3.0. ec2-user:~/environment/ECM (master) $ bundler -v Traceback (most recent call last): 2: from /home/ec2-user/.rvm/rubies/ruby-2.6.3/bin/bundler:23:in `<main>' 1: from /home/ec2-user/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0/rubygems.rb:303:in `activate_bin_path' /home/ec2-user/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0/rubygems.rb:284:in `find_spec_for_exe': can't find gem bundler (>= 0.a) with executable bundler (Gem::GemNotFoundException) ec2-user:~/environment/ECM (master) $ gem uninstall -aIx Successfully uninstalled actioncable-6.0.2.1 【略】 ERROR: While executing gem ... (Gem::InstallError) bundler-unload is not installed in GEM_HOME, try: gem uninstall -i /home/ec2-user/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0 bundler-unload ec2-user:~/environment/ECM (master) $ sudo gem install bundler ERROR: Error installing bundler: bundler requires Ruby version >= 2.3.0. ec2-user:~/environment/ECM (master) $ tuby -v bash: tuby: command not found ec2-user:~/environment/ECM (master) $ Ruby -v bash: Ruby: command not found ec2-user:~/environment/ECM (master) $ sudo gem install bundler ERROR: Error installing bundler: bundler requires Ruby version >= 2.3.0. ec2-user:~/environment/ECM (master) $ gem install bundler Fetching bundler-2.1.3.gem Successfully installed bundler-2.1.3 Parsing documentation for bundler-2.1.3 Installing ri documentation for bundler-2.1.3 Done installing documentation for bundler after 3 seconds 1 gem installed ec2-user:~/environment/ECM (master) $ rails s -p $PORT -b $IP Traceback (most recent call last): 10: from /home/ec2-user/.rvm/gems/ruby-2.6.3/bin/ruby_executable_hooks:24:in `<main>' 9: from /home/ec2-user/.rvm/gems/ruby-2.6.3/bin/ruby_executable_hooks:24:in `eval' 8: from /home/ec2-user/.rvm/gems/ruby-2.6.3/bin/rails:23:in `<main>' 7: from /home/ec2-user/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0/rubygems.rb:304:in `activate_bin_path' 6: from /home/ec2-user/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0/rubygems.rb:304:in `synchronize' 5: from /home/ec2-user/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0/rubygems.rb:305:in `block in activate_bin_path' 4: from /home/ec2-user/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0/rubygems/specification.rb:1417:in `activate' 3: from /home/ec2-user/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0/rubygems/specification.rb:1435:in `activate_dependencies' 2: from /home/ec2-user/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0/rubygems/specification.rb:1435:in `each' 1: from /home/ec2-user/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0/rubygems/specification.rb:1446:in `block in activate_dependencies' /home/ec2-user/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0/rubygems/dependency.rb:311:in `to_specs': Could not find 'activesupport' (= 6.0.2.1) among 133 total gem(s) (Gem::MissingSpecError) Checked in 'GEM_PATH=/home/ec2-user/.rvm/gems/ruby-2.6.3:/home/ec2-user/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0', execute `gem env` for more information ec2-user:~/environment/ECM (master) $ killall rails rails: no process found ec2-user:~/environment/ECM (master) $ bundler -v Bundler version 2.1.3 ec2-user:~/environment/ECM (master) $ gem install rails Fetching activesupport-6.0.2.1.gem 【略】 Done installing documentation for activesupport, builder, actionview, actionpack, activemodel, activerecord, activejob, actionmailer, actioncable, activestorage, actionmailbox, actiontext, rails after 13 seconds 13 gems installed ec2-user:~/environment/ECM (master) $ rails s -p $PORT -b $IP Could not find gem 'sass-rails (>= 6)' in any of the gem sources listed in your Gemfile. Run `bundle install` to install missing gems. ec2-user:~/environment/ECM (master) $ bundle update sass-rails (>= 6) bash: syntax error near unexpected token `(' ec2-user:~/environment/ECM (master) $ sass-rails(>= 6) bash: syntax error near unexpected token `>' ec2-user:~/environment/ECM (master) $ sass-rails( >= 6) bash: syntax error near unexpected token `>' ec2-user:~/environment/ECM (master) $

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

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

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

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

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

guest

回答1

0

gemfileの gem 'sass-rails (>= 6)' を

gem 'sass-rails'

にして試してみてください。

投稿2020/01/04 22:01

tenten11055

総合スコア67

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

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

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

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

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

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

ただいまの回答率
85.50%

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

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

質問する

関連した質問