rake

Heroku run rake db.migrate / Error: A connection attempt failed

允我心安 提交于 2019-12-25 04:07:32
问题 I am experiencing problems with the "heroku run rake db:migrate" command. It complains about an " ! Heroku client internal error", see below for the entire thing. Git push and heroku create work (see below), but finally rake db:migrate crashes. What can I do? All the best Stefan Below is what I enter and get from Heroku. C:\Sites\demo_app_rt32>git push -u origin master Enter passphrase for key '/z/.ssh/id_rsa': Counting objects: 102, done. Delta compression using up to 4 threads. Compressing

Using Devise in Rails 3.2.3 - Cannot sign out

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-25 04:02:42
问题 I am using devise 2.1.0 for my rails app 3.2.3. Here is what I did: Add gem 'devise' to Gemfile and run bundle Run rails g devise:install Run rails g devise User Setup db by running rake db:migrate The application.html.erb is something like this: <%if user_signed_in? %> Welcome <%= current_user.email%> <%= link_to "Sign out", destroy_user_session_path%> <% else %> <%= link_to "Sign up", new_user_registration_path %> or <%= link_to "Sign in", new_user_session_path %> <% end %> The sign in and

rails 3 rake routes not working, no routes shown as output

若如初见. 提交于 2019-12-25 03:28:24
问题 When I execute bundle exec rake routes --trace the output is: NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01. Gem.source_index called from /usr/local/rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.10/lib/bundler/shared_helpers.rb:3. NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01. Gem.source_index called from /usr/local/rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.10/lib/bundler/source

Additional user attributes results in UnknownAttributeError and NoMethodError

北城余情 提交于 2019-12-25 03:25:10
问题 Apologies in advance for ultra-long post, just trying to include all the info... I have an app using Devise in which I use a rakefile to seed the database with users among other things. This worked recently, but I can't for the life of me tell what happened over the last few set of changes and it probably just needs a fresh pair of eyes. Here's the bang-head-against-wall twist: running the rakefile on localhost works correctly running the rakefile after pushing to Heroku gives the errors I'll

Problems during rake db:seed, value dosn't set correctly

不打扰是莪最后的温柔 提交于 2019-12-25 01:56:02
问题 I want to prefill my table with the seeds.rb file in app/db but there I got a problem during storing the right data. in the table users I have an column called active withe datatype tinyint. so now I want to store with the seeds.rb int values User.create([ { :id => 1, :firstname => 'Felix', :lastname => 'Hohlwegler', :active => 1}]) but it dosn't store 1. It always stores 0 in database. also tried this: User.create([ { :id => 1, :firstname => 'Felix', :lastname => 'Hohlwegler', :active =>

Cannot call ruby rake with parameter containing space

烈酒焚心 提交于 2019-12-25 01:45:48
问题 I have task: desc "Create a team" task :create_dev_team, [:team_name] do |t, args| puts "Creating \"#{args.team_name}\" team under Sub Org ID: 1" ESP::Team.create(name: "#{args.team_name}", sub_organization_id: 1) end I call: rake create_dev_team[Team Name] I get: rake aborted! Don't know how to build task 'create_dev_team[Team' /Users/me/.rvm/gems/ruby-2.4.1/gems/rake-10.3.2/lib/rake/task_manager.rb:62:in `[]' /Users/me/.rvm/gems/ruby-2.4.1/gems/rake-10.3.2/lib/rake/application.rb:149:in

Running rake db:migrate without some initializers

走远了吗. 提交于 2019-12-24 18:53:27
问题 I am trying to run jruby -S rake db:migrate , but I do not want to start up a daemon in config/initializers whenever I do a migrate. Is there a way to do this? Up until now, I have just been moving the daemon file to a file with a .bak extension so that rails doesn't load it when I do the migrate. I suspect that this is a stupid way of doing things. Is there a better way? Oh and I am running jruby ( if it matters ). 回答1: When run: NODAEMON=1 rake db:migrate In initializer: unless ENV[

Rake error: Stack level too deep

扶醉桌前 提交于 2019-12-24 17:24:56
问题 I know this is a common question, but I just started a project with the new Rails 3.1.0 and Ruby 1.9.2 p290 On my first migrations I had already this error and I am not sure why. Aurelien$ rake db:migrate --trace /Users/Aurelien/.rvm/gems/ruby-1.9.2-p290@rails3/gems/rake-0.9.2/lib/rake/version.rb:4: warning: already initialized constant MAJOR /Users/Aurelien/.rvm/gems/ruby-1.9.2-p290@rails3/gems/rake-0.9.2/lib/rake/version.rb:5: warning: already initialized constant MINOR /Users/Aurelien/.rvm

rake task memory leak

喜夏-厌秋 提交于 2019-12-24 13:12:37
问题 I have a long running rake task that is gobbling up all my system memory over time? What is the quickest way to track down my issue and get to the bottom of it? Im using rails 2.3.5, ruby 1.8.7, ubuntu on slicehost and mysql 5. I have rails app that works fine. I have a nightly job that runs all night and does tons of work (some external calls to twitter, google etc, and lots of db calls using active record, over time that job grows in memory size to nearly 4 gig. I need to figure out why the

How do I have the :default Rake task depend on a task with arguments?

拥有回忆 提交于 2019-12-24 12:11:18
问题 I have been playing around with Rake and Albacore, to see if I can replace our existing MSBuild script that deploys software with something that isn't XML. I have a task that will change the debug value inside a web.config to false . The task takes the directory of the web.config as an argument, but I can't quite figure out the syntax needed to supply this argument in the default task. require 'albacore' require 'nokogiri' deployment_path = 'c:/test-mars-deploy' task :default => [ :build,