Tag:

Rails捆绑,gem冲突,解决它的最佳方法

我遇到麻烦使用Bundle来解决gem冲突。 无法激活[“activemodel-3.0.8”,“actionpack-3.0.8”,“railties-3.0.8”]的构建器(〜> 2.1.2,运行时),已激活builder-3.0.0 [ “cucumber-0.10.6”](Gem :: LoadError) 所以这意味着当黄瓜需要版本3.0.0时,active *需要builder v 2.1.2。 容易,但…… 我该怎么办呢? 低档黄瓜? 我尝试了捆绑更新但是…接缝最后版本的活动模型,包和铁路是3.0.8。 我怎么能知道黄瓜版与活跃的建造者兼容? 那么,一般来说解决这种情况的一般方法是什么?

执行Nokogiri测试仪时需要“open-url”加载错误

我试图跟随RailsCast使用Nokogiri。 我的测试脚本文件中只有几个非常基本的行: require ‘rubygems’ require ‘nokogiri’ require ‘open-url’ url = “http://www.walmart.com/search/search-ng.do?search_constraint=0&ic=48_0&search_query=Batman&Find.x=0&Find.y=0&Find=Find” doc = Nokogiri::HTML(open(url)) puts doc.at_css(“title”).text 但是当我执行它时,我遇到了一个错误: /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:54:in `require’: cannot load such file — open-url (LoadError) from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:54:in `require’ from nokogiri.test.rb:3:in `’ 我按照以下说明安装了open url gem: https : //github.com/openurl/openurl如何修复错误消息?

在Windows上安装捆绑包时出错

当我尝试运行bundle install时,我收到此错误: Installing hiredis (0.3.2) with native extensions Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. C:/RailsInstaller/Ruby1.9.2/bin/ruby.exe extconf.rb gcc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb net.c net.c:1:0: warning: -fPIC ignored for target (all code is position independent) net.c:35:24: fatal error: sys/socket.h: No such file or directory compilation terminated. make: *** […]

Ruby on Rails无法捆绑安装

Ruby版本:2.1.5p273 Rails版本:4.2.0 gem版:2.2.2 操作系统:Windows 7 x64 您好,我对rails编程非常新。 我想开始学习,但不能 因为这些问题。 我创建了一个rails应用程序 我输入:> rails new app 然后我导航到创建的文件夹 我输入:> rails server 它告诉我 “运行’捆绑安装’来安装丢失的gem。” 我这样做而不是告诉我: “在捆绑之前确保’gem install debugger-linecache -v’1.2.0’成功’” 在安装所述gem之后我再次尝试捆绑安装,但它比不同的gem重复相同的错误。 “”Make sure that ‘gem install *random gem* -v ‘*random version*’ succeeds before bundling'”” 我几乎不知道我在这里做什么。 如何让这台服务器运行?

Bundler没有加载gem

我一直有使用Bundler的问题,能够访问我的gem,而不必在某处需要它们,因为config.gem曾经为我这样做(据我所知)。 在我的Rails 3应用程序中,我定义了我的Gemfile如下所示: clear_sources source “http://gemcutter.org” source “http://gems.github.com” bundle_path “vendor/bundler_gems” ## Bundle edge rails: git “git://github.com/rails/arel.git” git “git://github.com/rails/rack.git” gem “rails”, :git => “git://github.com/rails/rails.git” ## Bundle gem “mongo_mapper”, :git => “git://github.com/jnunemaker/mongomapper.git” gem “bluecloth”, “>= 2.0.0” 然后我运行gem bundle ,它会像预期的那样将它们捆绑起来。 在boot.rb包含的environment.rb文件中,它看起来像这样: # DO NOT MODIFY THIS FILE module Bundler file = File.expand_path(__FILE__) dir = File.dirname(file) ENV[“PATH”] = “#{dir}/../../../../bin:#{ENV[“PATH”]}” […]

bundle使用错误的ruby版本

我想跑 env RAILS_ENV=test bundle exec rake db:migrate 并得到以下错误 Your Ruby version is 2.1.7, but your Gemfile specified 2.2.3 ruby -v 给我 ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin15] 我正在使用rbenv,如果这很重要的话。 rbenv versions提供以下内容: system * 2.2.3 (set by /Users/thatsme/Projects/demoproject/.ruby-version)所以我没有安装ruby 2.1.7 。 Spring没有运行,我运行rbenv rehash 。 然后安装bundler gem 。 我对此很疯狂。 有人可以告诉我为什么使用错误的ruby版本? 谢谢!

gem install kgio ERROR

我已经下载了一个rails开源webapp,当我开始使用时: C:\Users\admin\Downloads\iCare\icare-develop>rails server ←[31mCould not find kgio-2.8.0 in any of the sources←[0m ←[33mRun `bundle install` to install missing gems.←[0m 我尝试使用以下方法修复此错误: cmd:>gem install kgio -v ‘2.8.0’ 我收到了错误: Temporarily enhancing PATH to include DevKit… Building native extensions. This could take a while… ERROR: Error installing kgio: ERROR: Failed to build gem native extension.C:/Ruby193/bin/ruby.exe extconf.rb checking for CLOCK_MONOTONIC […]

Bundle install尝试使用缓存文件

当我尝试进行捆绑安装时,我的gem_path和gem_home指向/ usr / local / rvm / gems /,我没有写入权限,但由于权限无效而失败。 因为这个我已经改变了两个路径到我有写访问权的本地目录。 这样做,我做一个捆绑安装,我得到: bruno@test6:~$ bundle install Fetching gem metadata from https://rubygems.org/……… Fetching gem metadata from https://rubygems.org/.. Bundler::GemspecError: Could not read gem at /afs/varda.io/user/b/br/bruno/test6/cache/rake-10.1.0.gem. It may be corrupted. An error occurred while installing rake (10.1.0), and Bundler cannot continue. Make sure that `gem install rake -v ‘10.1.0’` succeeds […]

bundle.setup和bundle.require之间的区别是什么

在gemfile手册页中 ,我了解到有两种方法可以导入您在Gemfile指定的Gemfile 。 bundle.setup将“设置为Ruby的加载路径添加gem”,而bundle.require将需要所有的gem。 这两种方法有什么区别? 我应该在哪种情况下使用其中一种?

安装调试器时出错:无法使用ruby-1.9.3-p362构建gem本机扩展

在尝试为新项目运行bundle时,我遇到以下错误: Installing debugger (1.2.2) with native extensions Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. C:/Ruby193/bin/ruby.exe extconf.rb checking for rb_method_entry_t.called_id in method.h… no checking for rb_control_frame_t.method_id in method.h… no checking for rb_method_entry_t.called_id in method.h… no checking for rb_control_frame_t.method_id in method.h… no Makefile creation failed ************************************************************************** No source for ruby-1.9.3-p362 provided with debugger-ruby_core_source gem. ************************************************************************** *** […]