0

I'm new to Ruby on Rails and am having trouble setting up my first MySQL database.

I followed the instructions on here: https://gorails.com/setup/osx/10.12-sierra

And I reached the very end where it asks you to run "rake db:create". When I execute this in the terminal, I get the following error:

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) 

Can anyone advise on what is happening? I know that I have "cd"-ed into the correct directory, so that can't be it.

1
  • Do you have bundler gem installed? Commented May 13, 2017 at 18:02

3 Answers 3

1

Install bundler gem and run bundle install:

$ gem install bundler $ bundle install 

Now run rake again:

$ rake db:create 

If that doesn't work, then run the complete command:

$ bundle exec rake db:create 

To understand more about bundle command, check this question.

Sign up to request clarification or add additional context in comments.

6 Comments

I ran into an error on "bundle install" because it says it doesn't work with Ruby 2.0.0. The thing is, I've already installed 2.4.0. However: when I run "ruby -v" it says it's 2.0.0, but when I try to (re)install 2.4.0 it says: rbenv: /Users/myusername/.rbenv/versions/2.4.0 already exists
Rbenv. I tried to do RVM but ran into some errors that a noob like myself couldn't figure out.
@7QVM OK, try running rbenv global 2.4.0 to change your ruby version. Then run bundle install again (check first with ruby -v that your version changed successfully).
It doesn't seem to have had any effect: MacBook-Air-de-myusername% rbenv global 2.4.0 MacBook-Air-de-myusername% ruby -v ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16]
@7QVM Did you specified a RBENV_VERSION variable? If so, run echo $RBENV_VERSION to see which version it specifies; if it is 2.0.0 change it to 2.4.0.
|
0

Run:

gem install bundler bundle install bundle exec rake db:create 

Comments

0

I think you are in incorrect folder.

try cd splash

then run following command:

bundle install bundle exec rake db:create 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.