rubygems

rbenv and bundler: “bad interpreter: No such file or directory”

不问归期 提交于 2020-01-01 04:18:55
问题 I messed up my configuration. I am running Ubuntu 14.04 and had some issues when I tried to move from a project to an other. I tried to uninstall and reinstall rbenv and then installed Ruby 2.1.7 following this guide: https://gorails.com/setup/ubuntu/14.04. Now, when I run gem install bundler nothing happens and I can't install any gems. When I type bundler or bundler -v I see this: /usr/local/bin/bundler: /usr/bin/ruby1.9.1: bad interpreter: No such file or directory I spent many hours

Where does Ruby's have_header method look for header files?

百般思念 提交于 2020-01-01 03:21:17
问题 On a CentOS 5.7 box, I'm having trouble installing the newest version of the mysql2 gem; it's not finding errmsg.h: /usr/bin/ruby extconf.rb checking for rb_thread_blocking_region()... yes checking for rb_wait_for_single_fd()... no checking for mysql_query() in -lmysqlclient... yes checking for mysql.h... no checking for mysql/mysql.h... yes checking for errmsg.h... no ----- errmsg.h is missing. please check your installation of mysql and try again. ----- *** extconf.rb failed *** The mysql

Can't run rails server after accidentally running $ gem update --system

旧城冷巷雨未停 提交于 2020-01-01 01:40:08
问题 I ran gem update --system thinking it would solve a problem I was having, and now I can't run rails server . It won't load and instead, I keep getting the following. Can someone tell me how to undo this and revert back to before I ran the update? I've already ran git checkout , but the problem persists... /usr/local/rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.5/lib/bundler/rubygems_integration.rb:187:in `stub_source_index170': uninitialized constant Gem::SourceIndex (NameError) from /usr

unpacking/freezing gems into a non-rails ruby app

泪湿孤枕 提交于 2020-01-01 00:45:21
问题 I'm writing a non-Rails ruby application (gasp!) and would like to be able to include all the gem dependencies which the application requires in a vendor subdirectory. This would be similar to how http://gemsonrails.rubyforge.org/ works for Rails apps. The goal here is to avoid the situation my team currently experiences when a new dependency is added. Every developer on my team has to install the gem manually, and then someone has to manually update each test and staging and production

How to get list of all countries and cities in rails?

北城余情 提交于 2019-12-31 21:43:10
问题 Is there a country and city gem where user will be able to select a country and based on selected country he will select a city? I get multiple solution but they all support states not cities gem 'country_select' gem 'countries' gem 'carmen-rails' I want a list of all countries on dropdown and when I select any country then all cities of country will appear in cities dropdown. Is this possible through any gem? 回答1: Use the aptly named city-state gem. As seen by the README, you can do: CS

Ruby gem listed, but won't load (gem in user dir, not ruby dir)

混江龙づ霸主 提交于 2019-12-31 20:30:34
问题 I'm trying to get some gems working on a web-host which supports ruby and some ruby gems, but not some of the ones I need to use. Following the instructions I found here, I kept the original gem location in my gem path, and added my own at /path/to/my/home/gems to ~/.gemrc gemhome: /users/home/myuser/gems gempath: - /usr/local/lib/ruby/gems/1.8 - /users/home/mysuser/gems I downloaded some gems manually and did installs using the --local and --install-dir options of the gem command. I then did

ERROR: While executing gem … (TypeError) incompatible marshal file format (can't be read)

被刻印的时光 ゝ 提交于 2019-12-31 19:31:22
问题 I encountered this issue when I run bundle install with Ruby version 2.4.4 and macOS Mojave: Fetching nokogiri 1.8.5 Installing nokogiri 1.8.5 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension. ERROR: cannot discover where libxml2 is located on your system. please make sure `pkg-config` is installed. So I ran xcode-select --install But then when I run gem install nokogiri I got the following output: ERROR: While executing gem ... (TypeError) incompatible

ERROR: While executing gem … (TypeError) incompatible marshal file format (can't be read)

我的未来我决定 提交于 2019-12-31 19:30:08
问题 I encountered this issue when I run bundle install with Ruby version 2.4.4 and macOS Mojave: Fetching nokogiri 1.8.5 Installing nokogiri 1.8.5 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension. ERROR: cannot discover where libxml2 is located on your system. please make sure `pkg-config` is installed. So I ran xcode-select --install But then when I run gem install nokogiri I got the following output: ERROR: While executing gem ... (TypeError) incompatible

memorable name generator gem for ruby

流过昼夜 提交于 2019-12-31 17:37:55
问题 Before I go roll my own and start pulling out the dictionary, does anyone know a rubygem to generate memorable names suitable for app keys. I need something pronounceable so that I can give users unique email addresses to submit content to. I like Heroku's naming for it's apps as an example. floating-sky-58 simple-fog-45 回答1: You can use randexp gem. It's use the dictionnary from your OS ( UNIX only ) with randexp gem you can do something like : /[:word:]-[:word:]-\d+/.gen and have like

How to upgrade Ruby to 2.0

帅比萌擦擦* 提交于 2019-12-31 13:02:00
问题 My ruby version is ruby 1.9.3p374 (2013-01-15) [i386-mingw32] and I am running under Windows 8 with mingw installed. How can I upgrade it to ruby 2.0 ? 回答1: Pik let you play with and manage multiple versions and flavours of ruby on on your Windows box. I have chosen this way because I'm not sure that everything I need will work on the first try with the new version, hence I want also to keep prior versions. The installation is also simple: if you haven't jet Pik see topic: "Install pik using