コード ```### 前提・実現したいこと cloud9を使っています。コマンドラインでRails consoleを立ち上げた後 Railsのコマンドを使い、modelを作成しようとしています。 ### 発生している問題・エラーメッセージ Rails g model User name:string email:string というコマンドを実行すると以下のエラーが出てきて、User.rbファイルが生成されずに困っています
SyntaxError ((irb):1: syntax error, unexpected tLABEL, expecting do or '{' or '(')
### 該当のソースコード ```Ruby on Rails 2.6.0 :001 > rails g model User name:string email:string Traceback (most recent call last): 16: from /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/spring-2.0.2/lib/spring/command_wrapper.rb:38:in `call' 15: from /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/spring-2.0.2/lib/spring/commands/rails.rb:6:in `call' 14: from /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:287:in `load' 13: from /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:259:in `load_dependency' 12: from /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:287:in `block in load' 11: from /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:287:in `load' 10: from /home/ec2-user/environment/tweet_app/bin/rails:9:in `<top (required)>' 9: from /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:293:in `require' 8: from /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:259:in `load_dependency' 7: from /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:293:in `block in require' 6: from /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:293:in `require' 5: from /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/railties-5.0.7.2/lib/rails/commands.rb:18:in `<top (required)>' 4: from /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/railties-5.0.7.2/lib/rails/commands/commands_tasks.rb:49:in `run_command!' 3: from /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/railties-5.0.7.2/lib/rails/commands/commands_tasks.rb:78:in `console' 2: from /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/railties-5.0.7.2/lib/rails/commands/console_helper.rb:9:in `start' 1: from /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/railties-5.0.7.2/lib/rails/commands/console.rb:65:in `start' SyntaxError ((irb):1: syntax error, unexpected tLABEL, expecting do or '{' or '(') ...g model User name:string email:string ...
試したこと
読み込んでいるgemファイルの中の記述がおかしくなっているのと考え
bundle install
bundle update
などを実行しましたが、解決できませんでした。
お力添えの程、宜しくお願いします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2020/05/22 20:49