【问题标题】:rake db:seed issuerake db:种子问题
【发布时间】:2011-08-16 09:26:01
【问题描述】:

当我运行 rake db:seed 或 rake db:migrate: 时,我在这里看到了一个奇怪的问题:

user@ubuntu:~/Desktop/staging/config$ bundle show activeresource
/usr/lib/ruby/gems/1.8/gems/activeresource-3.0.3
user@ubuntu:~/Desktop/staging/config$ rake db:seed
(in /home/rohan/Desktop/staging)
Could not find activesupport-3.0.3 in any of the sources
Try running `bundle install`.
user@ubuntu:~/Desktop/staging/config$ ruby --version
ruby 1.9.2p180 (2011-02-18 revision 30909) [i686-linux]

我不知道该怎么办。任何帮助,将不胜感激。作为记录,我使用的是 RVM。

【问题讨论】:

  • 你试过运行bundle install吗?
  • 我试过了,是的,它似乎成功通过(我得到输出“使用 activeresource 3.0.3”)。但似乎并没有真正改变。

标签: ruby-on-rails-3 rake


【解决方案1】:

运行bundle install。这将解决问题。

【讨论】:

  • 不,没有帮助......它确实捆绑安装成功,输出“使用 activeresource (3.0.3)”然后当我尝试运行 rake db:seed 时,会发生同样的问题。跨度>
【解决方案2】:

你需要在 gemfile 中引入 rails 然后运行 ​​bundle install。

gem "rails", 'version'

现在运行bundle install

【讨论】:

    【解决方案3】:

    假设您尝试按照要求运行bundle install,您可能只需要使用:

    $ bundle exec rake db:seed
    

    在包的上下文中运行rake

    【讨论】:

    • $ bundle exec rake db:seed 无法在任何源中找到 activesupport-3.0.3 运行 bundle install 以安装缺少的 gem。这个问题仍然存在。我不知道为什么!完成捆绑安装后,我看到输出“Using activeresource (3.0.3)”。
    • activeresource 不是 activesupport - 当你 bundle install 时它们都列出了吗?
    猜你喜欢
    • 2016-06-05
    • 1970-01-01
    • 1970-01-01
    • 2011-02-05
    • 2013-09-07
    • 2014-02-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多