簡體   English   中英

ActiveRecord :: ConnectionNotFounded Ruby on Rails

[英]ActiveRecord::ConnectionNotEstablished Ruby on Rails

我在Kevin on Skoglund的Ruby on Rails 4基本培訓之后,在Ruby on Rails上使用mysql2,並且在早期的章節中,它告訴我通過鍵入“ rails server”並打開“ localhost:3000”來訪問項目。在我的瀏覽器上。

問題是這樣的: 未建立連接

因此,我無法訪問我的項目,也無法繼續學習教程。

另外,我注意到本人和本教程的終端之間有些不同。 在我的終端中,在啟動WEBrick之前,它顯示以下內容:/home/jmmaglinao16/.rvm/gems/ruby-2.3.0/gems/activesupport-4.0.0/lib/active_support/values/time_zone.rb:282:警告:循環參數參考-現在

我不確定它是否與問題有關,但這就是我到目前為止的問題。 請幫助我。 謝謝。

寶石文件:

source 'rubygems.org'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0'

# Use mysql as the database for Active Record
gem 'mysql2'

# Use SCSS for stylesheets
#gem 'sass-rails', '~> 4.0.0'

# Use Uglifier as compressor for JavaScript assets
#gem 'uglifier', '>= 1.3.0'

# Use CoffeeScript for .js.coffee assets and views
#gem 'coffee-rails', '~> 4.0.0'

# See  for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# Use jquery as the JavaScript library
#gem 'jquery-rails'

# Turbolinks makes following links in your web application faster. Read more: 
#gem 'turbolinks'

# Build JSON APIs with ease. Read more: 
#gem 'jbuilder', '~> 1.2'

group :doc do
  # bundle exec rake doc:rails generates the API under doc/api.
  gem 'sdoc', require: false
end

# Use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# Use unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano', group: :development

# Use debugger
# gem 'debugger', group: [:development, :test]

Database.yml:

# MySQL.  Versions 4.1 and 5.0 are recommended.
#
# Install the MYSQL driver
#   gem install mysql2
#
# Ensure the MySQL gem is defined in your Gemfile
#   gem 'mysql2'
#
# And be sure to use new-style password hashing:
#   
development:
  adapter: mysql2
  encoding: utf8
  database: #simple_cms_development
  pool: 5
  username: root
  password: mypass
  socket: /var/run/mysqld/mysqld.sock

# 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:
  adapter: mysql2
  encoding: utf8
  database: simple_cms_test
  pool: 5
  username: root
  password: mypass
  socket: /var/run/mysqld/mysqld.sock

production:
  adapter: mysql2
  encoding: utf8
  database: simple_cms_production
  pool: 5
  username: root
  password: mypass
  socket: /var/run/mysqld/mysqld.sock

嘗試將'#'放在行的開頭,如下所示:
#數據庫:simple_cms_development

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM