文章列表
这个问题碰到3次了,因此记录一下
rake 命令报错: uninitialized constant rake::dsl
原因是rails 3.1.0 和 rake 1.3.2的版本不兼容
暂时解决办法,把rake 降低到0.9.2
gem install rake -v=0.9.2
- 2011-09-02 16:09
- 浏览 877
- 评论(0)
Run the command – ‘gem install mysql2′
Got the following error-
D:\DEVKIT_INSTALL_DIR>gem install mysql2
Temporarily enhancing PATH to include DevKit…
Building native extensions. This could take a while…
ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.
C:/Rub ...
- 2011-09-01 20:15
- 浏览 1078
- 评论(0)
Use the database for sessions instead of the cookie-based default, which shouldn't be used to store highly confidential information
Create the session table with
1.rake db:sessions:create
Run the migration
rake db:migrate
Make sure you also tell rails to use ActiveRecord ...
- 2011-08-01 12:50
- 浏览 1132
- 评论(0)
no such file to load -- openssl
This error occurred while loading the following files: openssl
Are you using RVM?
If so you may want to reinstall ruby with the location of your openssl installation passed as an option:
$ rvm remove 1.8.7
$ rvm install 1.8.7 --with-openssl-dir=/usr/local/openssl ...
- 2011-07-26 10:55
- 浏览 802
- 评论(0)
bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
- 2011-07-18 18:33
- 浏览 655
- 评论(0)
bundle install无法成功安装mysql2
应该是缺少了一个必要的文件!!!
有一种好轻松的解决办法,
就是先再gemfile 里先gem 'mysql'然后bundle install
这样能安装成功,也把必要的文件也安装了
然后再把gemfile里的gem 'mysql'改成gem 'mysql2'
最后安装成功
- 2011-07-13 19:09
- 浏览 1407
- 评论(0)
rails g scaffold_controller model_name
如果目录分层
rails g scaffold_controller module/model_name
- 2011-07-03 17:06
- 浏览 1605
- 评论(0)
现在,我们的所有的controller都放在app/controller目录下,有时候我们的controller可能比较多,为了不污染到顶层的命名空间(namespace),我们可以选择将某几个controller归组到一个单独的命名空间里。
对此,Rails有一个简单的约定,如果一个请求(request)包括了controller的名字,例如:admin/book,Rails会在app/controller/admin/目录下寻找名为book_controller的控制器,控制器名字的最后部分将会变换成name_controller.rb,并且将会从app/controller目录开始,根据 ...
- 2011-07-03 17:02
- 浏览 1561
- 评论(0)
环境:Ruby 1.9.1/Rails 3.0.9/Rake 0.9.2
在运行rake db:create的时候提示
1.rake aborted!
2.uninitialized constant Rake::DSL
3./usr/local/ruby/lib/ruby/1.9.1/rake.rb:2482:in `const_missing'
4./usr/local/ruby/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/tasklib.rb:8:in `<class:TaskLib>'
5./usr/l ...