Tag: gem

Ruby:Mail gem在邮件中添加60个字符后添加\ r \ n

我想将actionmailer_x509移植到Rails 3.为了做到这一点,我尝试使用签名电子邮件从大字符串创建Mail对象。 你可以在这一行看到这样的创作: https : //github.com/petRUShka/actionmailer_x509/blob/master/lib/actionmailer_x509.rb#L129 原始字符串( smime0 ): https : //gist.github.com/1d2c84cc2e255be010a6 已解决的邮件对象转储到文件( newm ): https : //gist.github.com/4682fe88e8dcfeca60b2 例如,您可以看到smime0的第26行与newm的第40行之间的差异。 在smime0 \r\n中,在每个64个字符之后设置,并且在每个60个字符之后设置newm \r\n 。 这种行为破坏了签名。 是否有可能改变这种行为? 我试图找出如何关闭它,但失败了。 对于这一点,可能还有其他一些解决方法。 PS Mail gem: https : //github.com/mikel/mail ,讨论x509和actionmailer的线程: 如何从Rails 3中的ActionMailer发送签名的电子邮件?

安装了ruby和gem,但是sass gem不起作用

我知道我安装了ruby和gem,因为我之前安装了一堆gem。 另外,当我执行以下操作时 ~$ ruby –version ruby 1.8.7 (2010-08-16 patchlevel 302 [i486-linux] ~$ gem –version 1.3.7 正如你所看到的,它们会返回版本 – 但是当我尝试这样做时 – ~$ sass –watch happy.scss:happy.css bash: sass: command not found 我是一切相对的菜鸟,但更多的是ruby和gem。 为了揭示我或多或少的理解水平,我通常已经学到了足够的Debian来获得一个环境,我可以让Clojure运行并使Web应用程序正常工作(花了我差不多一年的业余时间来做这件事 – 我几乎不知道编程前的任何事情。 我正努力让sass努力减轻我在网页设计方面的心理负担,而我只是在这上面打砖墙。 这会是PATH问题吗? 如果是这样的话,需要在路径上做什么才能使一个gem起作用 – 顺便说一下,安装sass时会发生什么 – # gem install sass Successfully installed sass-3.2.5 1 gem installed Installing ri documentation for sass-3.2.5… Installing RDoc […]

从jruby-complete中消耗gem

我可以通过传递给它的jar子制作我的jruby-complete消耗gem。 但我想使用中央gem回购。 这就是我现在能做的: $ java -jar jruby-complete-1.6.5.jar -S gem list *** LOCAL GEMS *** rake (0.8.7) sources (0.0.1) $ java -jar jruby-complete-1.6.5.jar -rjar_of_gems.jar -S gem list *** LOCAL GEMS *** erubis (2.7.0) mizuno (0.4.1) rack (1.4.0) rack-protection (1.2.0) rake (0.8.7) rna (0.0.101) sinatra (1.3.2) sources (0.0.1) tilt (1.3.3) 每次更新gem或者需要添加gem时都必须更改jar文件比我想做的更开销。 任何建议,必须有一种方法让jruby-complete指向像常规jruby的gem回购?

通过要求gem:path或:git来实现LoadError

我在这里遇到了一个非常奇怪的问题。 我在github上分叉了一个gem进行一些修改,在我的本地机器上克隆了我的repo,进行了更改并更改了另一个项目的Gemfile以从我的本地存储库中获取gem以进行测试。 不幸的是,我在ruby脚本中需要gem时遇到LoadError。 rvm current => ruby-1.9.3-p448 ruby –version => ruby 1.9.3p448 (2013-06-27 revision 41675) [x86_64-linux] bundle –version => Bundler version 1.3.5 我的Gemfile的内容: source ‘http://rubygems.org gem ‘steps’, :path => “/home/benny/workspace/steps” 捆绑输出: $ bundle –no-cache Resolving dependencies… Using colored (1.2) Using highline (1.6.19) Using steps (1.0.2) from source at /home/benny/workspaces/steps Using bundler (1.3.5) Your bundle is […]

Ruby 2.1和Nokogiri安装错误?

我知道这是一个在这里已经“解决”了很多次的问题,但是我已经尝试了所有的解决方案,仍然无法让它发挥作用。 这是我的错误: 22-01-14 17:57:56> gem install nokogiri Building native extensions. This could take a while… ERROR: Error installing nokogiri: ERROR: Failed to build gem native extension. /Users/josh/.rvm/rubies/ruby-2.1.0/bin/ruby extconf.rb Extracting libxml2-2.8.0.tar.gz into tmp//ports/libxml2/2.8.0… OK Running ‘configure’ for libxml2 2.8.0… ERROR, review ‘tmp//ports/libxml2/2.8.0/configure.log’ to see what happened. *** extconf.rb failed *** Could not create Makefile due to […]

如何在路径中自动包含Gem?

我有foo.gem,那里有lib/foo.rb 当我向Gemfile添加gem时,我的路径中自动需要foo.rb。 但我需要自动包含它。 原因是我正在进行控制台扩展,我希望它们在没有我写“include Foo”的情况下可用。 我正在试验 SOME_CLASS.send(:include, Foo) 但不确定使用什么类将它添加到路径中,例如当我启动自动包含的控制台时。 这里有一些mixins自动包含在控制台中,我需要我的在那里:)谢谢 irb(main):006:0> self.class.included_modules => [PP::ObjectMixin, JSON::Ext::Generator::GeneratorMethods::Object, ActiveSupport::Dependencies::Loadable, Kernel] PS 我可以解决初始化程序的问题,但我不想更改项目的代码我只想添加gem并且它可以工作。

在教程中使用rspec在rails上测试ruby时出错

我是ruby on rails的新手我只是在阅读http://ruby.railstutorial.org/chapters/static-pages#top作为教程说,我创建了sample_app包或项目。 现在在3.2.1节我正在测试应用程序。 首先,我从cmd运行以下命令 $ rails generate integration_test static_pages 这在spec / requests目录中创建了static_pages_spec.rb。 现在在spec / requests / static_pages_spec.rb中添加以下代码 require ‘spec_helper’ describe “Static pages” do describe “Home page” do it “should have the content ‘Sample App'” do visit ‘/static_pages/home’ expect(page).to have_content(‘Sample App’) end end end 在这个阶段,我在sample_app / spec / spec_helper.rb文件中添加以下代码 config.include Capybara::DSL 所以我的文件看起来像 # This file […]

rails 1.9.3`to_specs’:找不到栏杆Gem:加载错误

我得到以下错误。 rails -v /opt/ruby/lib/ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs’: Could not find railties (>= 0) amongst [daemons-1.1.9, diff-lcs-1.1.3, expectations-2.0.0, faraday-0.8.9, faraday_middleware-0.8.8, ftpfxp-0.0.4, json-1.7.7, json-1.6.1, json-1.4.3, lumberg-1.1.1, metaclass-0.0.1, mime-types-1.24, mocha-0.12.7, multipart-post-1.2.0, mysql-2.8.1, rest-client-1.6.7, rspec-2.11.0, rspec-core-2.11.1, rspec-expectations-2.11.3, rspec-mocks-2.11.3, stomp-1.2.2, system_timer-1.2.4, systemu-1.2.0] (Gem::LoadError) from /opt/ruby/lib/ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec’ from /opt/ruby/lib/ruby/1.9.1/rubygems.rb:1231:in `gem’ from /home/adsudxuy/ruby/gems/bin/rails:22:in `’ 我的Gemrc文件如下: cat .gemrc — gem: –remote –gen-rdoc –run-tests gemhome: /home/adsudxuy/ruby/gems […]

gem安装指南针不工作

在终端中运行线路gem安装指南针时遇到问题。 它返回以下错误。 有人能帮忙解决这个问题吗? 错误:安装罗盘时出错:错误:无法构建gem原生扩展。 /usr/local/rvm/rubies/ruby-1.9.3-p392/bin/ruby -r ./siteconf20150225-51908-cfetpz.rb extconf.rb checking for ffi.h… *** 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 –without-opt-lib=${opt-dir}/lib –with-make-prog –without-make-prog –srcdir=. –curdir […]

在Heroku上不运行Dashing

我正在尝试将Dashing部署到Heroku。 Everthing在localhost上运行完美。 使用github页面提供的说明进行部署 它似乎与backportsgem有关。 以下是heroku日志文件 2014-11-26T21:12:22.141799+00:00 heroku[web.1]: State changed from crashed to starting 2014-11-26T21:12:32.932667+00:00 heroku[web.1]: Starting process with command `bundle exec thin start -R config.ru -e production -p 23294` 2014-11-26T21:12:40.618062+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/backports-3.6.0/lib/backports/1.9.1/io/open.rb:2:in `close’: Bad file descriptor – /app/vendor/bundle/ruby/2.0.0/gems/backports-3.6.0/lib/backports/1.9.1/io/open.rb (Errno::EBADF) 2014-11-26T21:12:40.618144+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/backports-3.6.0/lib/backports/1.9.1/io/open.rb:2:in `’ 2014-11-26T21:12:40.618185+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/backports-3.6.0/lib/backports/tools.rb:343:in `require_with_backports’ 2014-11-26T21:12:40.618165+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/backports-3.6.0/lib/backports/tools.rb:343:in `require’ 2014-11-26T21:12:40.618206+00:00 […]