Tag: gem

Bundler找不到gem“sass”的兼容版本

我正在使用中间人3.3.9和 gem ‘sass-rails’, ‘~> 4.0.3’ gem ‘bootstrap-sass’, ‘~> 3.3.1’ gem ‘bootstrap-timepicker-rails’ gem ‘sass’, ‘~> 3.2.19’ 当我运行bundle install时,我收到此错误: Bundler could not find compatible versions for gem “sass”: In Gemfile: middleman (~> 3.3.9) ruby depends on sass (= 3.4.0) ruby sass (3.2.19) 我怎么能通过这个?

切换到捆绑器后如何消除gem错误

我最近切换到使用bundler,现在我随时在rails应用程序的scripts /文件夹下运行脚本时收到以下警告: config.gem: Unpacked gem environment.rb in vendor/gems has no specification file. Run ‘rake gems:refresh_specs’ to fix this. config.gem: Unpacked gem environment.rb in vendor/gems not in a versioned directory. Giving up. config.gem: Unpacked gem ruby in vendor/gems has no specification file. Run ‘rake gems:refresh_specs’ to fix this. config.gem: Unpacked gem ruby in vendor/gems not in […]

Rails失败和奇怪的捆绑安装

有一点我无法弄清楚。 当我尝试运行rails它会说: Could not find sprockets-2.1.2 in any of the sources Run `bundle install` to install missing gems. 顺便说一句,安装了sprockets-2.1.2 。 (我已成功运行bundle install ) 但据我所知,当我运行rails ,全局bin正在运行,因此我无法访问由bundler安装的本地gem。 我可以以某种方式解决这个问题,而无需手动安装很多gem,如: gem install what -v which? 我已经尝试过运行rails了 bundle exec rails … 我没有运气:( 我正在使用RVM(如果这可能是问题的根源

env:ruby_noexec_wrapper:没有这样的文件或目录错误

运行此命令后,我经常收到此错误…. bundle clean –force 在我的rails项目.. 我怎样才能解决这个问题?

如何安装json gem – 无法构建gem原生扩展

我正在尝试将rails应用程序部署到我的ubuntu linux服务器上。 我正在使用capistrano和bundler,当它安装gem时,它失败并出现此错误: Installing json (1.7.7) with native extensions Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. /opt/ruby-enterprise-1.8.7-2012.02/bin/ruby extconf.rb creating Makefile make /usr/bin/gcc -I. -I/opt/local/include -I/opt/ruby-enterprise-1.8.7- 2012.02/lib/ruby/1.8/i686-linux -I/opt/ruby-enterprise-1.8.7-2012.02/lib/ruby/1.8/i686-linux -I. -D_FILE_OFFSET_BITS=64 -fPIC -g -O3 -Wall -c parser.c In file included from /usr/include/i386-linux-gnu/bits/posix1_lim.h:157:0, from /usr/include/limits.h:145, from /usr/lib/gcc/i686-linux-gnu/4.6/include-fixed/limits.h:169, from /usr/lib/gcc/i686-linux-gnu/4.6/include-fixed/syslimits.h:7, from /usr/lib/gcc/i686-linux-gnu/4.6/include-fixed/limits.h:34, from /opt/ruby-enterprise-1.8.7-2012.02/lib/ruby/1.8/i686-linux/ruby.h:95, from ../fbuffer/fbuffer.h:6, from parser.rl:1: […]

Rails Gemfile:在开发中使用一行,在生产中使用另一行

我们在生产中使用Heroku运行Unicorn,但在本地机器上使用Webrick进行开发。 我们无法在本地计算机上安装Unicorn。 是否有可能让Rails仅在生产中加载Unicorn gem? 现在,我们的解决方案是在本地运行应用程序时注释掉Unicorn gem,并在推送到Heroku时取消注释gem。 我们在Rails 3.2.12上。 的Gemfile: source ‘http://rubygems.org’ gem ‘rails’, ‘3.2.12’ gem ‘jquery-rails’ # # ========================================================================================= # # #========================================================================================= gem ‘mongo’ gem ‘mongo_mapper’ gem ‘plucky’ gem ‘bson_ext’ gem ‘bson’ gem ‘newrelic_rpm’ gem ‘rpm_contrib’ # Gems used only for assets and not required # in production environments by default. group :assets do gem […]

Rails – 使用rubygems安装电子表格gem时出错

我希望能够在rails中处理excel spreadhseets。 所以我正在使用spreadsheet库。 但是,当我使用rubygems安装电子表格时,我得到一个例外: Successfully installed spreadsheet-0.7.1 1 gem installed Installing ri documentation for spreadsheet-0.7.1… unable to convert “\xE2” to UTF-8 in conversion from ASCII-8BIT to UTF-8 to GBK for lib/spreadsheet/excel/internals.rb, skipping unable to convert “\xE2” to UTF-8 in conversion from ASCII-8BIT to UTF-8 to GBK for lib/spreadsheet/excel/reader/biff8.rb, skipping unable to convert “\xE2” to UTF-8 […]

awesome_nested_fieldsgem嵌套表单未显示

我一直遇到嵌套表单的问题 – 所以我试图使用以下gem: https : //github.com/lailsonbm/awesome_nested_fields 。 不幸的是,嵌套的forms(态度)没有出现在任务表单中 – 我试图完全遵循指示 – 我希望它是愚蠢的东西。 加载表单时,我没有收到任何错误。 任务模型 class Task < ActiveRecord::Base has_many :attitudes accepts_nested_attributes_for :attitudes, allow_destroy: true attr_accessible :attitudes_attributes end 态度模型 class Attitude < ActiveRecord::Base belongs_to :task accepts_nested_attributes_for :task attr_accessible :tasks_attributes 结束 任务表格 remove Add Attitudes 当我查看html源代码时,我看到了这一点 <fieldset class=”item”> <label for=”task_attitudes_attributes_new_nested_item_name”>Name</label> <input id=”task_attitudes_attributes_new_nested_item_name” name=”task[attitudes_attributes][new_nested_item][name]” size=”30″ type=”text” /> <a […]

Rails4和Devise(NoMethod错误)

我正在学习如何使用rails gem在ruby上构建Web应用程序。 遵循本教程: http : //12devs.co.uk/articles/writing-a-web-application-with-ruby-on-rails/ 在我开始为用户身份validationfunction安装Devise gem之前,一切都很好。 在执行rails generate devise:install之后我收到错误 错误报告是这个史诗(看起来我以某种方式搞砸了一些依赖): sergey@sergey-VirtualBox:~/Bookmarks$ rails generate devise:install /home/sergey/.rvm/gems/ruby-2.1.2/gems/activerecord-4.1.0/lib/active_record/dynamic_matchers.rb:26:in `method_missing’: undefined method `devise’ for Install (call ‘Install.connection’ to establish a connection):Class (NoMethodError) from /home/sergey/Bookmarks/app/models/install.rb:4:in `’ from /home/sergey/Bookmarks/app/models/install.rb:1:in `’ from /home/sergey/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:443:in `load’ from /home/sergey/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:443:in `block in load_file’ from /home/sergey/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:633:in `new_constants_in’ from /home/sergey/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:442:in `load_file’ from /home/sergey/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:342:in `require_or_load’ from /home/sergey/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:480:in […]

为什么我的rake调用导致’未定义的方法`source_index`’错误?

我试图运行bundle exec rake db:migrate然后遇到以下错误。 bundle exec rake db:migrate –trace ** Invoke db:migrate (first_time) ** Invoke environment (first_time) ** Execute environment rake aborted! undefined method `source_index’ for Gem:Module C:/Ruby193/lib/ruby/gems/1.9.1/gems/rails-2.3.17/lib/rails/gem_dependency.rb:21:in `add_frozen_gem_path’ C:/Ruby193/lib/ruby/gems/1.9.1/gems/rails-2.3.17/lib/initializer.rb:298:in `add_gem_load_paths’ C:/Ruby193/lib/ruby/gems/1.9.1/gems/rails-2.3.17/lib/initializer.rb:132:in `process’ C:/Ruby193/lib/ruby/gems/1.9.1/gems/rails-2.3.17/lib/initializer.rb:113:in `run’ C:/Program Files/chiliproject-3.7.0/config/environment.rb:42:in `’ C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-2.3.17/lib/active_support/dependencies.rb:182:in `require’ C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-2.3.17/lib/active_support/dependencies.rb:182:in `block in require’ C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-2.3.17/lib/active_support/dependencies.rb:547:in `new_constants_in’ C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-2.3.17/lib/active_support/dependencies.rb:182:in `require’ C:/Ruby193/lib/ruby/gems/1.9.1/gems/rails-2.3.17/lib/tasks/misc.rake:4:in `block in ‘ C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/task.rb:228:in `call’ C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/task.rb:228:in […]