Rails 3 migration error - ruby

I am new to Ruby and Rails, and whenever I attempt to generate my database using rake db:migrate I get the following error:
rake aborted!
You have already activated rake 0.9.3.beta.1, but your Gemfile requires rake 0.9.2. Consider using bundle exec.
I am using Ruby 1.9.2 and Rails 3.

Consider using bundle exec.
There's your clue. Try this instead:
bundle exec rake db:migrate

Related

rake neo4j:install[community-latest] - The `neo4j-rake_tasks` gem is no longer a dependency of the `neo4j-core` gem

I am following this instruction, "Getting Started with Neo4j and Ruby", https://neo4j.com/developer/ruby-course/.
Here is how you would setup your asset portal Rails app:
rails new asset_portal -m http://neo4jrb.io/neo4j/neo4j.rb -O
cd asset_portal
rake neo4j:install[community-latest]
rake neo4j:start
But after I run
rake neo4j:install[community-latest]
I got this note
The `neo4j-rake_tasks` gem is no longer a dependency of the `neo4j-core` gem.
If you would like to use the rake tasks, you will need to explicitly include the `neo4j-rake_tasks` gem in your project.
Please note that the `neo4j-rake_tasks` gem is only for development and test environments (NOT for production).
Be sure to require the `neo4j-rake_tasks` gem AFTER the `neo4j-core` and `neo4j` gems.
For more details see the Neo4j.rb documentation
What can I do now to make this statement, rake neo4j:install[community-latest], work?
Thanks!
only add the flowing snippet
gem 'neo4j-rake_tasks'
bundle install
Hopefully would solve your problem.
I need to add the following lines to GemFile
gem 'neo4j-core'
gem 'neo4j-rake_tasks'
And then run the commands
bundle install
rake neo4j:install[community-latest]
rake neo4j:start

Error while doing rake db:setup in Grape APi sample code

Here is the error on typing rake db:setup
git://github.com/leftbee/em-postgresql-adapter.git (at master) is not checked out. Please run `bundle install`
So i tried to run bundle install but after that still getting this error.
I'm following this getting started post
https://github.com/djones/grape-goliath-example
Try bundle exec rake db:setup instead.

Rake aborted ! Issue installing Octopress

I m trying to install the Octopress on my windows. As per their Tutorial on their website. But when I type the command
rake install
It gives me the following error
C:\Documents and Settings\admin\octopress>rake install
rake aborted!
You have already activated rake 0.9.2.2, but your Gemfile requires rake 0.9.2. U
sing bundle exec may solve this.
(See full trace by running task with --trace)
And as the error says I need to install rake 0.9.2
I tried it doing with the following command.
C:\Documents and Settings\admin\octopress>gem install rack -v=0.9.2.0
ERROR: Could not find a valid gem 'rack' (= 0.9.2.0) in any repository
ERROR: Possible alternatives: rack
I already have Ruby & Gems installed on my PC. But I m not able to figure out how to solve this issue. How do I even use the "bundle exec" to install Octopress ?
You probably need to use the bundle exec in this way
bundle exec rake install
This might just solve you problem.
I solve this with bundle update
it's a dependency problem and not big deal
The first time you spelled it rake and the second time you spelled it rack
First update the documentation to say,
bundle exec rake install
Then update the Gemfile.lock with,
bundle update

Arel Deprecation Warning when running rake db:create

I'm trying to create an app in Rails 3.1 with mysql2 v 0.2.6. When running rake db:create, I get the following error:
DEPRECATION WARNING: Arel::Visitors::VISITORS is deprecated and will be removed.
Database adatpers should define a visitor_for method which returns the appropriate
visitor for the database. For example, MysqlAdapter.visitor_for(pool) returns
Arel::Visitors::MySQL.new(pool). (called from mon_synchronize at
c:/Ruby192/lib/ruby/1.9.1/monitor.rb:201)
I can access the MySQL monitor, so the gem appears to be installed correctly. What else could be going on here?
Thanks!
Try updating your msql gem.
In ./Gemfile
gem require 'mysql2', '~> 0.3.6'
bundle update mysql2
use the below specified version in gemfile.
gem 'mysql2', '~>0.3.10'
then run
bundle install

RVM, Merb, Rake and RSpec

I am currently running ruby-1.9.1 installed via RVM. I have been looking at using Merb, but when I try and run it I get this error:
sam#shiny-dev:~/Projects/mojo$ rake db:migrate
(in /home/sam/Projects/mojo)
Merb root at: /home/sam/Projects/mojo
/home/sam/.rvm/gems/ruby-1.9.1-p378#merb/gems/dm-validations-1.0.0/lib/dm-validations.rb:33: warning: already initialized constant OrderedHash
Loading init file from ./config/init.rb
Loading ./config/environments/development.rb
rake aborted!
no such file to load -- spec/rake/spectask
/home/sam/Projects/mojo/Rakefile:24:in `require'
(See full trace by running task with --trace)
I have installed rspec, but even in IRB I cannot require 'spec/rake/spectask' unless I also install rspec-rails (which I have now done).
Any ideas where I could even start?
Cheers,
Sam
I had the same problem with this on Rails 2.3.5. I ended up having to uninstall RSpec 2.0 and install RSpec 1.3.0 instead.
After 2 weeks I finally figured it out!
Edit your Gemfile and add the line:
gem "rspec", :require => "spec"
and you're away!

Resources