win10 安装mingw ruby rails
原文可以参考
https://ruby-china.org/topics/17581
在window10 安装ruby rails
https://rubyinstaller.org/downloads/下载 ruby版本,我是用的是最新版本2.5.2
首先安装ruby版本 一步步安装 最后 不要快安装完成时不要勾选 ridk install选项,因为从命令行下载太慢,单独下载安装
2.安装编译环境
步骤:
去 http://www.mys2.org/ 下载 http://repo.msys2.org/distrib/x86_64/msys2-x86_64-20161025.exe
然后一步步安装
安装完成后 关闭即可。
3.打开命令行 运行 ridk install
输入数字3 剩下的不用管了,自己下载mingw源码包然后生成环境。
tip:可以测试mingw环境 cmd->ridk enable->gcc -v
4.接下来解决sqlite3/sqlite_native.so问题(github中sqlite3-ruby有编译介绍)
修正:首先需要下载sqlite3源代码,cmd->ridk enable->cd sqlite3目录->bash configure->make ->make install安装mingw版本 然后进行下面步骤
5.第1步骤 打开命令行 输入 gem install sqlite3
第2步骤 进入 sqlite3 gem路径
cd C:\Ruby25-x64\lib\ruby\gems\2.5.0\gems\sqlite3-1.3.13-x64-mingw32
命令行输入 ridk enable( 开启mingw编译环境)
然后
ruby setup.rb config
ruby setup.rb setup
ruby setup.rb install
然后就可以了
测试 irb > require "sqlite3" =>true
安装 rails
gem install rails
rails new blog
cd blog
配置 rails bundle选择从https://gems.ruby-china.org/
sudo bundle config mirror.https://rubygems.org/ https://gems.ruby-china.org/
rails s
打开浏览器 输入 localhost:3000/
至此结束。
我拷贝了ruby官方api文档 放置在https://iwetuan.shop 目前网站空闲
sqlite3 github
https://github.com/sparklemotion/sq
粘贴我的过程
C:\Users\haitun\Desktop\wechat\df>rails s
Could not find rake-12.3.1 in any of the sources
Run `bundle install` to install missing gems.
C:\Users\haitun\Desktop\wechat\df>rails install
Could not find rake-12.3.1 in any of the sources
Run `bundle install` to install missing gems.
C:\Users\haitun\Desktop\wechat\df>bundle install
Fetching gem metadata from https://gems.ruby-china.org/..........
Fetching rake 12.3.1
Installing rake 12.3.1
Using concurrent-ruby 1.0.5
Using i18n 0.9.5
Fetching minitest 5.11.3
Installing minitest 5.11.3
Using thread_safe 0.3.6
Using tzinfo 1.2.5
Using activesupport 5.1.5
Using builder 3.2.3
Using erubi 1.7.1
Using mini_portile2 2.3.0
Using nokogiri 1.8.2 (x64-mingw32)
Using rails-dom-testing 2.0.3
Using crass 1.0.3
Using loofah 2.2.2
Using rails-html-sanitizer 1.0.4
Using actionview 5.1.5
Using rack 2.0.4
Using rack-test 0.8.3
Using actionpack 5.1.5
Using nio4r 2.3.0
Using websocket-extensions 0.1.3
Using websocket-driver 0.6.5
Using actioncable 5.1.5
Using globalid 0.4.1
Using activejob 5.1.5
Using mini_mime 1.0.0
Using mail 2.7.0
Using actionmailer 5.1.5
Using activemodel 5.1.5
Using arel 8.0.0
Using activerecord 5.1.5
Fetching public_suffix 3.0.2
Installing public_suffix 3.0.2
Fetching addressable 2.5.2
Installing addressable 2.5.2
Fetching bindex 0.5.0
Installing bindex 0.5.0 with native extensions
Using bundler 1.16.1
Fetching byebug 10.0.1
Installing byebug 10.0.1 with native extensions
Fetching xpath 3.0.0
Installing xpath 3.0.0
Fetching capybara 2.18.0
Installing capybara 2.18.0
Fetching ffi 1.9.23 (x64-mingw32)
Installing ffi 1.9.23 (x64-mingw32)
Fetching childprocess 0.9.0
Installing childprocess 0.9.0
Fetching coffee-script-source 1.12.2
Installing coffee-script-source 1.12.2
Fetching execjs 2.7.0
Installing execjs 2.7.0
Fetching coffee-script 2.4.1
Installing coffee-script 2.4.1
Using method_source 0.9.0
Using thor 0.20.0
Using railties 5.1.5
Fetching coffee-rails 4.2.2
Installing coffee-rails 4.2.2
Fetching multi_json 1.13.1
Installing multi_json 1.13.1
Fetching jbuilder 2.7.0
Installing jbuilder 2.7.0
Fetching puma 3.11.3
Installing puma 3.11.3 with native extensions
Using sprockets 3.7.1
Using sprockets-rails 3.2.1
Using rails 5.1.5
Fetching rb-fsevent 0.10.3
Installing rb-fsevent 0.10.3
Fetching rb-inotify 0.9.10
Installing rb-inotify 0.9.10
Fetching rubyzip 1.2.1
Installing rubyzip 1.2.1
Fetching sass-listen 4.0.0
Installing sass-listen 4.0.0
Fetching sass 3.5.6
Installing sass 3.5.6
Fetching tilt 2.0.8
Installing tilt 2.0.8
Fetching sass-rails 5.0.7
Installing sass-rails 5.0.7
Fetching selenium-webdriver 3.11.0
Installing selenium-webdriver 3.11.0
Fetching sqlite3 1.3.13 (x64-mingw32)
Installing sqlite3 1.3.13 (x64-mingw32)
Fetching turbolinks-source 5.1.0
Installing turbolinks-source 5.1.0
Fetching turbolinks 5.1.0
Installing turbolinks 5.1.0
Fetching tzinfo-data 1.2018.3
Installing tzinfo-data 1.2018.3
Fetching uglifier 4.1.8
Installing uglifier 4.1.8
Fetching web-console 3.5.1
Installing web-console 3.5.1
Bundle complete! 13 Gemfile dependencies, 67 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
C:\Users\haitun\Desktop\wechat\df>rails s
Traceback (most recent call last):
22: from bin/rails:4:in `<main>'
21: from bin/rails:4:in `require'
20: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/railties-5.1.5/lib/rails/commands.rb:16:in `<top (required)>'
19: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/railties-5.1.5/lib/rails/command.rb:44:in `invoke'
18: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/railties-5.1.5/lib/rails/command/base.rb:63:in `perform'
17: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
16: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
15: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
14: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/railties-5.1.5/lib/rails/commands/server/server_command.rb:130:in `perform'
13: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/railties-5.1.5/lib/rails/commands/server/server_command.rb:130:in `tap'
12: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/railties-5.1.5/lib/rails/commands/server/server_command.rb:133:in `block in perform'
11: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/railties-5.1.5/lib/rails/commands/server/server_command.rb:133:in `require'
10: from C:/Users/haitun/Desktop/wechat/df/config/application.rb:7:in `<top (required)>'
9: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/bundler-1.16.1/lib/bundler.rb:114:in `require'
8: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:65:in `require'
7: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:65:in `each'
6: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:76:in `block in require'
5: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:76:in `each'
4: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:81:in `block (2 levels) in require'
3: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:81:in `require'
2: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/sqlite3-1.3.13-x64-mingw32/lib/sqlite3.rb:2:in `<top (required)>'
1: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/sqlite3-1.3.13-x64-mingw32/lib/sqlite3.rb:6:in `rescue in <top (required)>'
C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/sqlite3-1.3.13-x64-mingw32/lib/sqlite3.rb:6:in `require': cannot load such file -- sqlite3/sqlite3_native (LoadError)
C:\Users\haitun\Desktop\wechat\df>ls
'ls' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
C:\Users\haitun\Desktop\wechat\df>cd C:\Ruby25-x64\lib\ruby\gems\2.5.0\gems\sqlite3-1.3.13-x64-mingw32
C:\Ruby25-x64\lib\ruby\gems\2.5.0\gems\sqlite3-1.3.13-x64-mingw32>
C:\Ruby25-x64\lib\ruby\gems\2.5.0\gems\sqlite3-1.3.13-x64-mingw32>
C:\Ruby25-x64\lib\ruby\gems\2.5.0\gems\sqlite3-1.3.13-x64-mingw32>
C:\Ruby25-x64\lib\ruby\gems\2.5.0\gems\sqlite3-1.3.13-x64-mingw32>
C:\Ruby25-x64\lib\ruby\gems\2.5.0\gems\sqlite3-1.3.13-x64-mingw32>ruby setup.rb config
---> lib
---> lib/sqlite3
---> lib/sqlite3/2.0
<--- lib/sqlite3/2.0
---> lib/sqlite3/2.1
<--- lib/sqlite3/2.1
---> lib/sqlite3/2.2
<--- lib/sqlite3/2.2
---> lib/sqlite3/2.3
<--- lib/sqlite3/2.3
---> lib/sqlite3/2.4
<--- lib/sqlite3/2.4
<--- lib/sqlite3
<--- lib
---> ext
---> ext/sqlite3
C:/Ruby25-x64/bin/ruby C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/sqlite3-1.3.13-x64-mingw32/ext/sqlite3/extconf.rb
checking for sqlite3.h... *** C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/sqlite3-1.3.13-x64-mingw32/ext/sqlite3/extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/sqlite3-1.3.13-x64-mingw32/ext/sqlite3
--curdir
--ruby=C:/Ruby25-x64/bin/$(RUBY_BASE_NAME)
--with-sqlite3-config
--without-sqlite3-config
--with-pkg-config
--without-pkg-config
--with-sqlite3-dir
--without-sqlite3-dir
--with-sqlite3-include
--without-sqlite3-include=${sqlite3-dir}/include
--with-sqlite3-lib
--without-sqlite3-lib=${sqlite3-dir}/lib
Traceback (most recent call last):
11: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/sqlite3-1.3.13-x64-mingw32/ext/sqlite3/extconf.rb:50:in `<main>'
10: from C:/Ruby25-x64/lib/ruby/2.5.0/mkmf.rb:1149:in `find_header'
9: from C:/Ruby25-x64/lib/ruby/2.5.0/mkmf.rb:946:in `checking_for'
8: from C:/Ruby25-x64/lib/ruby/2.5.0/mkmf.rb:346:in `postpone'
7: from C:/Ruby25-x64/lib/ruby/2.5.0/mkmf.rb:320:in `open'
6: from C:/Ruby25-x64/lib/ruby/2.5.0/mkmf.rb:350:in `block in postpone'
5: from C:/Ruby25-x64/lib/ruby/2.5.0/mkmf.rb:320:in `open'
4: from C:/Ruby25-x64/lib/ruby/2.5.0/mkmf.rb:350:in `block (2 levels) in postpone'
3: from C:/Ruby25-x64/lib/ruby/2.5.0/mkmf.rb:947:in `block in checking_for'
2: from C:/Ruby25-x64/lib/ruby/2.5.0/mkmf.rb:1150:in `block in find_header'
1: from C:/Ruby25-x64/lib/ruby/2.5.0/mkmf.rb:590:in `try_cpp'
C:/Ruby25-x64/lib/ruby/2.5.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
'system C:/Ruby25-x64/bin/ruby C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/sqlite3-1.3.13-x64-mingw32/ext/sqlite3/extconf.rb ' failed
Try 'ruby setup.rb --help' for detailed usage.
C:\Ruby25-x64\lib\ruby\gems\2.5.0\gems\sqlite3-1.3.13-x64-mingw32>
C:\Ruby25-x64\lib\ruby\gems\2.5.0\gems\sqlite3-1.3.13-x64-mingw32>ridk enable
C:\Ruby25-x64\lib\ruby\gems\2.5.0\gems\sqlite3-1.3.13-x64-mingw32>set "RI_DEVKIT=C:\msys64"
C:\Ruby25-x64\lib\ruby\gems\2.5.0\gems\sqlite3-1.3.13-x64-mingw32>set "MSYSTEM=MINGW64"
C:\Ruby25-x64\lib\ruby\gems\2.5.0\gems\sqlite3-1.3.13-x64-mingw32>set "PKG_CONFIG_PATH=/mingw64/lib/pkgconfig:/mingw64/share/pkgconfig"
C:\Ruby25-x64\lib\ruby\gems\2.5.0\gems\sqlite3-1.3.13-x64-mingw32>set "ACLOCAL_PATH=/mingw64/share/aclocal:/usr/share/aclocal"
C:\Ruby25-x64\lib\ruby\gems\2.5.0\gems\sqlite3-1.3.13-x64-mingw32>set "MANPATH=/mingw64/share/man"
C:\Ruby25-x64\lib\ruby\gems\2.5.0\gems\sqlite3-1.3.13-x64-mingw32>set "MINGW_PACKAGE_PREFIX=mingw-w64-x86_64"
C:\Ruby25-x64\lib\ruby\gems\2.5.0\gems\sqlite3-1.3.13-x64-mingw32>set "LANG=zh_CN.UTF-8"
C:\Ruby25-x64\lib\ruby\gems\2.5.0\gems\sqlite3-1.3.13-x64-mingw32>set "PATH=C:\Ruby25-x64\bin;C:\msys64\mingw64\bin;C:\msys64\usr\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Git\cmd;C:\Program Files\CMake\bin;C:\Program Files\PuTTY\;C:\Program Files\MySQL\MySQL Server 5.7\bin;C:\Go\bin;C:\Users\haitun\AppData\Local\Programs\Python\Python36;C:\Users\haitun\AppData\Local\Programs\Python\Python36\Scripts;C:\Ruby25-x64\bin;C:\Users\haitun\AppData\Local\Microsoft\WindowsApps"
C:\Ruby25-x64\lib\ruby\gems\2.5.0\gems\sqlite3-1.3.13-x64-mingw32>ruby setup.rb config
---> lib
---> lib/sqlite3
---> lib/sqlite3/2.0
<--- lib/sqlite3/2.0
---> lib/sqlite3/2.1
<--- lib/sqlite3/2.1
---> lib/sqlite3/2.2
<--- lib/sqlite3/2.2
---> lib/sqlite3/2.3
<--- lib/sqlite3/2.3
---> lib/sqlite3/2.4
<--- lib/sqlite3/2.4
<--- lib/sqlite3
<--- lib
---> ext
---> ext/sqlite3
C:/Ruby25-x64/bin/ruby C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/sqlite3-1.3.13-x64-mingw32/ext/sqlite3/extconf.rb
checking for sqlite3.h... yes
checking for pthread_create() in -lpthread... yes
checking for sqlite3_libversion_number() in -lsqlite3... yes
checking for rb_proc_arity()... yes
checking for rb_integer_pack()... yes
checking for sqlite3_initialize()... yes
checking for sqlite3_backup_init()... yes
checking for sqlite3_column_database_name()... no
checking for sqlite3_enable_load_extension()... yes
checking for sqlite3_load_extension()... yes
checking for sqlite3_open_v2()... yes
checking for sqlite3_prepare_v2()... yes
checking for sqlite3_int64 in sqlite3.h... yes
checking for sqlite3_uint64 in sqlite3.h... yes
creating Makefile
<--- ext/sqlite3
<--- ext
C:\Ruby25-x64\lib\ruby\gems\2.5.0\gems\sqlite3-1.3.13-x64-mingw32>ruby setup.rb setup
---> lib
---> lib/sqlite3
---> lib/sqlite3/2.0
<--- lib/sqlite3/2.0
---> lib/sqlite3/2.1
<--- lib/sqlite3/2.1
---> lib/sqlite3/2.2
<--- lib/sqlite3/2.2
---> lib/sqlite3/2.3
<--- lib/sqlite3/2.3
---> lib/sqlite3/2.4
<--- lib/sqlite3/2.4
<--- lib/sqlite3
<--- lib
---> ext
---> ext/sqlite3
make
generating sqlite3_native-x64-mingw32.def
compiling backup.c
compiling database.c
compiling exception.c
compiling sqlite3.c
compiling statement.c
linking shared-object sqlite3/sqlite3_native.so
<--- ext/sqlite3
<--- ext
C:\Ruby25-x64\lib\ruby\gems\2.5.0\gems\sqlite3-1.3.13-x64-mingw32>ruby setup.rb install
---> lib
mkdir -p C:/Ruby25-x64/lib/ruby/site_ruby/2.5.0/
install sqlite3.rb C:/Ruby25-x64/lib/ruby/site_ruby/2.5.0/
---> lib/sqlite3
mkdir -p C:/Ruby25-x64/lib/ruby/site_ruby/2.5.0/sqlite3
install constants.rb C:/Ruby25-x64/lib/ruby/site_ruby/2.5.0/sqlite3
install database.rb C:/Ruby25-x64/lib/ruby/site_ruby/2.5.0/sqlite3
install errors.rb C:/Ruby25-x64/lib/ruby/site_ruby/2.5.0/sqlite3
install pragmas.rb C:/Ruby25-x64/lib/ruby/site_ruby/2.5.0/sqlite3
install resultset.rb C:/Ruby25-x64/lib/ruby/site_ruby/2.5.0/sqlite3
install statement.rb C:/Ruby25-x64/lib/ruby/site_ruby/2.5.0/sqlite3
install translator.rb C:/Ruby25-x64/lib/ruby/site_ruby/2.5.0/sqlite3
install value.rb C:/Ruby25-x64/lib/ruby/site_ruby/2.5.0/sqlite3
install version.rb C:/Ruby25-x64/lib/ruby/site_ruby/2.5.0/sqlite3
---> lib/sqlite3/2.0
mkdir -p C:/Ruby25-x64/lib/ruby/site_ruby/2.5.0/sqlite3/2.0
<--- lib/sqlite3/2.0
---> lib/sqlite3/2.1
mkdir -p C:/Ruby25-x64/lib/ruby/site_ruby/2.5.0/sqlite3/2.1
<--- lib/sqlite3/2.1
---> lib/sqlite3/2.2
mkdir -p C:/Ruby25-x64/lib/ruby/site_ruby/2.5.0/sqlite3/2.2
<--- lib/sqlite3/2.2
---> lib/sqlite3/2.3
mkdir -p C:/Ruby25-x64/lib/ruby/site_ruby/2.5.0/sqlite3/2.3
<--- lib/sqlite3/2.3
---> lib/sqlite3/2.4
mkdir -p C:/Ruby25-x64/lib/ruby/site_ruby/2.5.0/sqlite3/2.4
<--- lib/sqlite3/2.4
<--- lib/sqlite3
<--- lib
---> ext
---> ext/sqlite3
mkdir -p C:/Ruby25-x64/lib/ruby/site_ruby/2.5.0/x64-msvcrt/sqlite3
install sqlite3_native.so C:/Ruby25-x64/lib/ruby/site_ruby/2.5.0/x64-msvcrt/sqlite3
<--- ext/sqlite3
<--- ext
C:\Ruby25-x64\lib\ruby\gems\2.5.0\gems\sqlite3-1.3.13-x64-mingw32>
win10 安装mingw ruby rails的更多相关文章
- 转 CentOS下面安装RVM+ruby+Rails
CentOS6.2下面安装RVM+ruby+Rails (1)RVM官方网站应该是改版过一次, 使用 curl -L https://get.rvm.io | bash -s stable 下载并安装 ...
- 安装 Ruby, Rails 运行环境 常见的错误
安装部署ruby on rails 的环境时并不是想的那么顺利 这个是我遇到的问题及解决的方式 参考安装博客: (1) https://ruby-china.org/wiki/install_ruby ...
- Mac上安装与更新Ruby,Rails运行环境
Mac安装后就安装Xcode是个好主意,它将帮你安装好Unix环境需要的开发包,也可以独立安装command_line_tools_for_xcode 1.安装RVM RVM:Ruby Version ...
- Ruby(rails)win环境下安装
1.RubyInstaller 在RubyInstaller官网下载window版本安装,地址:http://rubyinstaller.org/downloads/ 执行安装程序,勾选Add Ru ...
- 如何快速正确的安装 Ruby, Rails 运行环境-b
对于新入门的开发者,如何安装 Ruby, Ruby Gems 和 Rails 的运行环境可能会是个问题,本页主要介绍如何用一条靠谱的路子快速安装 Ruby 开发环境.次安装方法同样适用于产品环境! 系 ...
- 怎样高速正确的安装 Ruby, Rails 执行环境
对于新入门的开发人员,怎样安装 Ruby, Ruby Gems 和 Rails 的执行环境可能会是个问题,本页主要介绍怎样用一条靠谱的路子高速安装 Ruby 开发环境. 次安装方法相同适用于产品环境! ...
- 如何快速正确的安装 Ruby, Rails 运行环境
如何快速正确的安装 Ruby, Rails 运行环境 https://ruby-china.org/wiki/install_ruby_guide 对于新入门的开发者,如何安装 Ruby, Ruby ...
- Mac 安装 Ruby, Rails 运行环境
对于新入门的开发者,如何安装 Ruby, Ruby Gems 和 Rails 的运行环境可能会是个问题,本页主要介绍如何用一条靠谱的路子快速安装 Ruby 开发环境. 次安装方法同样适用于产品环境! ...
- 安装 Ruby, Rails 运行环境
步骤1 - 安装 RVM RVM 是干什么的这里就不解释了,后面你将会慢慢搞明白. $ gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1 ...
随机推荐
- Android集成百度地图详细步骤和错误问题
先看要实现的效果 第一步, 下载SDK,基础配置,百度开发文档很详细,直接附上链接http://lbsyun.baidu.com/index.php?title=androidsdk/guide/cr ...
- 【BZOJ4566】找相同字符(后缀数组)
[BZOJ4566]找相同字符(后缀数组) 题面 BZOJ 题解 后缀数组的做法,应该不是很难想 首先看到两个不同的串,当然是接在一起求\(SA,height\) 那么,考虑一下暴力 在两个串各枚举一 ...
- 【BZOJ4530】大融合(Link-Cut Tree)
[BZOJ4530]大融合(Link-Cut Tree) 题面 讨厌权限题!!! Loj链接 题目描述 小强要在 N个孤立的星球上建立起一套通信系统.这套通信系统就是连接 N个点的一个树.这个树的边是 ...
- 【BZOJ3670】动物园(KMP算法)
[BZOJ3670]动物园(KMP算法) 题面 BZOJ 题解 神TM阅读理解题 看完题目之后 想暴力: 搞个倍增数组来跳\(next\) 每次暴跳\(next\) 复杂度\(O(Tnlogn)\) ...
- Bzoj2442:修剪草坪
Sol 一个很显然的暴力,设\(f[i]\)表示选到\(i\)的最优效率 每次枚举一段不与前面连续的长度小于\(k\)的区间转移来 # include <bits/stdc++.h> # ...
- [BZOJ1552] [Cerc2007] robotic sort (splay)
Description Input 输入共两行,第一行为一个整数N,N表示物品的个数,1<=N<=100000.第二行为N个用空格隔开的正整数,表示N个物品最初排列的编号. Output ...
- Windows下GO的开发环境配置
本文主要内容如下几点: 下载安装GO 配置多个工作区,第一个默认放第三方包,其他的放项目代码 包管理器godep的安装使用 安装过程中的一些坑(墙) vscode中使用go 1. 下载并安装go 官网 ...
- 使用MBROSTool 工具制作U盘多启动盘的方法总结
前段时间写了一个自用五合一多启动盘分享--分别用来维护娱乐,wifi密码破解,win&mac登陆密码绕过/清除,反馈的同学还是挺多,觉得大家都有这方面的需求,于是再把自己的使用经验总结一下. ...
- selenium webdriver 使用Chrome 浏览器
首先需要有ChromeDriver驱动来协助.ChromeDriver是实现WebDriver有线协议的一个单独的服务.ChromeDriver通过chrome的自动代理框架控制浏览器,ChromeD ...
- Java 8 中 ConcurrentHashMap工作原理的要点分析
简介: 本文主要介绍Java8中的并发容器ConcurrentHashMap的工作原理,和其它文章不同的是,本文重点分析了对不同线程的各类并发操作如get,put,remove之间是如何同步的,以及这 ...