【发布时间】:2013-06-15 22:00:58
【问题描述】:
(注意:我在 stackoverflow 上发现了同样的问题,但它并没有解决我的问题,所以我将提供更多信息。)
我设置了一个 RoR 环境。它包含 rvm、ruby、ruby on rails 和 bundler。一切似乎都是正确的。
我切换到包含 RoR 应用程序的文件夹并尝试重置数据库
katarina@katarina-VirtualBox:~/RubymineProjects/prototyp1$ rake db:reset
rake aborted!
cannot load such file -- bundler/setup
(See full trace by running task with --trace)
katarina@katarina-VirtualBox:~/RubymineProjects/prototyp1$
错误:“无法加载此类文件——捆绑器/设置” 另一方面,“bundle exec rake db:reset”按预期工作。
这里是我的环境值:
我。红宝石安装:
katarina@katarina-VirtualBox:~/RubymineProjects/prototyp1$ rvm 列表
rvm 红宝石
ruby-1.9.3-p194 [x86_64] =* ruby-1.9.3-p429 [ x86_64 ]
ruby-2.0.0-p195 [x86_64]
所以“ruby-1.9.3-p429”是我当前和默认的 ruby 版本。
二。二手宝石
katarina@katarina-VirtualBox:~/RubymineProjects/prototyp1$ rvm gemset 列表
ruby-1.9.3-p429 的宝石集(在 /home/katarina/.rvm/gems/ruby-1.9.3-p429)
(默认)
全局=> 原型1
所以我使用的是在当前 ruby 版本中创建的 prototyp1 gemset。
三。包含的宝石:
注意:$GEM_HOME 指向正确的 gemset,并且 gem 列表返回包含捆绑器的项目。
katarina@katarina-VirtualBox:~/RubymineProjects/prototyp1$ cd $GEM_HOME
katarina@katarina-VirtualBox:~/.rvm/gems/ruby-1.9.3-p429@prototyp1$ gem list
*** LOCAL GEMS ***
actionmailer (3.2.8)
actionpack (3.2.8)
activemodel (3.2.8)
activerecord (3.2.8)
activeresource (3.2.8)
activesupport (3.2.8)
addressable (2.3.4, 2.3.3)
arel (3.0.2)
bcrypt-ruby (3.0.1)
better_errors (0.9.0)
binding_of_caller (0.7.2)
bootstrap-sass (2.3.2.0)
builder (3.0.4, 3.0.3)
bundler (1.2.0)
cancan (1.6.10)
capybara (2.1.0)
chunky_png (1.2.6)
coderay (1.0.9)
coffee-rails (3.2.2)
coffee-script (2.2.0)
coffee-script-source (1.6.2, 1.4.0, 1.3.3)
compass (0.12.2)
cucumber (1.3.2)
cucumber-rails (1.3.1)
daemons (1.1.9)
database_cleaner (1.0.1)
debug_inspector (0.0.2)
devise (2.2.4)
diff-lcs (1.2.4, 1.1.3)
email_spec (1.4.0)
erubis (2.7.0)
eventmachine (1.0.3)
excon (0.16.10)
execjs (1.4.0)
factory_girl (4.2.0)
factory_girl_rails (4.2.1)
faraday (0.8.7)
figaro (0.6.4)
fssm (0.2.9)
gherkin (2.12.0)
hashie (2.0.5)
heroku (2.35.0)
heroku-api (0.3.8)
hike (1.2.3, 1.2.1)
httpauth (0.2.0)
hub (1.10.6)
i18n (0.6.4)
journey (1.0.4)
jquery-rails (3.0.1, 2.1.4, 2.1.2)
json (1.8.0, 1.7.5)
jwt (0.1.8)
launchy (2.3.0, 2.2.0)
libv8 (3.11.8.17 x86_64-linux, 3.3.10.4 x86_64-linux)
mail (2.4.4)
mime-types (1.23, 1.19)
mini_portile (0.5.0)
multi_json (1.7.7, 1.4.0, 1.3.6)
multipart-post (1.2.0)
netrc (0.7.7)
nokogiri (1.6.0, 1.5.5)
oauth (0.4.7)
oauth2 (0.8.1)
omniauth (1.1.4)
omniauth-facebook (1.4.1)
omniauth-linkedin (0.1.0)
omniauth-oauth (1.0.1)
omniauth-oauth2 (1.1.1)
omniauth-twitter (0.0.17)
orm_adapter (0.4.0)
pg (0.14.1)
polyglot (0.3.3)
quiet_assets (1.0.2)
rack (1.5.2, 1.4.5)
rack-cache (1.2)
rack-ssl (1.3.3, 1.3.2)
rack-test (0.6.2, 0.6.1)
rails (3.2.8)
railties (3.2.8)
rake (10.0.4, 10.0.2, 0.9.2.2)
rdoc (3.12.2, 3.12)
ref (1.0.5)
rest-client (1.6.7)
rolify (3.2.0)
rspec (2.11.0, 2.0.1)
rspec-core (2.13.1, 2.11.1, 2.0.1)
rspec-expectations (2.13.0, 2.11.3, 2.0.1)
rspec-mocks (2.13.1, 2.11.3, 2.11.2, 2.0.1)
rspec-rails (2.13.2, 2.11.0, 2.0.1)
rubygems-bundler (1.1.0)
rubyzip (0.9.9)
rvm (1.11.3.5)
sass (3.2.9, 3.2.3, 3.2.1)
sass-rails (3.2.6, 3.2.5)
simple_form (2.1.0)
sprockets (2.1.3)
sqlite3 (1.3.7, 1.3.6)
therubyracer (0.11.4, 0.10.2)
thin (1.5.1, 1.5.0)
thor (0.18.1, 0.16.0)
tilt (1.4.1, 1.3.3)
treetop (1.4.14, 1.4.12, 1.4.10)
tzinfo (0.3.37, 0.3.35, 0.3.33)
uglifier (2.1.1, 1.3.0)
warden (1.2.1)
webrat (0.7.1)
webrick (1.3.1)
xpath (2.0.0)
为什么在执行 rake 时出现错误? 它是执行 rake 任务的“老式”方式吗?建议执行“bundle exec ..”而不是“rake ...”?
提前谢谢你。 糖豆
【问题讨论】:
标签: ruby-on-rails ruby rake bundler