gem

Add SQL 2014 support to activerecord-sqlserver-adapter

烂漫一生 提交于 2019-12-24 17:07:32
问题 We've be using the activerecord-sqlserver-adapter gem with sqlserver 2008 and everything works great. We just tried to deploy our Rails 3 app against a new sqlserver 2014 db and I get an error that says: Currently, only 2005, 2008, 2010, 2011, and 2012 are supported. We got back Microsoft SQL Server 2014 - 12.0.2000.8 (X64) A quick look at github shows that a small update was recently made to the sqlserver_adapter.rd to resolve this issue. I tried to update the gem and it turned into a bit of

Trying to call view from gem

喜你入骨 提交于 2019-12-24 16:41:50
问题 I'm just beginning working with Rails. Ive developed a ruby gem including views with some dynamic variables and i would like to call specific view from my rails project. Do you have any approach to do that please? Thanks for you help. 回答1: Hope the following will help with how to 'render' a view within the rails framework! http://guides.rubyonrails.org/layouts_and_rendering.html Also, with regard to getting a hold of the views in the gem, it looks like if you have the views stored with 'app

Building pry plugin(gem) with bundler

瘦欲@ 提交于 2019-12-24 13:16:38
问题 As explained here pry's plugin require pry- prefix. I have tried building using bundler: bundle gem pry-name but it messed up directory hierarchies(creating 2 instead of 1 directory): create pry-name/pry-name.gemspec create pry-name/lib/pry/name.rb create pry-name/lib/pry/name/version.rb In the gemspec it is using wrong directory structure: require 'pry/name/version' and in the same file it run this git command: spec.files = `git ls-files`.split($/) which gives, same as above, wrong structure

Custom Gem execution fails with NoMethodError

自闭症网瘾萝莉.ら 提交于 2019-12-24 11:27:44
问题 I've written my first gem (ruby noob alert!). To deploy it into my local gem directory I ran: bundle install bundle exec rake install At this point I try to run my gem from the command line. I get a cryptic error: my_gem Gem File Location: C:/ruby193/lib/ruby/gems/1.9.1/gems/my_gem-0.0.1/Gemfile fatal: Not a git repository (or any of the parent directories): .git getting Gem.bin_path() C:/ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.6.3/lib/bundler/rubygems_integration.rb:305:in `block in

Editing a gem definition on HEROKU (opentok)

℡╲_俬逩灬. 提交于 2019-12-24 11:15:04
问题 quick question about Heroku. My app is using a gem called opentok. To function outside of a "sandbox" mode, the app requires changing an API link in a gem file called opentok.rb. I did that locally and the app works fine. however, when I deploy to heroku, the app does not work because heroku looks at my gem file and gets the unmodified gem lib of opentok which then runs my app on the heroku server in sandbox mode. Is there a way I can access the opentok gem file (opentok.rb) on the heroku

time_splitter gem getting uninitialized constant Sheet::TimeSplitter

笑着哭i 提交于 2019-12-24 10:45:46
问题 I have installed the time_splitter gem so that I can use a single date_time field. My bundle includes version 1.0.0. As recommended here, I added this code to my class Sheet : extend TimeSplitter::Accessors split_accessor :event_time I am getting an error on the extend : NameError in SheetsController#new uninitialized constant Sheet::TimeSplitter I'm about to give up and hack together a date/time solution but was hoping for something more elegant. Thanks in advance for your help. 回答1: You

ruby: irb gives NameError attempting to use mechanize gem (ubuntu)

拜拜、爱过 提交于 2019-12-24 09:37:18
问题 On my ubuntu box, irb (ruby) gives a NameError when I try to use the mechanize gem: $ irb irb(main):001:0> require 'mechanize' => true irb(main):002:0> Mechanize.new NameError: uninitialized constant Mechanize from (irb):2 from :0 gem env shows this: RubyGems Environment: - RUBYGEMS VERSION: 1.3.7 - RUBY VERSION: 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux] - INSTALLATION DIRECTORY: /usr/lib/ruby/gems/1.8 - RUBY EXECUTABLE: /usr/bin/ruby1.8 - EXECUTABLE DIRECTORY: /usr/bin - RUBYGEMS

Ruby on Rails capture webcam video and audio

对着背影说爱祢 提交于 2019-12-24 08:39:44
问题 Is there any gem out there that can interact with users webcam to capture video and audio and upload it to the server? 回答1: Have you heard about navigator.getUserMedia()? That could the trick. More info: http://www.html5rocks.com/en/tutorials/getusermedia/intro/ They talk about it in the Mobile Web Development course in Udacity (lesson 10). https://www.youtube.com/watch?v=j6mzYt5fJpg 回答2: Have you tried headshot ? I just tried it yesterday, but ran into some trouble with the flash player, not

How to enter a remote directory on Ruby NET:SFTP?

半城伤御伤魂 提交于 2019-12-24 07:47:36
问题 How to enter a directory like the command - cd, thus operate remote files without a path prefix ? Here is my current code. Net::SFTP.start do |sftp| sftp.rename!(REMOTE_PATH + "latest.zip", REMOTE_PATH + "latest.back.zip") sftp.upload!("latest.zip", REMOTE_PATH + "latest.zip") end I would like to have: sftp.cd REMOTE_PATH sftp.rename!("latest.zip", "latest.back.zip") sftp.upload!("latest.zip", "latest.zip") 回答1: I found a solution, which is use the SSH connect instead. . Not works. SFTP path

Installing mechanize gem on Mac OS X 10.4.11 gives 'Failed to build gem native extension'

房东的猫 提交于 2019-12-24 07:38:58
问题 I'm trying to install mechanize gem on a MAC OS X but I keep getting the following error : ERROR: Error installing mechanize: ERROR: Failed to build gem native extension. /usr/local/bin/ruby extconf.rb install mechanize checking for #include ... yes checking for #include ... yes checking for #include ... yes checking for #include ... yes checking for xmlParseDoc() in -lxml2... yes checking for xsltParseStylesheetDoc() in -lxslt... yes checking for exsltFuncRegister() in -lexslt... yes