RuntimeError (!!! Missing the mysql2 gem. Add it to your Gemfile: gem ‘mysql2′):

在Rails3 出现这个错误,做以下工作:

1. 在Gemfile

gem 'mysql2', '~> 0.2.6'

2.

 bundle update

3. 在datababse.yml

development:
  adapter: mysql2
  encoding: utf8
  database: devise
  # pool: 5
  username: root
  password:
  reconnect: true
  socket: /tmp/mysql.sock

参考: http://stackoverflow.com/questions/4297253/install-mysql2-gem-on-snow-leopard-for-rails-3-with-rvm

If you enjoyed this post, make sure you subscribe to my RSS feed!

【数据集实例】CMIP6气候模式数据下载-以河东地区为例 以河东地区为例,介绍CMIP6数据下载及处理 阅读详情

相关推荐

稀疏数据分析:马蹄估计量及其理论性质

稀疏数据分析:马蹄估计量及其理论性质基本框架half-Cauchy分布为什么它叫马蹄估计量后验均值、shrinkage与κ\kappaκθ\thetaθ的边缘先验分布的阶马蹄估计的一致性收敛速率Clarke-Barron(1990)引理马蹄估计的最优收敛速率 这是对The horseshoe estimator for sparse signal这篇论文的回顾,这篇论文在Modern Bayesian statistics与Bayesian Machine Learning领域比较重要,它提出了一种新的先验

一个不愿透露姓名的博客 3797

rails4 mysql2_Rails 4 - Gem :: LoadError:为数据库适配器指定'mysql2',但未加载gem

在我的gemfile中我有:gem 'mysql2'我的database.yml如下:default: &defaultadapter: mysql2database: username: password: host: pool: 32socket: development:<production:<我运行了bundle update和bundle clean -...

weixin_32809369的博客 305

别再只会按按钮了!用NanoStat开源项目学ESP32硬件设计:BOOT与自动下载电路的避坑指南

本文通过NanoStat开源项目深入解析ESP32硬件设计中BOOT与自动下载电路的关键技术。从启动机制、电路设计陷阱到三极管选型,提供了一套完整的避坑指南和优化方案,帮助开发者提升设计可靠性和烧录效率。特别适合中级开发者学习ESP32硬件设计的精髓。

weixin_30296405的博客 439

Rails 4 - Gem::LoadError: Specified 'mysql2' for database adapter, but the gem is not loaded

Rails 4 - Gem::LoadError: Specified 'mysql2' for database adapter, but the gem is not loaded Gemfile : # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails',

Xunzi229的博客 2491

SAP入门技术分享四:模块化程序

SAP入门技术分享三:模块化程序

ITxiaoangzai的博客 1152

DDR3性能优化实战:如何用Xilinx MIG控制器实现800MHz稳定读写(7系列FPGA版)

本文深入探讨了在Xilinx 7系列FPGA上使用MIG控制器实现DDR3存储器800MHz稳定高速读写的实战优化技巧。文章聚焦于高级时序调优、Bank Machine调度策略、用户接口设计优化以及利用ILA进行信号完整性调试,旨在帮助工程师突破性能瓶颈,实现接近理论峰值的稳定带宽,并为进一步冲刺更高频率提供进阶调参指南。

seed的博客 775

mysql bundle 安装_执行Bundle安装时MySql出错

当我执行Bundle Install时,出现以下错误:Installing mysql2 (0.3.10) with native extensionsGem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension./Users/manish/.rvm/rubies/ruby-1.9.2-p290/b...

weixin_39602108的博客 327

Python爬虫-汽车之家各车系月销量榜数据

本文是该专栏的第41篇,后面会持续分享python爬虫干货知识。本文以某汽车平台为例,基于python采集该平台“各车系月销量”的榜单数据。具体实现思路和详细逻辑,笔者将在正文结合完整代码进行详细介绍。接下来,跟着笔者直接往下看正文详细内容。(附带完整代码)

Python进阶专栏《爬虫实战进阶》,《Pyppeteer从入门到精通》原创作者 1619

Gitlab之设定数据库-yellowcong

说实话,Gitlab的数据库配置还是挺复杂的,需要修改的配置文件也挺多的,主要有如下步骤:1、创建数据库。2、在/etc/gitlab/gitlab.rb文件中,添加数据库的配置,3、给gitlab安装mysql的依赖。4、执行gitlab-rake gitlab:check检查配置文件,这个地方错误比较的多,5、没有错误后,重启服务器,设置管理员密码。 1、创建数据库 #创建...

1万+

AI 实战篇 |基于 AI开放平台实现 人脸识别对比 功能,超详细教程【附带源码】

本篇文章来学习一下怎样使用 Unity实现简单地人脸识别 功能。 关于人脸识别,我们可以选择很多平台的SDK接入Unity来实现人脸识别的功能。

努力前行,总会成为自己心中的那道光 5万+

用群辉NAS打造影视墙(Jellyfin篇)

之前的文章提到过,用群辉NAS组建影视播放系统可以采用官方提供的Video Station套件,不过影视信息配比较差,响应速度也欠佳,今天我们就聊聊别的套件。在影音媒体方面,常见的还有Emby、Plex、Jellyfin。本文主讲Jellfin的原因是它胜在免费,而且功能比较齐全,完全够用。详细信息可以参考Jellyfin的官网:https://jellyfin.org/

dgnankai的专栏 7323

runtime mysql_RuntimeError with mysql2 and rails3 (bundler)

