I'm trying to work through this tutorial by Andrew Perkins. When I get to rake db:migrate I get this error and similar subsequent errors every time I install the missing gems.
Could not find rake-0.9.2.2 in any of the sources
Run bundle install to install missing gems.
I've run the bundle install but not sure I've installed properly or with all the right dependencies. I'm pretty new to Rails so don't have a great idea as to where I'm going wrong so any examples of proper installation would be very helpful.
Try
bundle exec rake db:migrate
this ensures that the rake command run is the one specified in your project's Gemfile. You can read more about bundle exec in the docs.
Related
I am in process of installing Redmine app via RedmineInstall documentation I try step 5 :
bundle exec rake db:migrate
then error shows :
bundler: command not found: rake
Install missing gem executables with ´bundle install´
I use redmine 3.3.0 64 for windows
I use redmine gemfile and rake was installed (i see Using rake 11.2.2)
I tried reinstall it via bundle install or gem install/uninstall, but did not help (see Successfully installed rake-11.2.2 but rake do not work).
I tried this command from ruby/bin directory or redmine directory not success.
I do not understand, that rake is successfully installed, but when i try use it with bundle it says that command not found.
The problem may be in the directory where the Redmine or rake?
Try rake db:migrate in your redmine directory without bundle exec and see if that resolves your issue.
Bundler usually provides bin stubs for rake and other gem files, so that bundle exec is not necessary or will even fail because it will look in an other gem directory where, in this case, rake might not be installed.
When I do rake db:migrate, I get the following error:
rake aborted!
Gem::LoadError: You have already activated rake 10.2.2, but your Gemfile requires rake 10.1.0. Using bundle exec may solve this.
How can solve this?
This error is due to the fact that some applications may specify different versions of gems than the ones you have installed.
Try using bundle exec rake db:migrate.
Using bundle exec guarantees that the program is run with the environment specified in the gemfile.
Perhaps:
bundle exec rake db:migrate
There might be other gems in the Gemfile which are dependent on rake 10.2.2, while you are trying to install rake 10.1.0 via your gemfile or explicitly mentioned it. A look into your Gemfile will help.
In case you have specific environment, you may want to run
bundle exec rake db:migrate
to make sure you are running it appropriately.
As per another answer given on this topic, you can also try deleting the Gemfile.lock file and re-running bundle install to regenerate the Gem dependencies.
guys! I am a newbie for Ruby on Rails and refinerycms.
Currently, I am study the refinerycms. I want to find all the missing key so as to translate refinerycms. According to the tutorial, I should run the command
bundle exec rake refinery:testing:dummy_app
so as to enable additional useful rake tasks. But when I run this command, it says
rake aborted!
Don't know how to build task 'refinery_testing:dummy_app'
Does any one know the reason?
BTW, I have already added the gem "refinerycms-testing" to Gemfile and installed it already, and I also in the root directory of the project.
I think your problem is that you are not in the good directory.
cd vendor/extension/your_extension_name
bundle exec rake refinery:testing:dummy_app
Hope it helps,
-frbl
I am using Ruby Enterprise Edition for my project. When I check all my rake task by run the command rake -T , I got the following error message:
You have already activated rake 0.9.2.2, but your Gemfile requires rake 0.9.2. Using bundle exec may solve this.
The error message implies that I can use bundle exec to solve the problem, but I am not sure how? So, how to get rid of this error message?
------------------------------ more ---------------------------
I prefer to update my Gemfile instead of run bundle exec rake -T. But when I open my project Gemfile, I did not see rake 0.9.2 in my Gemfile, why the error message complains that I have it? Where could be the place I defined rake 0.9.2??
Run bundle exec rake -T, this ensures that the version of rake that is specified in your Gemfile is running, not another version.
Alternatively, update your Gemfile.
This is because your rake tool does not match the version written in the Gemfile.
You first need to run this command, to ensure rake 0.9.2 get installed:
bundle install
Then, you can run rake 0.9.2 with the following command:
bundle exec rake -T
The bundle thing is a nice tool to help you manage the dependency of your application. You can get more info from here.
I just cloned a github repo on a fresh Ubuntu machine, running sqlite3 for all environments. rake db:create says development.sqlite3 already exists. rake db:migrate says I'm missing a bunch of required gems and should run rake gems:install. rake gems:install, of course, says it Could not find table 'studies', which sounds to me like something rake db:migrate should fix.
I looked around the net and while lots of people have gotten 'could not find table' errors, they all got them from rake db:migrate, not rake gems:install. I'm suspecting it's an application-specific error, but still, any ideas would be appreciated.
PS: Ruby 1.8.7, Rails 2.3.8.
You can always install separate gems with gem install -r <gem name> or gem install -v=<gem version> -r <gem name> command, not using rake.
Is this a Rails 3 app? If so, you should run:
bundle install
Rails 3 uses Bundler instead of the rake tasks to manage gems. http://gembundler.com/
Did you try running with the trace option? Might help pin down the failing gem:
rake -t gems:install