Ruby on rails bin/rails生成模型文章标题:string text:text

Ruby on rails bin/rails生成模型文章标题:string text:text,ruby-on-rails,ruby,linux,Ruby On Rails,Ruby,Linux,最近,我开始使用并坚持使用bin/rails生成模型文章标题:string text:text,它应该创建带有两列的模型,不幸的是输出如下: /usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.7.3/lib/bundler/runtime.rb:222: warning: Insecure world writable dir /usr/local/sbin in PATH, mode 040777 /usr/local/lib/ruby/2.1.0/p

最近,我开始使用并坚持使用
bin/rails生成模型文章标题:string text:text
,它应该创建带有两列
模型
,不幸的是输出如下:

/usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.7.3/lib/bundler/runtime.rb:222: warning: Insecure world writable dir /usr/local/sbin in PATH, mode 040777
/usr/local/lib/ruby/2.1.0/psych/visitors/to_ruby.rb:284:in `block in visit_Psych_Nodes_Alias': Cannot load `Rails.application.database_configuration`:
Unknown alias: default1 (Psych::BadAlias)
    from /usr/local/lib/ruby/2.1.0/psych/visitors/to_ruby.rb:284:in `fetch'
    from /usr/local/lib/ruby/2.1.0/psych/visitors/to_ruby.rb:284:in `visit_Psych_Nodes_Alias'
    from /usr/local/lib/ruby/2.1.0/psych/visitors/visitor.rb:15:in `visit'
    from /usr/local/lib/ruby/2.1.0/psych/visitors/visitor.rb:5:in `accept'
    from /usr/local/lib/ruby/2.1.0/psych/visitors/to_ruby.rb:31:in `accept'
    from /usr/local/lib/ruby/2.1.0/psych/visitors/to_ruby.rb:302:in `block in revive_hash'
    from /usr/local/lib/ruby/2.1.0/psych/visitors/to_ruby.rb:300:in `each'
    from /usr/local/lib/ruby/2.1.0/psych/visitors/to_ruby.rb:300:in `each_slice'
    from /usr/local/lib/ruby/2.1.0/psych/visitors/to_ruby.rb:300:in `revive_hash'
    from /usr/local/lib/ruby/2.1.0/psych/visitors/to_ruby.rb:161:in `visit_Psych_Nodes_Mapping'
    from /usr/local/lib/ruby/2.1.0/psych/visitors/visitor.rb:15:in `visit'
    from /usr/local/lib/ruby/2.1.0/psych/visitors/visitor.rb:5:in `accept'
    from /usr/local/lib/ruby/2.1.0/psych/visitors/to_ruby.rb:31:in `accept'
    from /usr/local/lib/ruby/2.1.0/psych/visitors/to_ruby.rb:302:in `block in revive_hash'
    from /usr/local/lib/ruby/2.1.0/psych/visitors/to_ruby.rb:300:in `each'
    from /usr/local/lib/ruby/2.1.0/psych/visitors/to_ruby.rb:300:in `each_slice'
    from /usr/local/lib/ruby/2.1.0/psych/visitors/to_ruby.rb:300:in `revive_hash'
    from /usr/local/lib/ruby/2.1.0/psych/visitors/to_ruby.rb:161:in `visit_Psych_Nodes_Mapping'
    from /usr/local/lib/ruby/2.1.0/psych/visitors/visitor.rb:15:in `visit'
    from /usr/local/lib/ruby/2.1.0/psych/visitors/visitor.rb:5:in `accept'
    from /usr/local/lib/ruby/2.1.0/psych/visitors/to_ruby.rb:31:in `accept'
    from /usr/local/lib/ruby/2.1.0/psych/visitors/to_ruby.rb:276:in `visit_Psych_Nodes_Document'
    from /usr/local/lib/ruby/2.1.0/psych/visitors/visitor.rb:15:in `visit'
    from /usr/local/lib/ruby/2.1.0/psych/visitors/visitor.rb:5:in `accept'
    from /usr/local/lib/ruby/2.1.0/psych/visitors/to_ruby.rb:31:in `accept'
    from /usr/local/lib/ruby/2.1.0/psych/nodes/node.rb:37:in `to_ruby'
    from /usr/local/lib/ruby/2.1.0/psych.rb:246:in `load'
    from /usr/local/lib/ruby/gems/2.1.0/gems/railties-4.1.6/lib/rails/application/configuration.rb:99:in `database_configuration'
    from /usr/local/lib/ruby/gems/2.1.0/gems/activerecord-4.1.6/lib/active_record/railtie.rb:128:in `block (2 levels) in <class:Railtie>'
    from /usr/local/lib/ruby/gems/2.1.0/gems/activesupport-4.1.6/lib/active_support/lazy_load_hooks.rb:38:in `instance_eval'
    from /usr/local/lib/ruby/gems/2.1.0/gems/activesupport-4.1.6/lib/active_support/lazy_load_hooks.rb:38:in `execute_hook'
    from /usr/local/lib/ruby/gems/2.1.0/gems/activesupport-4.1.6/lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
    from /usr/local/lib/ruby/gems/2.1.0/gems/activesupport-4.1.6/lib/active_support/lazy_load_hooks.rb:44:in `each'
    from /usr/local/lib/ruby/gems/2.1.0/gems/activesupport-4.1.6/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
    from /usr/local/lib/ruby/gems/2.1.0/gems/activerecord-4.1.6/lib/active_record/base.rb:326:in `<module:ActiveRecord>'
    from /usr/local/lib/ruby/gems/2.1.0/gems/activerecord-4.1.6/lib/active_record/base.rb:23:in `<top (required)>'
    from /usr/local/lib/ruby/gems/2.1.0/gems/spring-1.1.3/lib/spring/application.rb:314:in `active_record_configured?'
    from /usr/local/lib/ruby/gems/2.1.0/gems/spring-1.1.3/lib/spring/application.rb:248:in `disconnect_database'
    from /usr/local/lib/ruby/gems/2.1.0/gems/spring-1.1.3/lib/spring/application.rb:97:in `preload'
    from /usr/local/lib/ruby/gems/2.1.0/gems/spring-1.1.3/lib/spring/application.rb:140:in `serve'
    from /usr/local/lib/ruby/gems/2.1.0/gems/spring-1.1.3/lib/spring/application.rb:128:in `block in run'
    from /usr/local/lib/ruby/gems/2.1.0/gems/spring-1.1.3/lib/spring/application.rb:122:in `loop'
    from /usr/local/lib/ruby/gems/2.1.0/gems/spring-1.1.3/lib/spring/application.rb:122:in `run'
    from /usr/local/lib/ruby/gems/2.1.0/gems/spring-1.1.3/lib/spring/application/boot.rb:18:in `<top (required)>'
    from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from -e:1:in `<main>'
