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

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

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

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

Q&A

解決済

1回答

682閲覧

gem 'devise'

nanpo

総合スコア1

Ruby on Rails

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

0グッド

0クリップ

投稿2020/08/22 08:19

編集2020/08/22 11:12

Cloud9環境でRuby on railsを作業中です。
以下のように書き込んだのですが、ログイン画面が表示されません。

bashへの書き込み
$ bundle install
$ rails g devise:install
$ rails g devise:views
$ rails g devise User
$ rails db:migrate
$ rails s

routes.rb

Rails.application.routes.draw do # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html root "top#index" devise_for :users resources :users end

development.rb

Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # In the development environment your application's code is reloaded on # every request. This slows down response time but is perfect for development # since you don't have to restart the web server when you make code changes. config.cache_classes = false # Do not eager load code on boot. config.eager_load = false # Show full error reports. config.consider_all_requests_local = true # Enable/disable caching. By default caching is disabled. if Rails.root.join('tmp/caching-dev.txt').exist? config.action_controller.perform_caching = true config.cache_store = :memory_store config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=172800' } else config.action_controller.perform_caching = false config.cache_store = :null_store end # Don't care if the mailer can't send. config.action_mailer.raise_delivery_errors = false config.action_mailer.perform_caching = false # Print deprecation notices to the Rails logger. config.active_support.deprecation = :log # Raise an error on page load if there are pending migrations. config.active_record.migration_error = :page_load # Debug mode disables concatenation and preprocessing of assets. # This option may cause significant delays in view rendering with a large # number of complex assets. config.assets.debug = true # Suppress logger output for asset requests. config.assets.quiet = true # Raises error for missing translations # config.action_view.raise_on_missing_translations = true # Use an evented file watcher to asynchronously detect changes in source code, # routes, locales, etc. This feature depends on the listen gem. config.file_watcher = ActiveSupport::EventedFileUpdateChecker config.action_mailer.default_url_options = { protocol: 'https', host: 'https://41a01503f3b94436b1e26c5b65638f97.vfs.cloud9.ap-northeast-1.amazonaws.com/' } end

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

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

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

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

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

Cojiro

2020/08/22 08:37

下記のソースコードとbashの結果を記載した方がいいと思います。 また、読みにくいので、他の部分についても言えることですが、コードのマークダウンを利用してください。 ・user.rb ・routes.rb ・$rails db:migrate:status
nanpo

2020/08/22 09:26

