- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我是 Ruby 和 Rails 新手,第一次建立项目。每次我尝试启动 WEBrick 服务器时,它都会启动然后关闭。任何帮助,将不胜感激。我似乎需要提供密码,但我不知道该怎么做。
bkuethen$ rails s
=> Booting WEBrick
=> Rails 3.2.13 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/Users/bkuethen/.rvm/gems/ruby-2.0.0-p195/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `connect': Access denied for user 'root'@'localhost' (using password: NO) (Mysql2::Error)
from /Users/bkuethen/.rvm/gems/ruby-2.0.0-p195/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `initialize'
from /Users/bkuethen/.rvm/gems/ruby-2.0.0-p195/gems/activerecord-3.2.13/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `new'
from /Users/bkuethen/.rvm/gems/ruby-2.0.0-p195/gems/activerecord-3.2.13/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `mysql2_connection'
from /Users/bkuethen/.rvm/gems/ruby-2.0.0-p195/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:315:in `new_connection'
from /Users/bkuethen/.rvm/gems/ruby-2.0.0-p195/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:325:in `checkout_new_connection'
from /Users/bkuethen/.rvm/gems/ruby-2.0.0-p195/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:247:in `block (2 levels) in checkout'
from /Users/bkuethen/.rvm/gems/ruby-2.0.0-p195/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `loop'
from /Users/bkuethen/.rvm/gems/ruby-2.0.0-p195/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `block in checkout'
from /Users/bkuethen/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
from /Users/bkuethen/.rvm/gems/ruby-2.0.0-p195/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:239:in `checkout'
from /Users/bkuethen/.rvm/gems/ruby-2.0.0-p195/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:102:in `block in connection'
from /Users/bkuethen/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
from /Users/bkuethen/.rvm/gems/ruby-2.0.0-p195/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:101:in `connection'
from /Users/bkuethen/.rvm/gems/ruby-2.0.0-p195/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:410:in `retrieve_connection'
from /Users/bkuethen/.rvm/gems/ruby-2.0.0-p195/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:171:in `retrieve_connection'
from /Users/bkuethen/.rvm/gems/ruby-2.0.0-p195/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:145:in `connection'
from /Users/bkuethen/.rvm/gems/ruby-2.0.0-p195/gems/activerecord-3.2.13/lib/active_record/railtie.rb:88:in `block in <class:Railtie>'
from /Users/bkuethen/.rvm/gems/ruby-2.0.0-p195/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/bkuethen/.rvm/gems/ruby-2.0.0-p195/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `run'
from /Users/bkuethen/.rvm/gems/ruby-2.0.0-p195/gems/railties-3.2.13/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/bkuethen/.rvm/gems/ruby-2.0.0-p195/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `each'
from /Users/bkuethen/.rvm/gems/ruby-2.0.0-p195/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/bkuethen/.rvm/gems/ruby-2.0.0-p195/gems/railties-3.2.13/lib/rails/application.rb:136:in `initialize!'
from /Users/bkuethen/.rvm/gems/ruby-2.0.0-p195/gems/railties-3.2.13/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /Users/bkuethen/Dropbox/Rails Sites/simple_cms/config/environment.rb:5:in `<top (required)>'
from /Users/bkuethen/Dropbox/Rails Sites/simple_cms/config.ru:3:in `require'
from /Users/bkuethen/Dropbox/Rails Sites/simple_cms/config.ru:3:in `block in <main>'
from /Users/bkuethen/.rvm/gems/ruby-2.0.0-p195/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval'
from /Users/bkuethen/.rvm/gems/ruby-2.0.0-p195/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize'
from /Users/bkuethen/Dropbox/Rails Sites/simple_cms/config.ru:in `new'
from /Users/bkuethen/Dropbox/Rails Sites/simple_cms/config.ru:in `<main>'
from /Users/bkuethen/.rvm/gems/ruby-2.0.0-p195/gems/rack-1.4.5/lib/rack/builder.rb:40:in `eval'
from /Users/bkuethen/.rvm/gems/ruby-2.0.0-p195/gems/rack-1.4.5/lib/rack/builder.rb:40:in `parse_file'
from /Users/bkuethen/.rvm/gems/ruby-2.0.0-p195/gems/rack-1.4.5/lib/rack/server.rb:200:in `app'
from /Users/bkuethen/.rvm/gems/ruby-2.0.0-p195/gems/railties-3.2.13/lib/rails/commands/server.rb:46:in `app'
from /Users/bkuethen/.rvm/gems/ruby-2.0.0-p195/gems/rack-1.4.5/lib/rack/server.rb:304:in `wrapped_app'
from /Users/bkuethen/.rvm/gems/ruby-2.0.0-p195/gems/rack-1.4.5/lib/rack/server.rb:254:in `start'
from /Users/bkuethen/.rvm/gems/ruby-2.0.0-p195/gems/railties-3.2.13/lib/rails/commands/server.rb:70:in `start'
from /Users/bkuethen/.rvm/gems/ruby-2.0.0-p195/gems/railties-3.2.13/lib/rails/commands.rb:55:in `block in <top (required)>'
from /Users/bkuethen/.rvm/gems/ruby-2.0.0-p195/gems/railties-3.2.13/lib/rails/commands.rb:50:in `tap'
from /Users/bkuethen/.rvm/gems/ruby-2.0.0-p195/gems/railties-3.2.13/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
gem
actionmailer (3.2.13)
actionpack (3.2.13)
activemodel (3.2.13)
activerecord (3.2.13)
activeresource (3.2.13)
activesupport (3.2.13)
arel (3.0.2)
bigdecimal (1.2.0)
builder (3.0.4)
bundler (1.3.5)
coffee-rails (3.2.2)
coffee-script (2.2.0)
coffee-script-source (1.6.2)
erubis (2.7.0)
execjs (1.4.0)
hike (1.2.2)
i18n (0.6.1)
io-console (0.4.2)
journey (1.0.4)
jquery-rails (3.0.0)
json (1.8.0, 1.7.7)
mail (2.5.4)
mime-types (1.23)
minitest (4.3.2)
multi_json (1.7.4)
mysql2 (0.3.11)
polyglot (0.3.3)
psych (2.0.0)
rack (1.4.5)
rack-cache (1.2)
rack-ssl (1.3.3)
rack-test (0.6.2)
rails (3.2.13)
railties (3.2.13)
rake (10.0.4, 0.9.6)
rdoc (4.0.0, 3.12.2)
rubygems-bundler (1.1.1)
rvm (1.11.3.8)
sass (3.2.9)
sass-rails (3.2.6)
sprockets (2.2.2)
test-unit (2.0.0.0)
thor (0.18.1)
tilt (1.4.1)
treetop (1.4.12)
tzinfo (0.3.37)
uglifier (2.1.1)
更新数据库文件配置:
# 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:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
adapter: mysql2
encoding: utf8
reconnect: false
database: simple_cms_development
pool: 5
username: root
password:
socket: /tmp/mysql.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
reconnect: false
database: simple_cms_test
pool: 5
username: root
password:
socket: /tmp/mysql.sock
production:
adapter: mysql2
encoding: utf8
reconnect: false
database: simple_cms_production
pool: 5
username: root
password:
socket: /tmp/mysql.sock
最佳答案
这是堆栈跟踪第一行的关键信息:
Access denied for user 'root'@'localhost' (using password: NO)
您已为 root 用户设置了密码。您只需要将 root 密码添加到您的database.yml 中即可:
development:
...
password: MYPASSWORDHERE
...
保存文件,然后重新启动 Webrick。
如果您忘记了 MySQL 的 root 密码,则需要重置它,如 here 中所述。 .
关于mysql - WEBrick 服务器不断关闭,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16878836/
我是 Ruby 和 Rails 新手,第一次建立项目。每次我尝试启动 WEBrick 服务器时,它都会启动然后关闭。任何帮助,将不胜感激。我似乎需要提供密码,但我不知道该怎么做。 bkuethen$
尝试在这里学习 Ruby on Rails 并遵循视频教程,但似乎无法运行环境。我现在已经使用rails new project_name 创建了一个项目,但是当我去运行服务器rails 服务器时,我
WEBrick 实例方法 mount_proc 做了什么(用简单的英语)? 文档说: mount_proc(dir, proc=nil, &block) Mounts proc or block on
首先我要说的是,我不知道自己在做什么。 好吧,既然这样,我的问题是:我正在运行 Grunt 的网络服务器来提供前端文件,并且正在运行 webrick 来提供数据 api。 Grunt 使用 grunt
首先让我说我不知道自己在做什么。 好吧,不打扰了,我的问题是:我正在运行 Grunt 的网络服务器来提供前端文件,我正在为数据 api 运行 webrick。 Grunt 使用 grunt-con
您能推荐一个修复方法吗? 我根据其他 SE 问题尝试过的补救措施: 运行捆绑安装 运行 gem 清理 运行 bundle exec rails server 运行 sudo ln -s/usr/loc
我像这样启动一个 webrick 服务器: dell@dev:/var/www/ruby$ ruby -run -httpd. -p 5000 并将此代码放入abc.rb: require 'web
我有一个在不同硬件上运行的网络应用程序,其中大部分由智能电视和机顶盒组成。 我的网络应用程序包含一个 ruby 脚本来设置应用程序以进行本地调试。此脚本构建我的应用程序,监听文件更改,并使用简单的
我之前运行的是 Linux Mint 13,现在刚切换到 Fedora 17。既然我已经切换了,我就无法再阻止 Webrick。我使用 Jetbrains Rubymine,并且启动服务器工作正常,但
我有一个非常基本的 webrick 服务器,用于运行嵌入式设备的管理页面。我们刚刚向设备添加了基本身份验证并且效果很好,但是您会像这样返回通用的“未经授权”消息: Unauthorized
我有以下代码,其中 fork 了一个 WEBrick 实例,我想等到 webrick 启动,然后再继续其余代码: require 'webrick' pid = fork do server =
如何禁止将来自 webrick 的消息回显到终端?对于出现在开头的 INFO 消息,我可以通过设置 Logger 参数来禁用它: s = WEBrick::HTTPServer.new( Port
我正在运行一个简单的 WEBrick 服务器来调试 POST 数据。我想将 POST 数据输出到日志。 我的代码是: server.mount_proc '/' do |req, res| r
就生产环境而言,使用 Phusion Passenger 或仅使用 WEBrick(例如 rails s)有什么区别? 我知道 Phusion Passenger 在 Apache 或 Nginx 上
我想在我做的时候设置默认端口 rails s 到 3010,而不必说: rails s -p 3010 ...每次。有任何想法吗? 最佳答案 您可以覆盖 Port通过将以下代码添加到 config/b
我目前有: $ rails s => Booting WEBrick => Rails 3.0.9 application starting in development on http://0.0.
如何配置 Aptana 以在 Ruby On Rails 项目上启动 webrick 服务器? 我使用选项“提升到项目”来使用 aptana 打开一个现有的 Rails 项目。我不知道如何在 Apta
我正在使用 ~/.rdebugrc 的内容运行 WEBrick文件正在 set autolist set autoeval set autoreload autolist 和 autoeval 默认开
有没有一种方法可以不冗长地启动 WEBrick 服务器。我觉得它记录了太多信息。例如: rails s --verbose=false 最佳答案 您可以在 Rails 配置中更改日志级别。 confi
目前,如果我更改lib /和app / helpers /目录中的文件,则必须重新启动服务器。有没有一种方法可以配置Rails或Webrick,以便它也可以热交换那些目录中的文件? 最佳答案 在您的c
我是一名优秀的程序员,十分优秀!