草庐IT

java - 无法将 *.war 部署到 Glassfish 4

全部标签

ruby-on-rails - Rails 4.2,回形针 gem 。无法附加 .docx 类型,尽管已注册 MIME 类型,但读取 content_type 为 'application/zip'

我已经注册了一个MIME类型以允许Paperclip读取.docx文件的content_type作为application/vnd.openxmlformats-officedocument.wordprocessingml.document。但是在测试中,content_type仍被读取为application/zip。知道为什么吗?更令人沮丧的是,.pptx和.xlsxmime类型已经被注册,这些测试通过了(呃)。config/initializers/mime_types.rbMime::Type.register'application/vnd.openxmlformats-o

ruby-on-rails - 无法在 Windows 7 上安装 Rmagick 和 Imagemagick

当我从rmagick-2.13.1.gem所在的目录运行geminstallrmagick-2.13.1.gem时,我收到一条错误消息,指出它无法构建gemnative扩展,如下所示它说c:/Ruby192/bin/ruby.exeextconf.rbcheckingforRubyversion>=1.8.5...yesUnabletogetImagemagickversion***extconf.rbfailed***CouldnotcreateMakefileduetosomereason,probablylackofnecessarylibrariesand/orheaders.

ruby-on-rails - Json -v 1.8.6 不会作为 capistrano 部署的一部分安装

这个问题已在stackoverflow和其他论坛上被问过几次,但我似乎无法通过我遇到的这个错误。当我运行capistranoproductiondeploy时,我在部署过程中收到此错误。capproductionbundler:install00:00bundler:install01bundleinstall--path/var/local/blackduck_flock_rails/shared/bundle--withoutdevelopmenttest--deployme…01Anerroroccurredwhileinstallingjson(1.8.6),andBundle

ruby - 在 JRuby 中,如何确定导致 java.lang.ThreadDeath 的原因?

在为一些与JRuby中的临时文件交互的代码运行单元测试时,我有时会得到以下信息:Exception:java.lang.ThreadDeaththrownfromtheUncaughtExceptionHandlerinthread"Thread-6395"它似乎没有引起任何问题,但这是怎么回事,我如何确定它发生在哪里?我尝试打开-d,但这并没有给我异常的堆栈跟踪。 最佳答案 FWIW:这可能与http://jira.codehaus.org/browse/JRUBY-7074有关.我偶尔会在不使用反引号但调用系统的JRuby程序中

ruby-on-rails - 为什么 Rake 任务增强在我的本地环境和部署到 Heroku Cedar 时有所不同?

我在lib/tasks/foo.rake中有这个:Rake::Task["assets:precompile"].enhancedoprint">>>>>>>>hellofromprecompile"endRake::Task["assets:precompile:nondigest"].enhancedoprint">>>>>>>>hellofromprecompile:nondigest"end当我在本地运行rakeassets:precompile时,两条消息都会被打印出来。当我推送到heroku时,只打印非摘要消息。然而,accordingtothebuildpack,推送正在

ruby-on-rails - rails 无法加载此类文件 -- mysql2/mysql2 (LoadError)

我是ruby​​onrails的新手,我找不到这个错误的解决方案:railss/usr/local/share/gems/gems/mysql2-0.3.13/lib/mysql2.rb:8:in`require':cannotloadsuchfile--mysql2/mysql2(LoadError)from/usr/local/share/gems/gems/mysql2-0.3.13/lib/mysql2.rb:8:in`'from/usr/local/share/gems/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in`requi

ruby-on-rails - Rails 3. 无法在任何来源中找到 libv8-3.3.10.4

我第一次尝试运行capdeploy但出现此错误...[11.12.13.140]sh-c'cd/var/www/releases/20120302151641&&bundleinstall--gemfile/var/www/releases/20120302151641/Gemfile--path/var/www/shared/bundle--deployment--quiet--withoutdevelopmenttest'**[out::11.12.13.140]Somegemsseemtobemissingfromyourvendor/cachedirectory.**[out:

ruby-on-rails - 数据库锁在 Rails 和 Postgres 中无法正常工作

我在Rails模型中有以下代码:foo=Food.find(...)foo.with_lockdoifbar=foo.bars.find_by_stuff(stuff)#dosomethingwithbarelsebar=foo.bars.create!#dosomethingwithbarendend目标是确保正在创建的类型的Bar不会被创建两次。在控制台测试with_lock的效果证实了我的预期。然而,在生产中,似乎在某些或所有情况下锁都没有按预期工作,并且正在尝试冗余Bar——因此,with_lock不会(总是?)导致代码等待轮到它.这里会发生什么?更新对所有说“锁定foo不会帮

ruby-on-rails - Capistrano 部署 :migrate and db:migrate run all migrations every time

因此,我正在使用rails(ruby1.9.3p392、rails3.2、sqlite3db)并尝试将无处不在的博客教程代码部署到“生产”服务器(apache、passenger、ubuntu)。我的deploy.rb看起来像这样:require'bundler/capistrano'require'rvm/capistrano'load'deploy/assets'set:rvm_ruby_string,ENV['GEM_HOME'].gsub(/.*\//,"")set:rvm_type,:userset:user,'blah'set:application,'railsTest'

ruby - 无法安装 ruby​​ gems - zlib 错误

我正在尝试安装一些RubyGems,以便在我收到Twitter消息时可以使用Ruby通知我。然而,在执行了gemupdate--system之后,我现在每次尝试执行geminstall时都会收到zlib错误。下面是我在尝试安装ruby​​gems时得到的控制台输出。(以及gem环境的输出)。C:\data\ruby>geminstalltwitterERROR:Whileexecutinggem...(Zlib::BufError)buffererrorC:\data\ruby>gemupdate--systemUpdatingRubyGemsERROR:Whileexecutingg