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.
Related
When I try to use bin/rails db:create (or bundle exec rails db:create), I receive the usage info for rails new.
I'm using chruby with version 2.3.3 and Rails 5.0.0.1.
The goal here is just to create the databases....what's going on?
Simply try this:
rake db:create
I am trying to reset my development Database for my Rails 5.0 project on Windows, but when I run (same as rake db:drop)
rails db:drop
I get the following error:
Errno::EACCES Permission denied # unlink_internal
I restarted my PC already to make sure that rails was not running in anyway
You just need to exit the Rails Server.
I had the same error trying to reset my sqlite3 db on Windows, using rails 5.1.6 while doing the Learn Enough to Be Dangerous Rails tutorial. I found the following answer on another post, and it worked for me:
"For Dropping entire database just give rake db:setup it drops and again creates the database for you."
When I run the command, I get:
$ rails db:setup
Database 'db/development.sqlite3' already exists
Database 'db/test.sqlite3' already exists
-- create_table("users", {:force=>:cascade})
-> 0.0497s
-- create_table("users", {:force=>:cascade})
-> 0.0624s
And my database seems to work as expected, but with no data.
This can help
When I need to remove data base then I use rake db:reset.
Please try it.
Hope it helps.
Found Solution:
In windows machine you would have to specify that it is an unsafe move, so i
rake db:drop_unsafe
rails db:migrate
this is for windows machine, if you're using Linux then you can do just
rake db:reset
I use the command
rake doc:app
to generate some rudimentary documentation for my rails app. It's always worked fine in the past. Yesterday I upgraded by app from Ruby 1.9.3 to 2.1.1, and Rails 3.2 to 4.1. Everything is working fine with the app, so I went to regenerate documentation for the first time in a few weeks, and it failed. I ran the command above and got the following error message:
rake aborted!
Don't know how to build task 'README.rdoc'
/home/vagrant/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'
/home/vagrant/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => doc:app => doc/app/index.html
(See full trace by running task with --trace)
I believe this is the standard error message rake delivers for a task it doesn't know. Like if I ran
rake foo
It gives the exact thing, but with 'foo' instead of 'README.rdoc'. I get the same results when I run
bundle exec rake doc:app
I'm using rake 10.2.2. Any idea what's going on?
Create a README.rdoc in the project root folder. You might have removed it or replaced it with a README with another filetype extension.
I am trying to use Sunspot gem for Solr on a Rails 3 app. I have followed RailsCast #278, since I am using Windows I have to do rake sunspot:solr:run and that seems to start with no error. However when I try to run rake sunspot:reindex I get the error:
No connection could be made because the target machine actively refused it. - connect(2)
I am using mysql2 gem for mysql. Please advise.
I have to do rake sunspot:solr:run and that seems to start with no error
It sounds like the connection is not being accepted at all to Solr, so this part is my first suspicion — you should get a lot of fairly verbose output from Solr when starting it. Can you share some output of that?
Also, what version of java are you running? (java -version)
I had the same problem running "bundle exec rake sunspot:solr:reindex" on Windows. The solution is to add the correct RAILS_ENV option, for me it was test, e.g.
bundle exec rake sunspot:solr:reindex RAILS_ENV=test
Yes, you'll have to have solr server running beforehand:
bundle exec rake sunspot:solr:run RAILS_ENV=test
I am getting an error when trying to run rake db:migrate here:
http://pastie.org/2058143
I've re-installed Rake a few times now after downgrading from Rails 3.1 RC (bad idea to upgrade to that) to Rails 3.0, which is what I'm using now.
EDIT: This was solved by doing 'gem install rake -v=0.8.7', I think I forgot to do this after I uninstalled the previous version(s) and the Rakefile was missing.
One possible solution. Open your gemlock file and delete the entire write up there and save it. if you dont have rake 0.8.7 file on your application create a new app that uses rake 0.8.7 possibly with rails 3.0.8 then copy its rake file and replace it with your previous one