可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):问题:I get this error `establish_connection': Please install the mysql2 adapter: `gem install activerecord-mysql2-adapter` (no such file to load -- activ...

weixin_39682940的博客 182

GEE:大面积研究区域数据分块导出,以解决内存限制和导出失败的问题

本文介绍了在Google Earth Engine (GEE)平台分块导出大面积研究区域数据的方法。针对直接导出大区域影像易失败的问题,作者提出通过网格分块技术进行处理。文章展示了完整的JavaScript代码示例,包含定义研究区域、加载ESA WorldCover数据集、设置分块参数(包括像素大小、分块尺寸)、创建网格系统、处理坐标转换等关键步骤。代码中还提供了错误处理和导出按钮功能,确保数据能可靠地分块导出到Google Drive。该方法有效解决了大区域数据导出时的内存限制问题,适用于全球范围的研究。

养乐多的博客 1186

rails db:create错误

今天用rails连接mysql后,rake db:create出现这个错误 Couldn't create database for {"adapter"=>"mysql2", "encoding"=>"utf8", "pool"=>5, "username"=>"root", "password"=>nil, "socket"=>"/var/run/mysq...

weixin_30417487的博客 303

迈瑞BS系列全自动生化分析仪LIS协议接口手册(内含HL7和ASTM)

迈瑞BS系列全自动生化分析仪LIS协议接口手册,内含HL7和ASTM)

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

centos下gitlab安装过程和问题

转朋友的文章:http://www.sunhaojie.com/2015/10/29/centos%E4%B8%8Bgitlab%E5%AE%89%E8%A3%85%E8%BF%87%E7%A8%8B%E5%92%8C%E9%97%AE%E9%A2%98/ 因为团队需要,准备在阿里云的服务器上安装一套gitlab管理代码。安装之前服务器上面已经运行了几个php和java的网站,使用ngi

Xuebing's Blog 1147

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

笔记:gitlab-ce 替换(2)

笔记二以gitlab的9.4.3版本为例子 [toc]1、nginx/apache 替换 gitlab-nginx 修改 /etc/gitlab/gitlab.rb: nginx['enable'] = false## 填写用户, ## nginx:nginx.conf 里查看 user(默认是 www www) ## apache:httpd.conf 里查看 User与Group (默认是 d

stone 2791

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

gem install mysql2 失败的解决方法

gem install mysql2 失败的解决方法 sudo apt-get install libmysql-ruby libmysqlclient-dev   gem install  mysql2

TRAMP~ 1098

Add `gem 'sqlite3'` to your Gemfile

错误:Specified 'sqlite3' for database adapter, but the gem is not loaded. Add `gem 'sqlite3'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord). (Gem::L...

weixin_30411997的博客 285

gem安装mysql2_无法安装mysql2 gem

我无法在Windows7 x64系统中安装mysql2 gem。我尝试使用32位和64位版本的MySQL服务器,但没有一个让我更进一步。我安装了Ruby 1.8,开发工具包和Rails平台。我什至安装了minGW来允许事物的C ++ / C编译。MySQL Server已安装在默认位置。运行命令时:C:\Users\Arne>gem install mysql2 -- --with-mysq...

weixin_36259655的博客 686

Windows下运行Jekyll及安装错误

昨天想利用Jekyll搭建github page,折腾了很久才搞定。 主要步骤也是参考Jekyll中文官网里的文档,但是其中有个环节出错了,那就是使用gem安装Bundler的时候,提示Error fetching https://rubygems.org/ 百度后找到原因,这里引用一下地址,步骤如下: gem source -l检查当前的SOURCES列表 然后从中移除失效的地址gem so...

weixin_30511107的博客 220

LInux 安装 mysql2 gem失败

通过gem安装mysql2显示 Building native extensions. This could take a while... ERROR: Error installing mysql2: ERROR: Failed to build gem native extension. current directory: /var/lib/gems/2.3.0/gems

@steveyg 2981

安装redis3.2集群出现的一些问题及解决方法

redis集群配置,也有一些野路子配置集群的,在网上看到,试过了,也可以用,但是在删除和增加节点时不是那么灵活。 官方文档上推荐使用ruby,而且redis3.2里面内置了redis-trib.rb文件,所以在centOS上面安装ruby就可以了。 可是,我是纠结了一下午才搞定了ruby的运行环境,可能是我安装的centos太纯净了,有些依赖包没有找到的问题。

shinebar的专栏 1万+

mysql2 0.3.16.gem_安装mysql2时出错:无法构建gem原生扩展

这是 windows users 的解决方案,希望有所帮助!在Windows上使用MySQL和Rails 3Install railsinstaller - > www.railsinstaller.org(我将它安装到c:\ Rails)Install MySQL (我使用MySQL 5.5) - > dev.mysql.com/downloads/installer/---用于...

weixin_39940344的博客 164

Gemfile配置错误

最近这里几天一直搞Jekyll 一直踩坑jekyll搭建,今天从从ithub 上下载一个新的主题。本地环境运行 jekyll报错,这里在此记录下来希望帮助到以后遇到此问题到小伙伴。 /usr/local/Cellar/ruby/2.6.5/lib/ruby/2.6.0/bundler/runtime.rb: 319:in `check_for_activated_spec!': You hav...

rui888的博客 2398

mysql出错2_【gem安装】mysql2错误

错误信息Gem::Ext::BuildError:ERROR:Failedtobuildgemnativeextension./home/jaylin/.rvm/rubies/ruby-2.2.1/bin/ruby-r./siteconf20150423-6190-1ocfncu.rbextconf.rbcheckingforruby/thread.h...yeschec...

weixin_36227730的博客 465
上一篇: 在Linux里设置环境变量的方法(export PATH)
下一篇: rails文件上传插件 acts_as_attachment 的实例
xinlanzero
博客等级 码龄25年 10粉丝 132原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值