随笔分类 - Ruby
Ruby
摘要:Gemfile文件里添加 gem 'bulk_insert' #批量插入 命令行执行安装依赖 bundle install 数据源 ["1.180.3.187", 161, 2601] ["1.180.3.178", 161, 2601, 44222, 44333] 批量插入 def test3(p
阅读全文
摘要:json_object={ "ip"=> "127.0.0.1", "ports"=> '80,135', "data"=>{"port"=>22,"item"=>["22","open","tcp","","ssh"]} } puts "json_object:#{ json_object.to_
阅读全文
摘要:创建控制器 --no-assets 我们不需要生成资源文件 haima@haima-PC:/media/haima/34E401CC64DD0E28/site/go/src/ruby/rails_demo$ rails g controller api/v1/order --no-assets cr
阅读全文
摘要:添加字段 控制台上执行下面的命令 rails g migration addColumnToBlackIps send_time:datetime 会生成文件db/migrate/20210529131328_add_column_to_black_ips.rb class AddColumnToB
阅读全文
摘要:start.sh #!/bin/bash nohup rails s Puma -d >> run_log.log 2>&1 & stop.sh #!/bin/bash ps -ef |grep puma |awk '{print $2}'|xargs kill -9
阅读全文
摘要:下载ruby 下载地址: ruby各版本下载地址 https://rubyinstaller.org/downloads/ 2.3.3版本 https://www.cr173.com/soft/14252.html 下载后安装 这里以2.7.3为例 双击安装后 回车 回车 C:\Users\Admi
阅读全文
摘要:https://blog.51cto.com/abian/1337989
阅读全文
摘要:github地址 https://github.com/rest-client/rest-client gemfile里添加 gem 'rest-client', '~> 2.0' 执行 bundle install 代码里 # 要请求接口地址 # 上传文件的key名字 # file 文件的绝对路径
阅读全文
摘要:https://www.cnblogs.com/chentianwei/p/9227594.html
阅读全文
摘要:# 文件的当前目录 puts __FILE__ # string.rb # 文件的当前行 puts __LINE__ # 6 #文件的当前目录 puts __dir__ #/media/haima/34E401CC64DD0E28/site/ruby/RubyStudy/Lesson02 puts
阅读全文
摘要:debug启动 debug启动 安装插件 报错: 网络问题 下载 ruby-debug-ide-2.3.1 解压到 /home/haima/.rvm/gems/ruby-2.3.8/gems/
阅读全文
摘要:rails s报如下错误 Could not find mimemagic-0.3.2 in any of the sources Run `bundle install` to install missing gems. haima@haima-PC:/media/haima/34E401CC64
阅读全文
摘要:gem添加分页的依赖 #列表分页 gem 'will_paginate', '~> 3.0.pre2' bundle 安装依赖 用户列表控制器 before_filter :auth_user,only: [:index] #只有inidex 方法才验证用户登陆 #用户列表页面 def index
阅读全文
摘要:rails帮助命令 rails -h 创建user模型 命令行 haima@haima-PC:/media/haima/34E401CC64DD0E28/site/go/src/ruby/circles$ rails g model user Running via Spring preloader
阅读全文
摘要:修改Gamefile Gamefile 里添加 gem 'mysql2' 执行命令行 bundle 可以看到下图片上已经安装好依赖了 修改配置文件 修改config/database.yml文件 # SQLite. Versions 3.8.0 and up are supported. # gem
阅读全文
摘要:https://www.jianshu.com/p/ced2793bfde4?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation gem list --help #查看帮助 ge
阅读全文
摘要:学习视频 https://www.bilibili.com/video/BV1RJ411W7N3?t=49&p=7 一. 启动rails 启动 cd circles/ #到circles的项目根目录里 以下项目名称为 circles rails s -p 3001 #如果不写端口,默认是3000 r
阅读全文
摘要:rails安装 ruby 1.8.6 对应的rails是2.3.2 Ruby 1.8.7 或 1.9.2 对应的rails 2.3.x ruby1.9.3,对应的rails是3.2.12, ruby2.0.0,对应的rails版本是4.0 | Rails 4.2.5 ruby 2.3.8p459,对
阅读全文
摘要:Ruby入门学习: 视频教程 https://www.bilibili.com/video/BV1QW411F7rh?t=401&p=1 笔记 https://github.com/haimait/RubyStudy https://gitee.com/komavideo/LearnRuby Rub
阅读全文
摘要:参考: https://blog.csdn.net/qq_35641923/article/details/86493822 https://www.runoob.com/ruby/ruby-installation-unix.html https://www.jianshu.com/p/1fbbc
阅读全文

浙公网安备 33010602011771号