bashの詳細です。 ec2-user:~/environment/techpit-match $ 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 concurrent-ruby 1.1.7 Using i18n 1.8.5 Using minitest 5.14.1 Using thread_safe 0.3.6 Using tzinfo 1.2.7 Using activesupport 5.0.7.2 Using builder 3.2.4 Using erubis 2.7.0 Using mini_portile2 2.4.0 Using nokogiri 1.10.10 Using rails-dom-testing 2.0.3 Using crass 1.0.6 Using loofah 2.6.0 Using rails-html-sanitizer 1.3.0 Using actionview 5.0.7.2 Using rack 2.2.3 Using rack-test 0.6.3 Using actionpack 5.0.7.2 Using nio4r 2.5.2 Using websocket-extensions 0.1.5 Using websocket-driver 0.6.5 Using actioncable 5.0.7.2 Using globalid 0.4.2 Using activejob 5.0.7.2 Using mini_mime 1.0.2 Using mail 2.7.1 Using actionmailer 5.0.7.2 Using activemodel 5.0.7.2 Using arel 7.1.4 Using activerecord 5.0.7.2 Fetching bcrypt 3.1.15 Installing bcrypt 3.1.15 with native extensions Using bindex 0.8.1 Using bundler 1.17.3 Using byebug 11.1.3 Using coffee-script-source 1.12.2 Using execjs 2.7.0 Using coffee-script 2.4.1 Using method_source 1.0.0 Using thor 1.0.1 Using railties 5.0.7.2 Using coffee-rails 4.2.2 Fetching orm_adapter 0.5.0 Installing orm_adapter 0.5.0 Fetching responders 3.0.1 Installing responders 3.0.1 Fetching warden 1.2.8 Installing warden 1.2.8 Fetching devise 4.7.2 Installing devise 4.7.2 Using ffi 1.13.1 Using jbuilder 2.10.0 Using jquery-rails 4.4.0 Using rb-fsevent 0.10.4 Using rb-inotify 0.10.1 Using listen 3.0.8 Using puma 3.12.6 Using sprockets 3.7.2 Using sprockets-rails 3.2.1 Using rails 5.0.7.2 Using sass-listen 4.0.0 Using sass 3.7.4 Using tilt 2.0.10 Using sass-rails 5.0.7 Using spring 2.1.0 Using spring-watcher-listen 2.0.1 Using sqlite3 1.3.13 Using turbolinks-source 5.2.0 Using turbolinks 5.2.1 Using uglifier 4.2.0 Using web-console 3.7.0 Bundle complete! 16 Gemfile dependencies, 67 gems now installed. Use `bundle info [gemname]` to see where a bundled gem is installed. ec2-user:~/environment/techpit-match $ rails g devise:install Running via Spring preloader in process 5534 create config/initializers/devise.rb create config/locales/devise.en.yml =============================================================================== Depending on your application's configuration some manual setup may be required: 1. Ensure you have defined default url options in your environments files. Here is an example of default_url_options appropriate for a development environment in config/environments/development.rb: config.action_mailer.default_url_options = { host: 'localhost', port: 3000 } In production, :host should be set to the actual host of your application. * Required for all applications. * 2. Ensure you have defined root_url to *something* in your config/routes.rb. For example: root to: "home#index" * Not required for API-only Applications * 3. Ensure you have flash messages in app/views/layouts/application.html.erb. For example: <p class="notice"><%= notice %></p> <p class="alert"><%= alert %></p> * Not required for API-only Applications * 4. You can copy Devise views (for customization) to your app by running: rails g devise:views * Not required * =============================================================================== ec2-user:~/environment/techpit-match $ rails g devise:views Running via Spring preloader in process 5889 invoke Devise::Generators::SharedViewsGenerator create app/views/devise/shared create app/views/devise/shared/_error_messages.html.erb create app/views/devise/shared/_links.html.erb invoke form_for create app/views/devise/confirmations create app/views/devise/confirmations/new.html.erb create app/views/devise/passwords create app/views/devise/passwords/edit.html.erb create app/views/devise/passwords/new.html.erb create app/views/devise/registrations create app/views/devise/registrations/edit.html.erb create app/views/devise/registrations/new.html.erb create app/views/devise/sessions create app/views/devise/sessions/new.html.erb create app/views/devise/unlocks create app/views/devise/unlocks/new.html.erb invoke erb create app/views/devise/mailer create app/views/devise/mailer/confirmation_instructions.html.erb create app/views/devise/mailer/email_changed.html.erb create app/views/devise/mailer/password_change.html.erb create app/views/devise/mailer/reset_password_instructions.html.erb create app/views/devise/mailer/unlock_instructions.html.erb ec2-user:~/environment/techpit-match $ rails g devise User Running via Spring preloader in process 5929 Deprecation warning: Expected boolean default value for '--orm'; got :active_record (string). This will be rejected in the future unless you explicitly pass the options `check_default_type: false` or call `allow_incompatible_default_type!` in your code You can silence deprecations warning by setting the environment variable THOR_SILENCE_DEPRECATION. invoke active_record create db/migrate/20200822074735_devise_create_users.rb create app/models/user.rb invoke test_unit create test/models/user_test.rb create test/fixtures/users.yml insert app/models/user.rb route devise_for :users ec2-user:~/environment/techpit-match $ rails db:migrate == 20200822074735 DeviseCreateUsers: migrating ================================ -- create_table(:users) -> 0.0014s -- add_index(:users, :email, {:unique=>true}) -> 0.0015s -- add_index(:users, :reset_password_token, {:unique=>true}) -> 0.0007s == 20200822074735 DeviseCreateUsers: migrated (0.0038s) ======================= ec2-user:~/environment/techpit-match $ rails s => Booting Puma => Rails 5.0.7.2 application starting in development on http://localhost:8080 => Run `rails server -h` for more startup options A server is already running. Check /home/ec2-user/environment/techpit-match/tmp/pids/server.pid. Exiting
guest

回答1

0

自己解決

~amazonaws.com/users/sign_upを直接打ちこんだら表示されました。ご協力ありがとうございました。

投稿2020/08/22 11:15

nanpo

総合スコア1

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

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

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.35%

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

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

質問する

関連した質問