gem

Rails currency exchange gem that works?

大兔子大兔子 提交于 2019-12-07 07:23:45
问题 Just wondering if anyone has used a currency exchange ruby gem that gets exchange rates from an external api and actually works. I have tried the following gems but have not been able to get any of them to function as described: goog_currency, yahoo_currency, google_currency, yahoo_finance_currency One of these uses deprecated code and hence does not work correctly. I am just trying to display a currency exchange rate in a rails view which has been grabbed from an external api. I have also

Facebook Graph API gem

我与影子孤独终老i 提交于 2019-12-07 07:13:35
问题 I wanted to use the Facebook graph API in my rails app. What is the recommended gem to work with the FB graph APIs? Thanks 回答1: This is a well written FB graph support for Ruby - https://github.com/nov/fb_graph 回答2: You can use the Koala gem from https://github.com/arsduo/koala 回答3: You can query the Graph API directly. The responses will be in JSON which you can then parse as needed. See the Facebook Documentation for more details on the specific functions you can call and sample JSON

what is the maximum amount of flags flag_shih_tzu can handle?

狂风中的少年 提交于 2019-12-07 07:10:22
问题 I'm using "flag_shih_tzu" gem and I want to know what is maximum amount of flags that it can handle, or is it depend on the int. length in the flags column? I need it to handle 64 flags. can it? 回答1: I am the maintainer of flag_shih_tzu. Best Practice: Each column used for flags should have at most 16 flags set, for performance reasons. You will find that performance suffers too much with columns holding more than 16 flags. Workaround: A single table can have multiple flag columns. I would

Making ruby gems respond to terminal commands

江枫思渺然 提交于 2019-12-07 06:10:51
问题 I am extremely new to ruby as well as gem making. I made a simple gem that webscrapes some information depending on the input. However, to use my gem I need to go into the interpreter (irb) and require my gem and then call the method with some parameters. Suppose the gem is called foo . Suppose the method is called print_website(x) # where x is a string . I want to be able to do something like: $ foo test.com and it should automatically call the method and execute it. Thanks in advance!

Rails 3 Installation Hangs at Gem Builder with “unable to convert ”\xF1“ from ASCII-8BIT to UTF-8”

旧街凉风 提交于 2019-12-07 05:40:38
问题 I followed this tutorial http://pragmaticstudio.com/blog/2010/9/23/install-rails-ruby-mac to install Ruby on Rails on Mac OS X (Lion 10.7). Everything went fine until I installed Rails with rvm (v. 1.6) when I received the following messages: Installing RDoc documentation for builder-3.0.0... unable to convert "\xF1" from ASCII-8BIT to UTF-8 for README, skipping unable to convert "\xF1" from ASCII-8BIT to UTF-8 for README.rdoc, skipping** (Builder version succesfully installed 2.1.2) and

Cannot install PG gem on Mac OSX

强颜欢笑 提交于 2019-12-07 05:13:41
问题 I created a new rails app: rails new -d postgresql However, I cannot get the pg gem to install. I had previously installed postgres using brew and it starts up automatically with my Mac. I have tried several things posted here on SO. I am using ruby 2.0. When running bundle install, I get the error: Errno::EACCES: Permission denied - /Library/Ruby/Gems/2.0.0/gems/pg-0.17.1/.gemtest An error occurred while installing pg (0.17.1), and Bundler cannot continue. Make sure that gem install pg -v '0

problems installing nokogiri gem on mac osx snow leopard with Ruby 2.0.0-p353

ぃ、小莉子 提交于 2019-12-07 05:02:25
问题 I have tried installing nokogiri on my rvm ruby 2.0.0-p353 using both homebrew and macports following instructions on the nokogiri installation page found here: http://nokogiri.org/tutorials/installing_nokogiri.html In both, I get exactly the same error message of bad file descriptor as shown below: → sudo gem install nokogiri Fetching: mini_portile-0.5.2.gem (100%) Successfully installed mini_portile-0.5.2 Fetching: nokogiri-1.6.1.gem (100%) Building native extensions. This could take a

Gem unf_ext failed to build gem native extension

走远了吗. 提交于 2019-12-07 04:45:18
问题 env => Mac. OS Yosemite. I got a project use ruby 2.1.3 . But when I bundle install, there's an error I can't fix. the gem unf_ext have problem here's my terminal message: $ gem install unf_ext -v '0.0.6' Building native extensions. This could take a while... ERROR: Error installing unf_ext: ERROR: Failed to build gem native extension. /Users/vincent/.rvm/rubies/ruby-2.1.3/bin/ruby extconf.rb checking for main() in -lstdc++... yes checking for ruby/encoding.h... yes creating Makefile make

json gem won't install on Windows

假装没事ソ 提交于 2019-12-07 04:10:31
问题 Here is the error I keep getting. I installed DevKit and followed all the instructions. gem install json -v '1.6.3' Temporarily enhancing PATH to include DevKit... Building native extensions. This could take a while... ERROR: Error installing json: ERROR: Failed to build gem native extension. "C:/Program Files/Ruby/Ruby192/bin/ruby.exe" extconf.rb creating Makefile make Makefile:160: warning: overriding commands for target `C:/Program' Makefile:153: warning: ignoring old commands for target

WickedPDF missing layout

怎甘沉沦 提交于 2019-12-07 04:10:02
问题 I have a controller like this: def show @professor = Professor.find(params[:id]) respond_to do |format| format.html format.pdf do render :pdf => "file_name" end end end And a simple view like this: <p>Professor: <%= @professor.first_name %></p> <p>Email: <%= @professor.email if @professor.email %></p> I also have a layout 'application.html.erb'; <!doctype html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="viewport" content=