前提・実現したいこと
前提
- こちらのページから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) $
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。