Bundler似乎正在安装我不需要的宝石,它们正在引发问题.我们举两个例子:timers和celluloid
bundle install安装timers是必需的,celluloid但我不知道为什么要安装赛璐珞.我正在使用ruby 1.8.7和rails 3.2.13.
为什么celluloid要安装?如何查找未安装(无法安装)的gem的反向依赖项?
我的Gemfile
source "https://rubygems.org"
gem "rails", "3.2.13"
gem "mysql2", "~> 0.3.13"
gem "json", "~> 1.8.0"
group :assets do
gem "guard-rails-assets", "~> 0.1.3"
gem "sass-rails", "~> 3.2.6"
gem "coffee-rails", "~> 3.2.2"
gem "uglifier", "~> 1.0.3"
end
gem "jquery-rails", "~> 3.0.4"
gem "simple_form", "~> 2.1.0"
gem "bootstrap-sass", :path => "gems/bootstrap-sass-c0e12a90ba3e"
gem "client_side_validations", "~> 3.2.6"
gem "client_side_validations-simple_form", "~> 2.1.0"
gem "therubyracer", :platform => :ruby
gem "require_relative", "~> 1.0.3" …Run Code Online (Sandbox Code Playgroud) 现在我正在研究Rails 3版本.我想在我的应用程序中创建图表.我正在使用lazy_high_charts宝石,请帮助我另一种可能的方式.如何做到这一点?
嗨,我无法在我的mac(Mavericks 10.9.2)上安装rvm之后:
curl -sSL -k https://get.rvm.io | bash -s stable --ruby
Run Code Online (Sandbox Code Playgroud)
我得到输出:
Unknown option: n
Unknown option: 1
Usage: head [-options] <url>...
-m <method> use method for the request (default is 'HEAD')
-f make request even if head believes method is illegal
-b <base> Use the specified URL as base
-t <timeout> Set timeout value
-i <time> Set the If-Modified-Since header on the request
-c <conttype> use this content-type for POST, PUT, CHECKIN
-a Use text mode for content I/O …Run Code Online (Sandbox Code Playgroud) 如果我这样做:
Rails生成控制器欢迎索引
我得到:
/usr/local/share/ruby/gems/2.0/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:251:在'require'中:无法加载此类文件-io /控制台(LoadError)
但是我的宝石列表显示控制台已安装:
宝石清单
*当地的宝石*
动作邮件程序(3.2.17)
动作包(3.2.17)
活动模型(3.2.17)
活动记录(3.2.17)
activeresource(3.2.17)
主动支持(3.2.17)
竞技场(3.0.3)
大十进制(1.2.5,1.2.0)
建造者(3.0.4)
捆绑器(1.6.2)
咖啡轨(3.2.2)
咖啡脚本(2.2.0)
coffee-script-source(1.7.0)
erubis(2.7.0)
execjs(2.0.2)
远足(1.2.3)
i18n(0.6.9)
io控制台(0.4.2)
旅程(1.0.4)
jquery-rails(3.1.0)
json(1.8.1,1.7.7)
邮件(2.5.4)
哑剧类型(1.25.1)
multi_json(1.9.2)
多种语言(0.3.4)
心理(2.0.5,2.0.0)
机架(1.4.5)
机架缓存(1.2)
机架SSL(1.3.4)
机架测试(0.6.2)
导轨(3.2.17)
(3.2.17)
耙子(10.3.0)
rdoc(4.1.1、4.0.1、3.12.2)
无礼(3.3.5)
粗轨(3.2.6)
链轮(2.2.2)
sqlite3(1.3.9)
雷神(0.19.1)
倾斜(1.4.1)
树梢(1.4.15)
tzinfo(0.3.39)
uglifier(2.5.0)
以root身份运行。
如果我这样做:
宝石环境
我得到:
RubyGems环境:
宝石红版本:2.0.14
橄榄球版本:2.0.0(2014-02-24补丁程序级别451)[x86_64-linux]
安装目录:/usr/local/share/ruby/gems/2.0
可执行的RUBY:/usr/bin/ruby2.0
执行目录:/ usr / local / bin
RUBYGEMS平台:
红宝石
x86_64-linux
创业板路径:
/usr/local/share/ruby/gems/2.0
/root/.gem/ruby/2.0
/usr/share/ruby/gems/2.0
宝石配置:
:update_sources =>是
:verbose => true
:backtrace …
我得到以下错误.
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 `<main>'
Run Code Online (Sandbox Code Playgroud)
我的Gemrc文件如下:
cat .gemrc
---
gem: --remote --gen-rdoc --run-tests
gemhome: /home/adsudxuy/ruby/gems
gempath: [/opt/ruby/lib/ruby/gems/1.9.1,
/home/adsudxuy/ruby/gems]
rdoc: --inline-source --line-numbers
Run Code Online (Sandbox Code Playgroud)
我的bash配置文件如下:#start#.bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific …Run Code Online (Sandbox Code Playgroud) 我已经从Apple网站手动安装了Xcode命令行工具,我完成了安装过程,但似乎没有工作.我从终端运行这个以查看它是否已安装:
Zach-Boyette-MacBook-Pro-2:~ zachboyette$ pkgutil --pkg-info=com.apple.pkg.CLTools_Executables
package-id: com.apple.pkg.CLTools_Executables
version: 5.1.0.0.1.1396320587
volume: /
location: /
install-time: 1398301024
groups: com.apple.FindSystemFiles.pkg-group com.apple.DevToolsBoth.pkg-group com.apple.DevToolsNonRelocatableShared.pkg-group
Run Code Online (Sandbox Code Playgroud)
所以看起来命令行工具已经安装,但是当我运行它时:
Zach-Boyette-MacBook-Pro-2:~ zachboyette$ xcode-select --install
弹出窗口说:"xcode-select"命令需要命令行开发人员工具.你想现在安装这些工具吗?
我点击安装然后说:无法安装软件,因为它目前无法从软件更新服务器获得.
我已经阅读了其他答案,解决方案是手动安装,但我只是这样做,所以我不明白为什么它不起作用.此外,在Xcode下载中,它没有显示命令行工具.
我已尝试多次手动安装它,所以我不知道它为什么不起作用.
安装Jekyll仍然无法正常工作:
Zach-Boyette-MacBook-Pro-2:~ zachboyette$ sudo gem install jekyll
Password:
Building native extensions. This could take a while...
ERROR: Error installing jekyll:
ERROR: Failed to build gem native extension.
EDIT: echo $PATH returns this:
Zach-Boyette-MacBook-Pro-2:~ zachboyette$ echo $PATH /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/zachboyette/.rvm/bin
Run Code Online (Sandbox Code Playgroud) 我已经从git来源安装了gem:
gem 'padrino', git: 'git@github.com:padrino/padrino-framework.git'
Run Code Online (Sandbox Code Playgroud)
我如何找到它在机器上的位置?
我团队的项目要求我使用vagrant-berkshelf插件,特别是版本1.3.7.团队中的其他人正在运行Vagrant 1.3.5,尽管我已尝试在1.2.7,1.3.5和1.4.3上安装,但都具有相同的错误.
安装时输出:
mentat@odrade:~$ vagrant plugin install vagrant-berkshelf --plugin-version 1.3.7
Installing the 'vagrant-berkshelf --version '1.3.7'' plugin. This can take a few minutes...
/opt/vagrant/embedded/lib/ruby/2.0.0/rubygems/dependency_installer.rb:211:in `gather_dependencies': Unable to resolve dependencies: ridley requires buff-extensions (~> 0.3); buff-config requires buff-extensions (~> 0.3); varia_model requires buff-extensions (~> 1.0) (Gem::DependencyError)
from /opt/vagrant/embedded/lib/ruby/2.0.0/rubygems/dependency_installer.rb:333:in `install'
from /opt/vagrant/embedded/gems/gems/vagrant-1.4.3/plugins/commands/plugin/action/install_gem.rb:65:in `block in call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.4.3/plugins/commands/plugin/gem_helper.rb:42:in `block in with_environment'
from /opt/vagrant/embedded/lib/ruby/2.0.0/rubygems/user_interaction.rb:40:in `use_ui'
from /opt/vagrant/embedded/gems/gems/vagrant-1.4.3/plugins/commands/plugin/gem_helper.rb:41:in `with_environment'
from /opt/vagrant/embedded/gems/gems/vagrant-1.4.3/plugins/commands/plugin/action/install_gem.rb:52:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/warden.rb:34:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.4.3/plugins/commands/plugin/action/bundler_check.rb:20:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/warden.rb:34:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/builder.rb:116:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/runner.rb:69:in …Run Code Online (Sandbox Code Playgroud) 我rails server在我的app目录中键入命令并收到此错误:
bin/rails:6: warning: already initialized constant APP_PATH /Users/user/Repositories/simple_cms/bin/rails:6: warning: previous definition of APP_PATH was here Usage: rails COMMAND [ARGS]
Run Code Online (Sandbox Code Playgroud)
然后我导航到bin/rails目录以找出APP_PATH是什么.这是我在第6行找到的:APP_PATH = File.expand_path('../../config/application', __FILE__)
不想直接改变这个文件,我按照github上发现的建议,并'spring', group: :development从我的评论中评论了宝石Gemfile
我rails server再次尝试了该命令并收到了同样的错误,所以我取消注释'spring', group: :development并rails server最后一次尝试.
这一次,我第二次围绕一个完全不同的错误... http://pastebin.com/bPYgufBH
为什么我不能启动我的服务器?
假设我使用了宝石csv.
通过控制台中的以下内容,我获得了所有实例方法的列表:
require "csv"
csv = CSV.open(FILE_NAME, "a+")
csv.methods
Run Code Online (Sandbox Code Playgroud)
我现在在列表中找到的一种方法是例如first.
我可以从命令行获取有关此方法的信息吗?(是的,我知道我可以谷歌搜索文档.)