【说明:资料来自http://blog.csdn.net/lihuan974683978/article/details/8715414

之前一直没弄明白rake  db:migrate 与 bundle exec rake db:migrate有区别,用的过程中也没出意外。最近无意中弄明白了现在也说下吧:

rake db:migrate 其实 rake 本身是就是一个gem; 所以你可能有多个项目,用到了相同的gem,但版本不同。哪怎么确定每个项目使用的是哪个版本呢?

哪就要用到 bundle 了。

哪么bundle 是什么呢?

bundle其实是一种管理 项目中gems的工具。每个项目所要使用的gem版本信息都在Gemfile文件中有体现。但如果你直接使用rake 命令时,默认是使用系统中最新的rake 而不是项目中使用的版本,这样就可能会出错。哪执行 bundle exec 这个命令就会去寻找项目中的版 本来使用。

rake db:migrate 与 bundle exec rake db:migrate 的区别(copy)的更多相关文章

  1. rake aborted! You have already activated rake 10.1.0, but your Gemfile requires rake 10.0.3. Using bundle exec may solve this.

    问题: wyy@wyy:~/moumentei-master$ rake db:createrake aborted!You have already activated rake 10.1.0, b ...

  2. java.util.MissingResourceException: Can't find resource for bundle oracle.sysman.db.rsc.LoginResourc

    http://blog.itpub.net/197458/viewspace-1055358/   oracle 10.2.0.4 windows 2003 X64 平台 系统安装EMCA正常.第一次 ...

  3. Mongo DB Study: first face with mongo DB

    Mongo DB Study: first face with mongo DB 1.  study methods: 1.  Translate: I am the mongo DB organiz ...

  4. Rails 4.0 bundle exec rspec spec/requests/xxx 测试失败的解决

    rails项目没有使用默认的单元测试包,而是使用了rspec-rails来测试. 按照文档说明首先生成对应的测试文件: rails generate integration_test xxx invo ...

  5. Redis 配置连接池,redisTemplate 操作多个db数据库,切换多个db,解决JedisConnectionFactory的设置连接方法过时问题。(转)

    环境 springmvc jdk1.8 maven redis.properties配置文件 #redis setting redis.host=localhost redis.port=6379 r ...

  6. 正则表达式中的exec和match方法的区别

    正则表达式中的exec和match方法的区别 字符串的正则方法有:match().replace().search().split() 正则对象的方法有:exec().test() 1.match m ...

  7. Rails--bundle exec rake db:migrate

    --新建表: def up create_table :[TABLE_NAME] do |t| t.column :[NUM], :integer t.column :[NAME], :string ...

  8. 浅析数据库(DB)、操作数据存储(ODS)和数据仓库(DW)的区别与联系

    文章背景: 相信大部分刚接触上面三个概念的同学,都多多少少会有些迷惑,现在我就给大家简单分析下这三者的关系,希望大家对这三者的概念理解有所帮助吧. 本文主要从下面两类关系来叙述上面三者的关系: 数据库 ...

  9. sql存储过程exec执行字符串select 的区别

    USE [GuangHong]GO/****** Object: StoredProcedure [dbo].[st_MES_SelInspctDetail] Script Date: 11/23/2 ...

随机推荐

  1. PHP统计目录中文件个数和文件大小

    <meta charset="utf-8"><?php $dirn = 0; //目录数 $filen = 0; //文件数 //用来统计一个目录下的文件和目录的 ...

  2. hdu4405:Aeroplane chess

    题目大意:有编号为0-n的格子,从0开始,扔骰子扔到几就走几格.有m个瞬移点,每个点可以从格x直接飞到格y,若瞬移到另一个瞬移点可以继续瞬移.求到达格n的期望扔骰子次数. 题解:期望DP入门好题.网上 ...

  3. springmvc和dubbo整合时,不配置spring listener报错找不到/WEB-INF/config/applicationContext.xml

    原因,dubbo2.6.3版本开始就需要先在listener中配置容器,否则报错,2.6.2版本则不需要

  4. windows 下安装Apache httpd 只需三步

    1.下载 Apache 官网地址:http://httpd.apache.org/docs/current/platform/windows.html#down 找到这个, 看到这几个选项: Apac ...

  5. POJ 2135 最小费用最大流 入门题

    Farm Tour Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 19207   Accepted: 7441 Descri ...

  6. Jquery操作事件

    1.文档加载事件 2.DOM单击双击事件 3.DOM获得焦点,失去焦点问题 4.DOM鼠标移入,移出事件 <!DOCTYPE html> <html> <head> ...

  7. 每日一个linux命令(1)

    ls命令: 1.        ls -l -R /home/文件夹   列出/home/文件夹下所有文件和目录的详细资料 2.        ls -l t*                     ...

  8. sublime text 3注册码

    —– BEGIN LICENSE —– Michael Barnes Single User License EA7E-821385 8A353C41 872A0D5C DF9B2950 AFF6F6 ...

  9. centos、mac的grafana安装和简单使用

    1.安装: 参考官方文档安装说明:https://grafana.com/grafana/download Redhat & Centos(64 Bit): wget https://s3-u ...

  10. [Node.js] Write or Append to a File in Node.js with fs.writeFile and fs.writeFileSync

    In node.js, you can require fs, and then call fs.writeFile with the filename, and data to write to t ...