rake

Ruby: rake:22: undefined method `activate_bin_path' for Gem:Module (NoMethodError)

心已入冬 提交于 2019-12-12 04:26:26
问题 I had this problems in Ruby 1.8.7-p374. When try to run "rake db:migrate" i got this error: RubyGems installed the following executables: /home/wellington/.rbenv/versions/1.8.7-p374/bin/gem RubyGems system software updated /home/wellington/.rbenv/versions/1.8.7-p374/bin/rake:22: undefined method `activate_bin_path' for Gem:Module (NoMethodError) Its occurs on deploy Rails apps. Any ideas to solve this? 回答1: I resolved this updating gem and bundler gem update --system gem update bundler 来源:

Rake tasks won't run inside of my sinatra app

帅比萌擦擦* 提交于 2019-12-12 04:18:25
问题 I have a sinatra app with a Rakefile.rake and server.rb file. In the server.rb file I have get '/' do rake :test end the app loads up but crashes when I load localhost:4567/ and says undefined method 'rake' for sinatra application. I try and require the file by using require '/home/user/project/Rakefile' and I also try Rakefile.rake but both give me an error that reads "require cannot load such file." I'm using Ubuntu. I'm not sure why sinatra can't load the rakefile, but when I run rake test

Rake sequential tasks

允我心安 提交于 2019-12-12 03:53:10
问题 I have run into a very strange problem. I have a task which resets my database as so: task :reset => [:drop, :create, :migrate, :seed] The problem is, I am receiving errors when seeding because of missing columns which are added in late migration files. One example: undefined method new_attr= for User Yet this attribute is already added in a migration. The strange part is, I receive no errors if I run the above tasks separately. Can anybody shed some light? Surely these tasks cannot be run

Rake db:drop not clearing out my old tables

我是研究僧i 提交于 2019-12-12 01:43:19
问题 My User migration used to look like this: class CreateUsers < ActiveRecord::Migration def change create_table :users do |t| t.string :login etc Now it looks like this: class CreateUsers < ActiveRecord::Migration def change create_table :users do |t| t.string :username etc Why, then, do I see this? rake db:drop rake db:create rake db:migrate rails console > User.new +----+-------+------------------+---------------+-------------------+------------+------------+ | id | login | crypted_password |

Rails Server crashes Chrome “No Data Received”

断了今生、忘了曾经 提交于 2019-12-12 00:30:53
问题 I have loaded the 'stanford-core-nlp' gem and am trying to use it in my fledgling app. However, every time I try to show the rendered text, I receive this error message from Chrome and the rails server exits, citing Trace/BPT trap: 5. I have searched other similar Rails errors but can't find anything that seems to match my situation. The only thing I can think of is that the code below is causing some kind of issue? def pos_tagger (text) require 'stanford-core-nlp' pipeline = StanfordCoreNLP

Rails installation windows 7 bad file descriptor mysql2

你。 提交于 2019-12-11 23:58:01
问题 For the past 1 day, Im trying and getting only this, C:\dev\man>rake db:create --trace ** Invoke db:create (first_time) ** Invoke db:load_config (first_time) ** Execute db:load_config ** Invoke rails_env (first_time) ** Execute rails_env ** Execute db:create rake aborted! Bad file descriptor C:/Ruby193/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/active_record/c onnection_adapters/mysql2_adapter.rb:312:in `query' C:/Ruby193/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/active

Could not find gem 'rails' headaches

偶尔善良 提交于 2019-12-11 23:49:10
问题 I'm on Mac OS X 10.6 Snow Leopard. I just updated my Ruby stuff using: sudo gem update Unfortunately, it broke everything. When I try to run a simple command in my website directory, like: rails generate model User It failed, with this error: Could not find gem 'rails (= 3.0.3, runtime)' in any of the gem sources listed in your Gemfile. Try running bundle install . So I tried running bundle install rails . It succeeded! So I tried running rails . It failed. So I tried getting the Rails

How to test post request and follow redirects with capybara?

妖精的绣舞 提交于 2019-12-11 20:16:40
问题 I'm trying to test a post request with capybara and cucumber. I can't visit a page and press a link to send the request because it has a confirm dialogue and I haven't made it work with javascript so I'm trying to use the post method and then test if it redirects to the appropriated url but I'm getting: No response yet. Request a page first. (Rack::Test::Error) My code is: page.driver.post url page.driver.status_code.should be 302 follow_redirect! It's working fine until follow_redirect! . I

Bundle exec rake spec and custom rake tasks

纵然是瞬间 提交于 2019-12-11 18:55:23
问题 I have a simple rake task, dedicated for populating my postgresql database (same db for dev, test and prod environments): # lib/tasks.sample_data.rake namespace :db do desc "Fill database with sample data" task populate: :environment do make_users make_user_apps end end def make_users ... users = []; users << User.create(...) end ........ When I use 'bundle exec rake db:populate' this task is working fine. I have full db of User records. I also have some rspec tests, which are using model

How do you customize the identifier used by MinispadeFilter in rake-pipeline

我的未来我决定 提交于 2019-12-11 18:28:33
问题 Per this question: Setting up rake-pipeline for use with handlebars alongside Google App Engine I'm using a MinispadeFilter as my dependency management system via rake-pipeline. The weird thing I'm seeing is the coffeescript and handlebars files have their minispade identifier set to a tmp directory (I'm assuming, where the work is being done). screencast.com/t/wIXmREcreW Is there a way to set that to a root path such that it is normalized? Likewise my js files, while not pointing to a tmp