gem

In Ruby on Rails, is copying vendor/gems/somegem from one project to another project the same as freezing the gem?

倾然丶 夕夏残阳落幕 提交于 2019-12-11 04:18:45
问题 I was told that copying from vendor/gems/somegem from proj1 to proj2's folder will essentially freeze the gem into the project. The gem somegem is an internal gem, so there is no repository to install it from. But I wonder how will it work with Rails 3, since we need to use gem 'somegem' in the Gemfile, and supposedly when we do a gem list , the name of the gem should show up. What is a good / proper way to do this? thanks. 回答1: I believe the Gemfile.lock file stores the versions of the gems

mysql2 0.4.0 ruby gem require error

时光总嘲笑我的痴心妄想 提交于 2019-12-11 03:48:56
问题 I installed mysql2 gem using command: gem install mysql2 Done installing documentation for mysql2 after 0 seconds 1 gem installed But when I do require 'mysql2' , I get: LoadError: cannot load such file -- mysql2/mysql2 Even though the gem installed successfully, gem list mysql2 *** LOCAL GEMS *** mysql2 (0.4.0) I am using MacOSX with ruby 2.1.5p273 Any suggestions as to where should I be looking ? 回答1: Are you sure you have quoted gem name like this require 'mysql2' ? Please, show your

Long installing ri documentation for rails-4.0.2

帅比萌擦擦* 提交于 2019-12-11 03:44:58
问题 I'm have two machines with Ubuntu and Debian. I installed RVM on every machines, and installed latest stable ruby. But when i'm trying make gem install rails gem starting install all gems and stopping on "Installing ri documentation for rails-4.0.2". What i'm doing wrong? Thank you 回答1: It is good that it installs all dependency gems first, but strange that halts. How much time the installation of ri get? Anyway, to disable ri or rdoc installation, add the following file inside of your home

Don't Understand Bundler Interaction with Gems

冷暖自知 提交于 2019-12-11 03:42:49
问题 I thought I understood how Bundler works with gems, but after something that recently happened, I am not sure I have it right. I am developing an Rails application. To start off (and just so I would get familiar with the Rails environment which I haven't worked in before), I did not use an IDE. But, because I'm missing out on some of the advantages of an IDE, I just started using RubyMine. As part of the RubyMine setup, it asked to update all my gems for my existing project. After that, I

Error installing mysql2 gem ( windows 8 )

纵饮孤独 提交于 2019-12-11 03:34:40
问题 i'm currently trying to install the mysql2 gem on a windows 8 platform. I have installed the mysql_connector and used the following code below. But still seem to be getting the same error. What steps should I take to address this issue. C:\Users\Samuel>gem install mysql2 Temporarily enhancing PATH to include DevKit... Building native extensions. This could take a while... ERROR: Error installing mysql2: ERROR: Failed to build gem native extension. C:/Ruby200-x64/bin/ruby.exe extconf.rb

Ruby 2.0.0 cannot load such file even though gem is installed

懵懂的女人 提交于 2019-12-11 03:28:53
问题 I've tried all of the other solutions people have talked about on here, but none of them have helped / applied. I've written a Ruby script that requires the spreadsheet gem. The requiring works fine when I execute the script normally with ruby myscript.rb , but after running chmod +x myscript.rb , and then trying to run the program with ./myscript.rb I get the following error.... /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45

Check system dependencies for a gem

断了今生、忘了曾经 提交于 2019-12-11 03:25:33
问题 How I can check which system libraries I need for my gems ? For example the Mysql gem needs the mysql header files, rmagick requires imagemagick, and so on... How I can list all libraries needed to install the gem ? If it is not possible, how I can check if all system dependencies are satisfied to install the selected gem ? 回答1: Use the gem dependency GEMNAME command. See the documentation here. 来源: https://stackoverflow.com/questions/5714375/check-system-dependencies-for-a-gem

Does 'bundle install' install all the required gems on my computer permanently?

拈花ヽ惹草 提交于 2019-12-11 03:21:55
问题 I am new to rails and am learning about bundler. I understand that bundle install installs all the gems specified in the gemfile but where does it install them to? Does it install them on my computer permanently so that they can be used by any future project? If so doesnt this mean my computer gets filled with random gem versions and gem installs that I needed for one example project but may never use again? 回答1: By default, bundle install is going to install at the root level so all users on

Installing “libv8” gem for “therubyracer” on Windows

夙愿已清 提交于 2019-12-11 03:18:56
问题 I'm having trouble installing therubyracer gem on Windows. Using Ruby 2.1.6 32-bit and running gem install libv8 -v '3.16.14.3' -- --with-system-v8 This is the error I get: Installing therubyracer 0.12.1 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension. C:/Ruby21/bin/ruby.exe extconf.rb checking for main() in -lpthread... no checking for v8.h... no *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary

Bundler could not find compatible versions for gem “rack”:

北城余情 提交于 2019-12-11 02:59:29
问题 I am new to Ruby but actually I don't need it if I don't want to install Redmine. I am following the instructions at http://www.redmine.org/projects/redmine/wiki/HowTo_install_Redmine_on_CentOS_Detailed I have installed ruby 1.9 using rvm install 1.9.3 and ruby gems using... sudo yum install rubygems Then coming to the part of creating the Gemfile and register these gems in it # file: /var/www/redmine/Gemfile source "http://rubygems.org" gem "rake", "0.8.3" gem "rack", "1.1.0" gem "i18n", "0