小编Jam*_*cky的帖子

ArgumentError:未知密钥::条件.有效键是:: class_name,:class,:foreign_key

在尝试rake:db migrate之后,我在终端中遇到了这个错误

rake aborted!
ArgumentError: Unknown key: :conditions. Valid keys are: :class_name, :class, :foreign_key, :validate, :autosave, :table_name, :before_add, :after_add, :before_remove, :after_remove, :extend, :primary_key, :dependent, :as, :through, :source, :source_type, :inverse_of, :counter_cache, :join_table, :foreign_type
/app/models/user.rb:8:in `<class:User>'
/app/models/user.rb:1:in `<top (required)>'
/config/routes.rb:24:in `block in <top (required)>'
/config/routes.rb:1:in `<top (required)>'
/config/environment.rb:5:in `<top (required)>'
Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)
Run Code Online (Sandbox Code Playgroud)

当我运行rails s时,这是我在终端中遇到的错误

Exiting
/usr/local/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/core_ext/hash/keys.rb:75:in `block in assert_valid_keys': Unknown key: :conditions. Valid keys are: :class_name, :class, :foreign_key, :validate, :autosave, …
Run Code Online (Sandbox Code Playgroud)

ruby ruby-on-rails

6
推荐指数
1
解决办法
6528
查看次数

无法在Java Selenium中选择Bootstrap下拉列表

我在Selenium选择bootstrap下拉时非常困难.

我是Selenium的新手,所以任何建议和指导都会非常有用,因为我喜欢做的只是选择下拉列表,输入"email",然后在实例中按Enter键.

我已经完成了几十个解决方案,但没有一个能够解决这个问题.

我能做什么?请帮忙.

Salenium

package newPackage;


import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.interactions.Actions;


public class importLeads {

	public static void main(String args[]) throws Exception {
		
		        System.setProperty("webdriver.chrome.driver", "C:\\Users\\David\\Downloads\\Notes\\WebDriver\\chromedriver.exe");
    WebDriver driver = new ChromeDriver();

    //login to site
    driver.get("https://demos5.softaculous.com/Mautic/s/contacts/import/new");
    driver.manage().window().maximize();
    driver.findElement(By.id("username")).sendKeys("admin");
    driver.findElement(By.id("password")).sendKeys("password");
    driver.findElement(By.className("btn")).click();
    Thread.sleep(2000);

    //importing Data
    WebElement uploadBox = driver.findElement(By.id("lead_import_file"));
    uploadBox.sendKeys("C:\\Users\\David\\Downloads\\data_file.csv");
    driver.findElement(By.id("lead_import_start")).click();

    //Select from dropdown
    WebElement dropdownToggle = driver.findElement(By.xpath("id('lead_field_import_email_address')"));
    Actions cursor = new Actions(driver);
    cursor.moveToElement(dropdownToggle);
    cursor.click();
    cursor.perform();
    Thread.sleep(1000);
    WebElement weh = driver.findElement(By.id("lead_field_import_email_address_chosen"));

    Actions cursor2 = new Actions(driver);
    cursor2.moveToElement(weh);
    cursor2.click(); …
Run Code Online (Sandbox Code Playgroud)

java selenium twitter-bootstrap selenium-webdriver

5
推荐指数
1
解决办法
807
查看次数

Heroku的:你如何推到特定的应用程序,如果你有在Heroku的多个应用程序?

我使用创建一个新的heroku应用程序heroku create test-app3.现在,如果我想要把一些代码到这个新的test-app3,我该怎么做呢?

当我输入heroku list终端时,我得到:我的应用程序

  • test-app1
  • test-app2
  • test-app3

我如何推送test-app3?如何在要推送的应用程序之间切换?

ruby ruby-on-rails heroku ruby-on-rails-4 ruby-on-rails-5

4
推荐指数
1
解决办法
2686
查看次数

Heroku:PG :: ConnectionBad:无法连接到服务器:连接被拒绝

我尝试将新应用程序推送到heroku并出现此错误 PG::ConnectionBad: could not connect to server: Connection refused

这是我的gemfile,它与它有关吗?我正在使用邮政狂欢.我不确定,因为这是我第一次尝试在heroku中使用狂欢,但它似乎没有经历过.任何帮助,将不胜感激

source 'https://rubygems.org'

ruby "2.2.1"

gem 'puma', '~> 2.13.4'
gem 'braintree', '~> 2.48.1'
gem 'rails', '4.2.3'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc

group :development, :test do
  gem 'byebug'
  gem 'web-console', '~> 2.0'
  gem 'spring'
end

    group :production, :staging do
        gem 'pg'
        gem 'rails_12factor', '~> 0.0.3'
    end


gem 'spree', '3.0.4'
gem 'spree_gateway', …
Run Code Online (Sandbox Code Playgroud)

ruby postgresql ruby-on-rails heroku ruby-on-rails-4

4
推荐指数
1
解决办法
3971
查看次数

Heroku :![拒绝]管理员-&gt;管理员(非快进)

每当我尝试将rails应用程序推送到heroku时,我都会得到并出错。我该如何解决?我做了git init,git add。,git commit -m“ complete”和git push heroku master

To https://git.heroku.com/shuabe.git
! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'https://git.heroku.com/james.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
Run Code Online (Sandbox Code Playgroud)

git ruby-on-rails heroku

2
推荐指数
2
解决办法
1921
查看次数

Rails:未定义的方法`relationships_path'

我正在关注迈克尔哈特的书,并希望并将跟随和取消关注按钮添加到用户显示页面.执行此操作时遇到此错误undefined method 'relationships_path'.

任何帮助都会有所帮助和赞赏.

在此输入图像描述


关系controller.rb

class RelationshipsController < ApplicationController
  before_action :logged_in_user

  def create
    @user = User.find(params[:followed_id])
    current_user.follow(@user)
    respond_to do |format|
      format.html { redirect_to @user }
      format.js
    end
  end

  def destroy
    @user = Relationship.find(params[:id]).followed
    current_user.unfollow(@user)
    respond_to do |format|
      format.html { redirect_to @user }
      format.js
    end
  end
end
Run Code Online (Sandbox Code Playgroud)

用户controller.rb

class UsersController < ApplicationController

   before_action :authenticate_user!
   before_action :set_user



def create
  @user = User.friendly.find(params[:followed_id])
  current_user.follow(@user)
  respond_to do |format|
    format.html { redirect_to @user }
    format.js
  end
end

def destroy
  @user = Relationship.find(params[:id]).followed
  current_user.unfollow(@user) …
Run Code Online (Sandbox Code Playgroud)

ruby ruby-on-rails ruby-on-rails-3

1
推荐指数
1
解决办法
396
查看次数