随笔分类 -  ruby

各种”xxx“ native gem required installed build tools 报错
摘要:报错情况:(类似毛病 提示native gem require installed builld tools的解决方法是一样的)) 解决方法:http://rubyinstaller.org/downloads/ 下载 devkit 安装后,修改devkit文件夹里面的config.yml 文件(记 阅读全文
posted @ 2018-03-03 09:43 一只猪儿虫 阅读(181) 评论(0) 推荐(0)
certificate verify fails (https://gems.ruby-china.org错误
摘要:首先:执行这一步报错的背景是: 更换gems源, 通常执行 gem sources --add https://gems.ruby-china.org/ --remove https://rubygems.org/ 更新缓存 gem sources -u 执行到这如果没问题,那就万事大吉。但是我今天 阅读全文
posted @ 2018-03-03 09:43 一只猪儿虫 阅读(226) 评论(0) 推荐(0)
ruby:TypeError: 对象不支持此属性或方法(<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolink)
摘要:我整理了一下 目前有三种方法,我是windows 7 64位, 答案中很多人是win8也成功了。 方法1:找到当前项目下 app/javascripts/applications.js 把里面的//= require_tree . 这一行删掉, 重启rails server ,刷新页面(我运气好,这 阅读全文
posted @ 2018-03-03 09:42 一只猪儿虫 阅读(1113) 评论(0) 推荐(0)
ruby部署之Heroku
摘要:下载安装 :https://devcenter.heroku.com/articles/heroku-cli (我是windows,所以我下载windows) cmd黑窗口输入: $ heroku version 如果有显示表示安装成功 确认 Heroku 命令行工具已经安装之后,使用heroku 阅读全文
posted @ 2018-03-03 09:39 一只猪儿虫 阅读(308) 评论(0) 推荐(0)
ruby on rails 撤销取消操作
摘要:撤销操作一个常见的情况是更改控制器的名字,这时你得删除生成的文件。生成控制器时,除了控制器文件本身之外,Rails 还会生成很多其他文件(参见代码清单 3.6)。撤销生成的文件不仅仅要删除控 制器文件,还要删除不少辅助文件。rails generate 命令还会自动修改routes.rb 文件,因此 阅读全文
posted @ 2018-03-03 09:38 一只猪儿虫 阅读(160) 评论(0) 推荐(0)
heroku 部署ruby项目后 未连接数据库显示(We're sorry, but something went wrong. If you are the application owner )
摘要:如何部署请参照: http://blog.csdn.net/xz360717118/article/details/62422741 部署后如果发现显示:We're sorry, but something went wrong. If you are the application owner。。 阅读全文
posted @ 2018-03-03 09:38 一只猪儿虫 阅读(2543) 评论(0) 推荐(0)
ruby 如何确定数据类型
摘要:比如变量a = User.name 那么这个a数据类型是什么? a.class (.class方法返回当前数据类型) 阅读全文
posted @ 2018-03-03 09:35 一只猪儿虫 阅读(2765) 评论(0) 推荐(0)
`require': cannot load such file -- bcrypt_ext (LoadError) (window 7+ruby2.33+rails5.0. 下出现的问题)
摘要:首先有的解决方案是linux上的, 有的解决方案是ruby低版本的 有的解决方案是bcrypt包的低版本的,如要安装什么 bcrypt-ruby,实际上在安装的时候,系统已经提示:名字已经更换 !!!不要用了!!! 我尝试过stackflow上面的很多问题, 最后,在不断的试错情况下,ruby2.3 阅读全文
posted @ 2018-03-03 09:34 一只猪儿虫 阅读(220) 评论(0) 推荐(0)
rails db:migrate:reset 或者 rails db:rest失败 (rails 5)报错(Permission denied、Couldn't drop database)
摘要:报错信息 D:\ruby\sample_app>rails db:migrate:reset Permission denied @ unlink_internal - D:/ruby/sample_app/db/development.sqlite3Couldn't drop database ' 阅读全文
posted @ 2018-03-03 09:30 一只猪儿虫 阅读(284) 评论(0) 推荐(0)
(win 7)使用puma以后,重启rails server报错: in `trap': unsupported signal SIGCHLD (ArgumentError)
摘要:如图: 解决方案: 把config/puma.rb 文件中的 改成 阅读全文
posted @ 2018-03-03 09:29 一只猪儿虫 阅读(350) 评论(0) 推荐(0)
rails中 flash 和 flash.now的区别
摘要:Flash[:notice]’s message will persist to the next action and should be used when redirecting to another action via the ‘redirect_to’ method. flash方法的消 阅读全文
posted @ 2018-03-03 09:29 一只猪儿虫 阅读(173) 评论(0) 推荐(0)
ActiveRecord::Fixture::FixtureError: table "users" has no column named "activated_at".
摘要:window 7+ruby2.33+rails5.0. 在测试的时候 rails test 报固件fixture错误: 没有某列字段存在 虽然可以直接通过开发框架去修改字段,但是开发过程中应该通过迁移文件来实现所有的修改 我错误的原因是,我在通过migration生成users表的时候把其中一个字段 阅读全文
posted @ 2018-03-03 09:28 一只猪儿虫 阅读(313) 评论(0) 推荐(0)
ActiveRecord::Fixture::FormatError: ActiveRecord::Fixture::FormatError
摘要:环境:window 7+ruby2.33+rails5.0。。 该提示的意思是固件格式错误: 但是又没有提示是哪一行 非常蛋疼,我照成的原因居然是没有对齐,请看:(下面的activated_at没有和前面对齐) 阅读全文
posted @ 2018-03-03 09:27 一只猪儿虫 阅读(208) 评论(0) 推荐(0)