生成模型之前
调用了
sudo chmod o-w/usr/local/
。假设它们都不影响上述问题

感谢任何解决方案

编辑: 我找了
数据库\u配置
,但运气不好。。我认为这个基本的
database.yml
文件没有任何共同之处,因为它包含:

# SQLite version 3.x
#   gem install sqlite3
#
#   Ensure the SQLite 3 gem is defined in your Gemfile
#   gem 'sqlite3'
#
default: &default
  adapter: sqlite3
  pool: 5
  timeout: 5000

development:
  <<: *default
  database: db/development.sqlite3

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
  <<: *default
  database: db/test.sqlite3

production:
  <<: *default1
  database: db/production.sqlite3
#SQLite版本3.x
#gem安装sqlite3
#
#确保在gem文件中定义了SQLite 3 gem
#gem'sqlite3'
#
默认值:&默认值
适配器:sqlite3
游泳池:5
超时:5000
发展:

缺少该特定环境的数据库配置


如果提供了数据库详细信息,请确保database.yml.Indentation中没有空格。单个额外空间可能会导致配置问题。

该特定环境缺少数据库配置


如果提供了数据库详细信息,请确保database.yml.Indentation中没有空格。单个额外空间可能会导致配置问题。

该特定环境缺少数据库配置


如果提供了数据库详细信息,请确保database.yml.Indentation中没有空格。单个额外空间可能会导致配置问题。

该特定环境缺少数据库配置


如果提供了数据库详细信息,请确保database.yml.Indentation中没有空格。单个额外空间可能会导致配置问题。

它说它无法加载数据库配置,您是否创建了
database.yml
文件?如果是,您可以粘贴它吗?它说它无法加载数据库配置,您是否创建了
database.yml
文件?如果是,您可以粘贴它吗?它说它无法加载数据库配置,您是否创建了
database.yml
文件?如果是,您可以粘贴它吗?它说它无法加载数据库配置,您是否创建了
database.yml
文件?如果是,您可以粘贴它吗?您可以检查的另一件事是从命令行连接到开发数据库。您可以检查的另一件事是从命令行连接到开发数据库。您可以检查的另一件事是从命令行连接到开发数据库。您可以检查的另一件事是连接到开发数据库来自命令行的数据库。
# SQLite version 3.x
#   gem install sqlite3
#
#   Ensure the SQLite 3 gem is defined in your Gemfile
#   gem 'sqlite3'
#
default: &default
  adapter: sqlite3
  pool: 5
  timeout: 5000

development:
  <<: *default
  database: db/development.sqlite3

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
  <<: *default
  database: db/test.sqlite3

production:
  <<: *default1
  database: db/production.sqlite3