`
samgell
  • 浏览: 11083 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
最近访客 更多访客>>
文章分类
社区版块
存档分类
最新评论
文章列表
这个问题碰到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
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 ...
xx.new 是 has_many has_noe 是 create_xx 或 build_xx
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 ...
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  ...
bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
bundle install无法成功安装mysql2 应该是缺少了一个必要的文件!!! 有一种好轻松的解决办法, 就是先再gemfile 里先gem 'mysql'然后bundle install 这样能安装成功,也把必要的文件也安装了 然后再把gemfile里的gem 'mysql'改成gem 'mysql2' 最后安装成功
rails g scaffold_controller model_name 如果目录分层 rails g scaffold_controller module/model_name
现在,我们的所有的controller都放在app/controller目录下,有时候我们的controller可能比较多,为了不污染到顶层的命名空间(namespace),我们可以选择将某几个controller归组到一个单独的命名空间里。 对此,Rails有一个简单的约定,如果一个请求(request)包括了controller的名字,例如:admin/book,Rails会在app/controller/admin/目录下寻找名为book_controller的控制器,控制器名字的最后部分将会变换成name_controller.rb,并且将会从app/controller目录开始,根据 ...
环境: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 ...
Global site tag (gtag.js) - Google Analytics