Rails rake db:create load error - ruby-on-rails

I am trying to install project fedena. I have installed ruby on rails by following this link. when I run rake db:create command, it is throwing following error:
rameshpaul#rameshpaul-hp:~/ruby_projects/fedena$ rake db:create
/home/rameshpaul/.rbenv/versions/2.2.1/bin/rake:23:in `load': cannot load such file -- /home/rameshpaul/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/rake-10.4.2/bin/rake (LoadError)
from /home/rameshpaul/.rbenv/versions/2.2.1/bin/rake:23:in `<main>'
rameshpaul#rameshpaul-hp:~/ruby_projects/fedena$

Run Bundle install and then create the db as Rake generater is missing.

You have to downgrade ruby version to 1.8.7 to use fedena

Related

Migrating database fails after upgrading to Ruby 2.3.0

I've updated to Ruby 2.3.0 and I'm having some issues when creating a new Rails app. After creating a simple new test app and scaffolding a resource, when trying to execute rake db:migrate I'm getting the following load error:
MacBook-Pro:log medright1$ rake db:migrate
/Users/medright1/.rvm/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/rake-10.4.2/bin/rake:31:in `require': cannot load such file -- rake (LoadError)
from /Users/medright1/.rvm/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/rake-10.4.2/bin/rake:31:in `<top (required)>'
from /Users/medright1/.rvm/gems/ruby-2.3.0/bin/rake:23:in `load'
from /Users/medright1/.rvm/gems/ruby-2.3.0/bin/rake:23:in `<main>'
from /Users/medright1/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `eval'
from /Users/medright1/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `<main>'
MacBook-Pro:log medright1$
Any help sorting this would be great!
If you haven't done it yet, make sure you have all the dependencies installed.
$ bundle
or
$ bundle install
It's likely you don't have rake installed in the global RVM gemset. In any case, given you are within a Rails project, you should use bundler to execute the command.
$ bundle exec rake db:migrate
Otherwise, make sure to install rake globally
$ rvm gemset use global
$ gem install rake
However, the correct way is to execute the command via Bundler.

rake assets:precompile error message: No such file or directory -- ruby

I'm following along to the excellent Michael Hartl Rails book (Rails 3.2) but am getting an error when attempting to run the command:
rake assets:precompile
The error is as follows:
/Users/Jamie/.rvm/rubies/ruby-1.9.3-p448/bin/ruby ruby /Users/Jamie/.rvm/gems/ruby-1.9.3-p448#movies/bin/rake assets:precompile assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
/Users/Jamie/.rvm/rubies/ruby-1.9.3-p448/bin/ruby: No such file or directory -- ruby /Users/Jamie/.rvm/gems/ruby-1.9.3-p448#movies/bin/rake assets:precompile (LoadError)
rake aborted!
Command failed with status (1): [/Users/Jamie/.rvm/rubies/ruby-1.9.3-p448/b...]
/Users/Jamie/.rvm/gems/ruby-1.9.3-p448#movies/gems/actionpack- 3.2.14/lib/sprockets/assets.rake:12:in `ruby_rake_task'
/Users/Jamie/.rvm/gems/ruby-1.9.3-p448#movies/gems/actionpack-3.2.14/lib/sprockets/assets.rake:21:in `invoke_or_reboot_rake_task'
/Users/Jamie/.rvm/gems/ruby-1.9.3-p448#movies/gems/actionpack-3.2.14/lib/sprockets/assets.rake:29:in `block (2 levels) in <top (required)>'
/Users/Jamie/.rvm/gems/ruby-1.9.3-p448#movies/bin/ruby_executable_hooks:14:in `eval'
/Users/Jamie/.rvm/gems/ruby-1.9.3-p448#movies/bin/ruby_executable_hooks:14:in `<main>'
Tasks: TOP => assets:precompile
Thanks for your help!
I fixed this by reverting back from p448 to p392 and then running:
rvm ruby-1.9.3-p392#global do gem install executable-hooks
as suggested by mpapis here: Rake assets:precompile cannot find ruby
I was trying to run the rake command within ubuntu and was getting ruby_executable_hooks error. I resolved it with:
rvm all do gem install executable-hooks
This seems to be an issue with 1.9.3-p448. Today I updated ruby from p392 to p448 on my server and started getting this error. I reverted back to p392 and precompilation of assets is working again.
Perhaps try installing a version before p448 and try again.
After working with this a bit more, I found that emptying and reinstalling my gems caused precompilation to start working again:
$ rvm gemset empty
$ bundle install
$ rake assets:precompile RAILS_ENV=production

Rake aborted! uninitialized constant knowit

I am standing up a new Ubuntu server running MySQL. I have Capistrano set up on my development server and am trying to deploy:cold after running deploy:setup. After the deploy script tries to run
executing "cd /home/adm1n/www/knowit/releases/20121112152400 && bundle exec rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile"
I keep getting this message:
Rake Aborted!
uninitialized constant knowit
Tasks: TOP => environment
Any idea where this constant would be defined? This project is almost entirely new (rails new app Blah). Any suggestions on how I should attempt to troubleshoot this? Thx.
I'm running:
Rake 0.9.2.2
Ruby 1.9.3p194
Capistrano 2.13.5
Bundler 1.1.5
Rails 3.2.8
rvm 1.15.7
UPDATE: knowit is the name of my app. So there apparently there is something not initializing. Not sure where how to troubleshoot this.
UPDATE: Here is my routes.rb file (very basic)
Knowit::Application.routes.draw do
match ':controller(/:action(/:id))(.:format)'
end

Rake aborts in Rails 3.2.8

I had create a empty new rails project with a scaffold successfully but when I try rake db:create, it throws me an error: rake aborted! uninitialized constant Rake::DSL.
As other SO post mentioned, I tried setting my Gemfile to gem 'rake', '0.8.7', but rake gives me another error:
You have requested: rake = 0.8.7
The bundle currently has rake locked at 0.9.2.2. Try running bundle
update rake Run bundle install to install missing gems.
Then I did as the message said and update rake and bundle install. Same error.
It is nice and easy experience to develop a project a rails but it is a nightmare porting between ruby versions, rails versions, difference gem and plugin versions..
Try to delete your Gemfile.lock, and type this on your terminal:
bundle install
I had create a empty new rails project with a scaffold successfully but when I try rake db:create, it throws me an error: rake aborted! uninitialized constant Rake::DSL.
for this problem I'd suggest running all rake tasks via bundle exec rake ...

Rake db:create error - cannot load such file -- resque/tasks

setting up existing apps on my new machine.
The first app (a simple one) went ok.
For the second app most things are ok but now getting
Rake aborted!
cannot load such file -- resque/tasks
when trying to run rake db:create
I've installed redis and I believe it is running.
How can I resolve this error?
Ruby 1.9.3 Rails 3.2.8
Installed the resque gem to fix this.

Resources