rake

bundle update rake not fixing my 'You have already activated rake…' error

我们两清 提交于 2019-12-11 18:02:46
问题 When I run rake db:migrate in Ubuntu Terminal I keep getting the error: rake aborted! You have already activated rake 10.0.4, but your Gemfile requires rake 0.9.6. Using bundle exec may solve this. I saw on stackoverflow a way to solve this problem is to run: bundle update rake So I do this and I get: Fetching gem metadata from https://rubygems.org/....... Fetching gem metadata from https://rubygems.org/.. Enter your password to install the bundled RubyGems to your system: Using rake (0.9.6)

ruby on rails error rake db:create

牧云@^-^@ 提交于 2019-12-11 17:47:36
问题 I have been using ruby on rails fine no problem, now suddenly every time I run rake db:create I get the following errors: C:\>cd xampp C:\xampp>cd htdocs C:\xampp\htdocs>cd what C:\xampp\htdocs\what>rake db:create rake aborted! undefined method `task' for #<What::Application:0x20eb1e0> (See full trace by running task with --trace) C:\xampp\htdocs\what> Any help please??? Here is all my cmd C:\xampp\htdocs\comeon>rake db:create --trace rake aborted! undefined method `task' for #<Comeon:

Rails app rake db:migrate aborted - syntax error

让人想犯罪 __ 提交于 2019-12-11 14:43:23
问题 I keep getting the following error when running rake db:migrate: rake aborted! syntax error on line 18, col 9: ` adapter: mysql' Tasks: TOP => db:migrate => environment (See full trace by running task with --trace) This is my database.yml file: # SQLite version 3.x # gem install sqlite3-ruby (not necessary on OS X Leopard) development: adapter: sqlite3 database: db/development.sqlite3 pool: 5 timeout: 5000 # Warning: The database defined as "test" will be erased and # re-generated from your

Rails - rake db:reset not clearing my database

我怕爱的太早我们不能终老 提交于 2019-12-11 14:28:10
问题 New to rails here, and experimenting with using the db\seeds.rb file and such First, I want to clear all the data in my database using rake db:reset but it's not working! Here's my output C:\Sites\sportproject>rake db:reset Couldn't drop db/development.sqlite3 : # db/development.sqlite3 already exists -- create_table("sports", {:force=>true}) -> 0.0640s -- create_table("teams", {:force=>true}) -> 0.0340s -- add_index("teams", ["sport_id"], {:name=>"index_teams_on_sport_id"}) -> 0.0160s --

Looking for way to load just selected models instead of all Rails environment in rake task

会有一股神秘感。 提交于 2019-12-11 13:58:20
问题 in classic rake example we can load all rails environment with all models in taks with: desc "Pick a last user name" task :winner => :environment do puts "Last user: #{User.last.name}" end I have very large rails project so it takes a lot of time to load all models and dependencies. Is any way to load rails with just specific model or set of models? I'm about to write custom rails loader but don't want to invent bycicle ;) Maybe some gem or good custom loader example already exist? I think it

Does invoking multiple tasks from a parent rake loads environment for each of them

拜拜、爱过 提交于 2019-12-11 13:54:06
问题 If I have one rake which invokes multiple other rakes. Once I initiate the parent rake rake myapp:main Then invokes done within the rake would load environment for each task or its just one time activity done while running rake myapp:main ? namespace :myapp do desc "Main Run" task :main => :environment do Rake::Task['myapp:task1'].invoke Rake::Task['myapp:task2'].invoke end task :task1 => :environment do # Does the first task end task :task2 => :environment do # Does the second task end end

Rake task works in development, but not in production

淺唱寂寞╮ 提交于 2019-12-11 13:11:03
问题 I've got a rake task that changes data on the homepage every few hours. I've tested it out and it works fine in development. But it doesn't work in production. What do I have to do to get the changes I want to see? Should I add a command that restarts the server? Would that make the server acknowledge the change? Is there a smarter way to do this? The rake task is below. It'll be run by heroku's scheduler add on, so it's currently in the lib/tasks/scheduler.rake file. desc 'changes the meta

rake db:migrate returns “rake: Is a directory”?

余生长醉 提交于 2019-12-11 12:53:41
问题 I've been searching for the answer to this question for a week, but haven't found one. I'm running Mac OS 10.5.8 if that's relevant. I'm trying to do the Peepcode tutorial "Meet Rails 3" but when I run the command line user$ rake db:migrate I get the following error message: /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake: Is a directory - /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake (Errno::EISDIR) from /usr/local/bin/rake:19:in `load' from /usr/local/bin/rake:19 I found the

Rake file is seeing old version of database on Heroku

元气小坏坏 提交于 2019-12-11 12:40:02
问题 I'm using a rakefile to seed my database. I was seeing weird behavior (see Additional user attributes results in UnknownAttributeError and NoMethodError) and have concluded that it is operating on an old version of my database (at the very least, an old version of my Users table, perhaps more). Running the rakefile on localhost works fine On Heroku, printing User.column_names within the rakefile shows the old version of the table On Heroku, printing User.column_names from within the main app

How do I migrate data from production db to development db (Rails 4)?

落爺英雄遲暮 提交于 2019-12-11 12:35:03
问题 I know this one sounds kind of backwards! I've been working on a cloud-based case-management application, and was working on a support-ticketing feature. We have our development database (MySQL) that has all the same data as our production database (It's a very large app). Development is basically a "sandbox" environment, hence why the development db has all the same as the production db. This morning, I ran into a problem in my local development server for: Migrations are pending; run 'bin