我是 Ruby on Rails 新手,在设置我的第一个 MySQL 数据库时遇到问题。
我按照此处的说明进行操作:https://gorails.com/setup/osx/10.12-sierra
我到达了最后,它要求您运行“rake db:create”。当我在终端中执行此操作时,出现以下错误:
MacBook-Air-de-myusername% rake db:create
rake aborted!
cannot load such file -- bundler/setup
/Users/myusername/splash/config/boot.rb:3:in `<top (required)>'
/Users/myusername/splash/config/application.rb:1:in `require_relative'
/Users/myusername/splash/config/application.rb:1:in `<top (required)>'
/Users/myusername/splash/Rakefile:4:in `require_relative'
/Users/myusername/splash/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)
任何人都可以告诉我们发生了什么吗?我知道我已经“cd”进入了正确的目录,所以不可能是这样。
最佳答案
安装bundler gem并运行bundle install
:
$ gem install bundler
$ bundle install
现在再次运行rake
:
$ rake db:create
如果这不起作用,请运行完整的命令:
$ bundle exec rake db:create
要了解有关 bundle
命令的更多信息,请查看 this question .
关于mysql - 为 RoR 设置 MySQL 数据库时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43956312/