Tag: rubygems

gem Rdmtx的问题

当我尝试安装Rdmtx gem时,我正面临着这个问题: $ gem install Rdmtx Building native extensions. This could take a while… ERROR: Error installing Rdmtx: ERROR: Failed to build gem native extension. /Users/alberto/.rbenv/versions/2.2.5/bin/ruby -r ./siteconf20170508-97735-7c5328.rb extconf.rb checking for main() in -ldmtx… no creating Makefile make “DESTDIR=” clean make “DESTDIR=” compiling Rdmtx.c Rdmtx.c:26:10: fatal error: ‘dmtx.h’ file not found #include ^ 1 error […]

我无法加载Ruby Gems

每当我尝试加载ruby gem时,我都会收到此错误 /home/hilarl/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require’: cannot load such file — twit ter (LoadError) from /home/hilarl/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require’ from sample.rb:2:in `’ 你能帮忙吗?

运行rails服务器时,Windows上没有Javascript运行时

我是Ruby on Rails的新手,我在Windows PC上设置它时遇到了麻烦。 我已成功按照http://rubyonrails.org/download上的说明操作。 但是,当我去运行rails server命令时,我想出了这个输出: C:/Ruby192/lib/ruby/gems/1.9.1/gems/execjs-1.2.9/lib/execjs/runtimes.rb:47:in `a utodetect’: Could not find a JavaScript runtime. See https://github.com/sstephen son/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable) from C:/Ruby192/lib/ruby/gems/1.9.1/gems/execjs-1.2.9/lib/execjs.rb:5:in `’ from C:/Ruby192/lib/ruby/gems/1.9.1/gems/execjs-1.2.9/lib/execjs.rb:4:in `’ from C:/Ruby192/lib/ruby/gems/1.9.1/gems/coffee-script-2.2.0/lib/coffee_ script.rb:1:in `require’ from C:/Ruby192/lib/ruby/gems/1.9.1/gems/coffee-script-2.2.0/lib/coffee_ script.rb:1:in `’ from C:/Ruby192/lib/ruby/gems/1.9.1/gems/coffee-script-2.2.0/lib/coffee- script.rb:1:in `require’ from C:/Ruby192/lib/ruby/gems/1.9.1/gems/coffee-script-2.2.0/lib/coffee- script.rb:1:in `’ from C:/Ruby192/lib/ruby/gems/1.9.1/gems/coffee-rails-3.1.1/lib/coffee-r ails.rb:1:in `require’ from C:/Ruby192/lib/ruby/gems/1.9.1/gems/coffee-rails-3.1.1/lib/coffee-r ails.rb:1:in […]

为ruby whois gem设置whois服务的地址

使用ruby whois gem,如何设置whois服务的服务器地址? 设置bind_host,我收到一个错误。 > whois_client = Whois::Client.new(bind_host: “192.0.47.59”, bind_port: 43) => #”192.0.47.59″, :bind_port=>43}> > record = whois_client.lookup(‘wandajackson.com’) Whois::ConnectionError: Errno::EADDRNOTAVAIL: Can’t assign requested address – bind(2) for “192.0.47.59” port 43 from (irb):4

使用Closure_tree gem而不是Awesome嵌套集

嗨,我按照链接设置了closure_tag gem。 当我尝试以下列方式使用closure_tree语法时(newStructure.find_or_create_by_path(parent)而不是newStructure.move_to_child_of(parent))…得到以下错误: “不能大规模分配受保护的属性:祖先,后代,世代” 这是使用newStructure.find_or_create_by_path(parent)的正确方法吗? def self.import(path) newStructure = FileOrFolder.find(:first, :conditions=>[“fullpath = ?”, path]) if newStructure return newStructure end newStructure = FileOrFolder.new newStructure.fullpath = path pathbits = path.split(‘/’) newStructure.name = pathbits.last newStructure.save parentpath = path.sub(/#{Regexp.escape(pathbits.last)}$/, ”) if parentpath.length > 1 parentpath.sub!(/\/$/,”) parent = FileOrFolder.find(:first, :conditions=>[“fullpath = ?”, parentpath]) unless parent parent = FileOrFolder.import(parentpath) end #newStructure.move_to_child_of(parent); […]

Ruby工具浏览已安装的gems代码

我正在使用gem,我无法弄清楚如何使用特定的方法。 目前要了解它是如何工作的,我必须去github,搜索gem实现代码来自依赖,搜索代码repo为其他gem,实现它的另一个gem,找到它,找到类,然后从那里开始从一个类到另一个类,打开很多浏览器选项卡。 我在Linux上使用sublime文本。 是否有一些工具可以让我直接从gem访问代码?

OS X Lion上的RubyGems问题

我创建了一个新的RoR应用程序,但每当我运行bundle install (其他gems安装RSpec)时,我会收到以下错误: Gem :: Package :: FormatError:在/Users/petarpetrovic/.rvm/gems/ruby-1.9.3-p194/cache/selenium-webdriver-2.22.0.gem中找不到元数据安装selenium-webdriver时发生错误( 2.22.0),而Bundler无法继续。 在捆绑之前确保gem install selenium-webdriver -v ‘2.22.0’成功。 当我运行gem install selenium-webdriver -v ‘2.22.0’ ,收到以下错误消息: 错误:安装selenium-webdriver时出错:/Users/petarpetrovic/.rvm/gems/ruby-1.9.3-p194/cache/selenium-webdriver-2.22.0.gem的gem格式无效 我尝试从缓存文件夹中手动删除gem,然后重新运行bundle install但我仍然收到相同的错误消息。 任何想法如何解决这一问题?

是否可以从Heroku的私有gitlab主机安装gem

我有一个私有的gitlab主机,它托管私有代码和项目,我在heroku中托管我的应用程序,在那个heroku应用程序中,我们使用Gemfile来管理heroku app的依赖,其中一个依赖来自私有gitlab主机。 所以我的Gemfile是这样的: gem ‘my_greate_gem’, ‘0.0.1’, :git => “http://myprivate_gitlab_host/private_gems/my_great_gem.git” 似乎没有任何关于使用私有gitlab主机在Heroku中托管gem的教程,但我真的不想使用gemfury。 这有什么可能的解决方案吗?

无法安装gem ffi – Windows 7 64位

我是学习Cucumber / Ruby的新手。 我曾尝试安装gem’ffi’但是当我从控制台执行此操作时,我收到以下消息: 安装ffi时出错:ffi(> = 0)的最后一个版本支持你的Ruby和RubyGems使用gem install ffi -v 1.9.18 ffi gem install ffi -v 1.9.18它需要Ruby版本 = 2.0。 目前的ruby版本为2.5.0。

Rails:gem.config&rake gems:install – 没有要加载的文件

我正在尝试使用config / environment.rb来安装ruby gem依赖项(因为我没有sudo访问我们的服务器; ergo,不能只调用gem install hpricot )。 我试过包含各种各样的参数( :version , :source , :lib )但我仍然得到rake aborted! no such file to load — hpricot rake aborted! no such file to load — hpricot 更新:事实certificate,当我删除需要hpricot的插件时,我可以执行rake gems:install successfully。 但那不是很有帮助。 这意味着,如果我移动我的应用程序,我遇到了无法掠夺它的gem的问题(因为我将重新安装插件并添加依赖它的function)。 这应该怎么样? 系统: WinXP,Ruby 1.8.7,Rails 2.3.5