小编amj*_*amj的帖子

无法使用rake db:seed for Rails 3.0创建Devise帐户

我正在尝试使用rake db:seed预先加载所有设备帐户.所有其他模型的数据似乎都插入到数据库中,但由于某种原因,没有为使用设计的Person模型创建行.从Web界面注册工作正常,但我想避免手动创建帐户,这就是我使用rake db:seed的原因.我从通过Web界面创建的帐户中复制了encrypted_pa​​ssword,password_salt.请让我知道如何解决这个问题?非常感谢..

people = Person.create(
                        :email => 'nnn@gmail.com',
                        :encrypted_password => '$2a$10$SyacAOhJQtVeTcTPYm.ROuFbhGMylfj4fLrK3NHyeRwfEokKp2NVW',
                        :password_salt => '$2a$10$SyacAOhJQtVeTcTPYm.ROu',
                        :first_name => "nnn",
                        :last_name => "yyy"
                       )


in routes.rb i have.

    devise_for :people
Run Code Online (Sandbox Code Playgroud)

rake ruby-on-rails devise

8
推荐指数
1
解决办法
6155
查看次数

无法使用JDBC连接到msql 2008 express

我能够使用SQL server management Studio连接到本地计算机上的MSSQL 2008 express,用于主机'nash-pc\sqlexpress'.但是当我连接Microsoft JDBC驱动程序时,它给出了如下错误.JDBC在主机名中有"\"有问题吗?我不知道如何让主机名成为'localhost'而不是'nash-pc\sqlexpress'.有趣的是,如果我使用服务器名称作为"localhost",那么我甚至无法连接SQL Server Management Studio.

" The driver encountered an unknown error: com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host nash-pc, port 1433 has failed. Error: "Connection refused: connect. Verify the connection properties, check that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port, and that no firewall is blocking TCP connections to the port."."

我的JDBC连接字符串

司机: com.microsoft.sqlserver.jdbc.SQLServerDriver

网址: jdbc:sqlserver://nash-pc\sqlexpress:1433;databaseName=jruby

sql jdbc sql-server-2008

2
推荐指数
1
解决办法
1万
查看次数

标签 统计

devise ×1

jdbc ×1

rake ×1

ruby-on-rails ×1

sql ×1

sql-server-2008 ×1