我知道这个问题早已被提出过很多问题,但没有一个解决方案适合我,我现在真的很绝望.
我正在尝试使用gem安装rMagick来安装侨民.我已经通过自制软件安装了imagick,并且在尝试运行gem install rmagick时收到此错误:
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.
/Users/tobischweiger/.rvm/rubies/ruby-1.9.3-p385/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for gcc-4.2... yes
checking for Magick-config... no
Can't install RMagick 2.13.2. Can't find Magick-config in /Users/tobischweiger/.rvm/gems/ruby-1.9.3-p385@diaspora/bin:/Users/tobischweiger/.rvm/gems/ruby-1.9.3-p385@global/bin:/Users/tobischweiger/.rvm/rubies/ruby-1.9.3-p385/bin:/Users/tobischweiger/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/local/git/bin
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib …Run Code Online (Sandbox Code Playgroud) 我遵循了本教程,我的简单测试总是因为这个错误而失败
1) test /index returns a list of contacts (WorldNote.ChatsControllerTest)
test/controllers/chats_controller_test.exs:16
** (RuntimeError) cannot begin test transaction because we are already inside one
stacktrace:
(ecto) lib/ecto/adapters/sql.ex:321: anonymous fn/6 in Ecto.Adapters.SQL.start_test_transaction/3
(ecto) lib/ecto/adapters/sql.ex:615: Ecto.Adapters.SQL.pool_transaction/4
(ecto) lib/ecto/adapters/sql.ex:314: Ecto.Adapters.SQL.start_test_transaction/3
test/controllers/chats_controller_test.exs:9: WorldNote.ChatsControllerTest.__ex_unit_setup_0/1
test/controllers/chats_controller_test.exs:1: WorldNote.ChatsControllerTest.__ex_unit__/2
Run Code Online (Sandbox Code Playgroud)
代码很简单
defmodule WorldNote.ChatsControllerTest do
use ExUnit.Case, async: false
use Plug.Test
alias WorldNote.Chats
alias WorldNote.Repo
alias Ecto.Adapters.SQL
setup do
SQL.begin_test_transaction(Repo)
on_exit fn ->
SQL.rollback_test_transaction(Repo)
end
end
test "/index returns a list of contacts" do
contacts_as_json =
%Chats{fbid: 1234567890, latitude: …Run Code Online (Sandbox Code Playgroud) 无论如何禁用强力参数?
我知道这是一个安全漏洞,但我真的不需要它/想要它.
如何将meteorJS项目部署到Digital Ocean VPS?CentOS x64 - 对它有好处吗?或者我需要设置其他东西?
运行
gem install pg -v '0.15.1'
Run Code Online (Sandbox Code Playgroud)
给出错误:
构建原生扩展.这可能需要一段时间...错误:安装pg时出错:错误:无法构建gem原生扩展.
Run Code Online (Sandbox Code Playgroud)/home/askar/.rvm/rubies/ruby-1.9.3-p429/bin/ruby extconf.rb checking for pg_config... no No pg_config... trying anyway. If构建失败,请再次尝试使用--with -pg-config =/path/to/pg_config检查libpq-fe.h ...否找不到'libpq-fe.h header *extconf.rb失败*由于某些原因无法创建Makefile,可能缺少必要的库和/或标头.检查mkmf.log文件以获取更多详细信息.您可能需要配置选项.
提供的配置选项: - with-opt-dir --without-opt-dir --with-opt-include --without-opt-include = $ {opt-dir}/include --with-opt-lib - without-opt-lib = $ {opt-dir}/lib --with-make-prog --without-make-prog --srcdir =.--curdir --ruby =/home/askar/.rvm/rubies/ruby-1.9.3-p429/bin/ruby --with-pg --without-pg --with-pg-dir --without-pg -dir --with-pg-include --without-pg-include = $ {pg-dir}/include --with-pg-lib --without-pg-lib = $ {pg-dir}/lib - with-pg-config --without-pg-config --with-pg_config --without-pg_config
Gem文件将保留在/home/askar/.rvm/gems/ruby-1.9.3-p429/gems/pg-0.15.1中进行检查.结果登录到/home/askar/.rvm/gems/ruby-1.9.3-p429/gems/pg-0.15.1/ext/gem_make.out
我正在使用
我的表格如下:
<%= form_for(@car, :html => {:class => 'form-horizontal' }) do |f| %>
<% if @car.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@car.errors.count, "error") %> prohibited this car from being saved</h2>
<ul>
<% @car.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="field">
<%= f.label :price %><br />
<%= f.text_field :price %>
</div>
<div class="field">
<%= f.label :model_year %><br />
<% %>
<% end %>
</div>
Run Code Online (Sandbox Code Playgroud)
我希望有一个集合选择从100年前开始的模型年份和未来的一年.我试过了
<%= f.select_year :model_year%>
Run Code Online (Sandbox Code Playgroud)
但它说select_year不是一个有效的方法.试着
<%= f.date :model_year, :discard_month => …Run Code Online (Sandbox Code Playgroud) <div class="container-fluid">
<div class="sidebar left">
<div id="app-navigation" class="well">
<h5>Administration</h5>
<ul class="administration-list">
<li class="user"><a href="#user">User</a></li>
<li class="emails"><a href="#emails">Emails</a></li>
<li class="settings"><a href="#Settings">Settings</a></li>
<li class="logs"><a href="#Logs">Logs</a></li>
<li class="help"><a href="#Help">Help</a></li>
</ul>
<h5>Managing tools</h5>
<ul class="tools-list">
<li class="ressource"><a href="#Ressources"><i class="icon-home icon-white" </i>Ressources</a></li>
<li class="playlist"><a href="#Playlist">Playlist</a></li>
<li class="schedule"><a href="#Schedule">Schedule</a></li>
<li class="stations"><a href="#Stations">Stations</a></li>
</ul>
</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
我不明白为什么我的图标没有出现.我正在开始一个新项目,并决定尝试 使用bootstrap 初始化.只是不能让那些图标出现.在我的文本之前似乎有一个看不见的图标......我也在这里查看文档.我还检查了我的boostrap.less,sprites.less和variables.less(一切似乎没问题......).
我的变量设置正确,我的图像(PNG)位于我的../img文件夹中.
// Sprite icons path
// -------------------------
@iconSpritePath: "../img/glyphicons-halflings.png";
@iconWhiteSpritePath: "../img/glyphicons-halflings-white.png";
Run Code Online (Sandbox Code Playgroud) 有没有一种很好的方法来检查使用rspec和水豚的图像和favicons的存在?
我可以查看favicon和图像的DOM,但我希望能够检查这些图像是否也加载.这对rspec和水豚有可能吗?
Ruby 2.0,Rails 4.0,PSQL 9.3
在ActiveAdmin文档中有一个示例:
ActiveAdmin.register_page "My Page" do
content do
para "Hello World"
end
end
Run Code Online (Sandbox Code Playgroud)
我在哪里放这个代码?文件说:
在上面的示例中,将在/ admin/my_page创建一个新页面,标题为"我的页面",内容为"Hello World".
这意味着这样的文件会以某种方式自动创建?不过,我创建了一个名为import.rbapp/admin的文件,菜单中的Import项确实出现了.但是,我无法使用HTML,因为此文件是.rb而不是.erb.我想,为了能够使用html,我需要在方法中创建一个partial和den渲染它content.但当我看到下面app/views没有admin文件夹(只layouts).这是否意味着我需要创建该文件夹admin下app/views?如果是的话,我应该把我的部分放在哪里 - 直接放在app/views/admin新文件夹下面或下面app/views/admin/import?
我很抱歉菜单问题,但ActiveAdmin的文档非常适中.如果有人能够提供有关在ActiveAdmin中为新页面创建和添加内容所需步骤的详细说明,我将不胜感激.
我的webapp中有管理员和普通用户.我想根据他们的身份使他们的根(/)不同.从许多不同的页面访问根,所以如果我能在routes.rb文件中实现这一点会容易得多.这是我目前的档案.
ProjectManager::Application.routes.draw do
root :to => "projects#index"
end
Run Code Online (Sandbox Code Playgroud)
有人可以把我链接到一个可以告诉我进入方向的例子吗?有没有办法将逻辑放入路径文件?谢谢你的帮助.
activeadmin ×1
capybara ×1
css ×1
date ×1
deployment ×1
ecto ×1
elixir ×1
form-for ×1
html ×1
less ×1
linux-mint ×1
macos ×1
meteor ×1
node.js ×1
pg ×1
production ×1
rmagick ×1
routing ×1
rspec ×1
ruby ×1
rubygems ×1
simple-form ×1