Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ruby-on-rails-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 3 rake db:种子问题_Ruby On Rails 3_Rake - Fatal编程技术网

Ruby on rails 3 rake db:种子问题

Ruby on rails 3 rake db:种子问题,ruby-on-rails-3,rake,Ruby On Rails 3,Rake,当我运行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

当我运行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。

运行
捆绑安装
。这将解决问题。

您需要在gemfile中使用rails,然后运行bundle安装

gem "rails", 'version'

现在运行
bundle install

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

$ bundle exec rake db:seed

要在捆绑包的上下文中运行
rake

您是否尝试过运行
捆绑包安装
?我已经尝试过了,并且似乎成功地通过了(我获得了“使用activeresource 3.0.3”的输出)。但似乎什么都没有改变。不,没有帮助。。。它确实成功地安装了bundle,输出了“使用activeresource(3.0.3)”,然后当我尝试运行rake db:seed时,同样的问题也发生了。$bundle exec rake db:seed在任何源中都找不到activesupport-3.0.3运行
bundle install
来安装缺少的gems。这个问题仍然存在。我不知道为什么!在完成捆绑包安装后,我看到输出“使用activeresource(3.0.3)”。
activeresource
不是
activesupport
——它们都是在您安装捆绑包时列出的吗?