rubygems

How to add a new link in Active scaffold rails 3

风格不统一 提交于 2019-12-10 21:18:22
问题 I need to add a new link 'map' in my Taxis listing page, I am using active-scaffold and Rails 3.2.1. My current page looks like the below. I need to show a link 'map' similar to edit/delete/show in each record. In my database I have fields name, lat, lng. How can this be done. Please help. 回答1: You have to add your link in the configure part in your controller. I did it like this: controller Admin::TaxisController < Admin::ApplicationController active_scaffold :taxi do |config| config.action

In Ruby on Rails, what's the difference between installing something as a gem or as a plugin?

妖精的绣舞 提交于 2019-12-10 20:50:58
问题 On http://github.com/collectiveidea/delayed_job it says: To install as a gem, add the following to config/environment.rb: config.gem 'delayed_job' Run rake gems:install versus To install as a plugin: script/plugin install git://github.com/collectiveidea/delayed_job.git What is the difference between installing it as a gem or as a plugin? Also, the first method just install gem 2.0.3 which might be the tobi's version? ( rake gems:install installs the version by gem list -r delayed_job ) Is it

Failed to recognize type of 'location'. It will be treated as String

不打扰是莪最后的温柔 提交于 2019-12-10 19:52:48
问题 I'm trying to use the gem activerecord-postgis-adapter and when i try to execute this code : require 'active-record' require 'pg' require 'active record-postgis-adapter' class Place < ActiveRecord::Base record = Place.find(1) line = record.location puts line.srid end srid is a method of activerecord-postgis-adapter and here i'm trying to display the srid of my geographical column (location) but the console keeps telling me Failed to recognize type of 'location'. It will be treated as String.

error failed to build json gem native extension on windows 7x64

一笑奈何 提交于 2019-12-10 19:38:00
问题 I am trying to install devkit and then to install json gem on Windows7 64bits, I have installed ruby 4.2.4 & extracted devkit configured config.yml and run ruby dk.rb install and then when i run gem install JSON --platform=ruby but it gives error as follows : current directory: C:/Ruby22/lib/ruby/gems/2.2.0/gems/json-1.8.3/ext/json/ext/generator C:/Ruby22/bin/ruby.exe -r ./siteconf20160205-1668-13fh07v.rb extconf.rb creating Makefile current directory: C:/Ruby22/lib/ruby/gems/2.2.0/gems/json

Can't install json 1.8 gem on Mac OS X 10.8.4

ぃ、小莉子 提交于 2019-12-10 19:08:09
问题 I'm trying to to install my rails app on a second computer. But when I run bundle install I get an error with the json gem: Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. /Users/feuerball/.rvm/rubies/ruby-2.0.0-p195/bin/ruby extconf.rb /Users/feuerball/.rvm/rubies/ruby-2.0.0-p195/bin/ruby: invalid option -D (-h will show valid options) (RuntimeError) Gem files will remain installed in /Users/feuerball/.rvm/gems/ruby-2.0.0-p195/gems/json-1.8.0 for inspection.

Nokogiri native extension failing to build (Not libxml2 or libxslt missing issue)

烈酒焚心 提交于 2019-12-10 18:51:22
问题 As the title says, it doesn't seem to be failing because libxml2 or libxslt is missing. I'm not really sure what to make of the error. (Get it? Because the issue is during make? hehe...) Anywho, here's the output I'm getting. Any ideas would be appreciated: Building native extensions. This could take a while... ERROR: Error installing nokogiri: ERROR: Failed to build gem native extension. /usr/bin/ruby1.9.1 extconf.rb extconf.rb:10: Use RbConfig instead of obsolete and deprecated Config.

Rails new gives “Could not find proper version of railties (4.2.5.1) in any of the sources” error

主宰稳场 提交于 2019-12-10 18:26:10
问题 I am trying to use Rails 5.0.0.rc1 with Ruby 2.3.1. However, if I try to create a new project within my "programming" directory, I get this:  ➜ ~/Documents/Programming rails new foo Could not find proper version of railties (4.2.5.1) in any of the sources Run `bundle install` to install missing gems. If I do a gem list, the only rails version I have installed in 5.0.0.rc1. What is interesting is I get the same error when I do rails -v, but do not when I do it from my home directory:  ➜ ~

how to install production group in the Gemfile

China☆狼群 提交于 2019-12-10 17:50:23
问题 my gem file consists : group :production do gem 'pg', '0.17.1' gem 'rails_12factor', '0.0.2' gem 'puma', '2.11.1' end when i give the bundle install command ,at the end i get the line "Your bundle is complete! Gems in the group production were not installed. Use `bundle show [gemname]` to see where a bundled gem is installed." How to install production group.? 回答1: in your .bundle/config file you probably have this line: BUNDLE_WITHOUT: production Just delete this line, and the bundle install

Error when trying to run gem install

回眸只為那壹抹淺笑 提交于 2019-12-10 17:23:54
问题 I'm trying to get rails up and running on my development server. It's a fedora14 box. I installed rvm, ruby 1.8.7, and rubygems 1.6.2. When I try to install rails via gem, gem install rails , i get the following error: ERROR: Loading command: install (LoadError) no such file to load -- zlib ERROR: While executing gem ... (NameError) uninitialized constant Gem::Commands::InstallCommand Any ideas as to what is going on. I'm 100% new to ruby/rubygems/rails and I know enough about Linux to be

gem install: ERROR: Failed to build gem native extension

我与影子孤独终老i 提交于 2019-12-10 17:22:26
问题 I am using Arch Linux and installed Ruby (this is version 2.0.0). When I installed Ruby it said I should add: $(ruby -rubygems -e "puts Gem.user_dir")/bin to my path, I added it to .bashrc When I try to gem install rails or any other gem it gives the Error: Failed to build gem native extension. this is the full error: ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /usr/lib/ruby/gems/2.0.0 directory. [alexander@localhost ~]$ sudo gem install