rubygems

Error installing geoip_city gem

故事扮演 提交于 2019-12-23 01:21:27
问题 I keep getting an error when trying to install the geoip_city gem. I've already installed the GeoIP C library to /opt/GeoIP, but the gem doesn't seem to pick it up. I've tried: sudo gem install geoip_city -- --with-geoip-dir=/opt/GeoIP sudo gem install geoip_city -- --with-geoip-lib=/opt/GeoIP/lib sudo gem install geoip_city -- --with-geoip-dir=/opt/GeoIP --with-geoip-lib=/opt/GeoIP/lib all of which output this error: Building native extensions. This could take a while... ERROR: Error

how to override gem generator template in Rails app

≯℡__Kan透↙ 提交于 2019-12-22 18:47:37
问题 I know how to override a Rails template in a gem, but how can I override gem generator template in a Rails application e.g.: https://github.com/elabs/pundit/blob/master/lib/generators/pundit/policy/templates/policy.rb or https://github.com/drapergem/draper/blob/master/lib/generators/rails/templates/decorator.rb so that rails g decorator Foo would generate my template, not the gem native one thx 回答1: From Rails guide on generators: In Rails 3.0 and above, generators don't just look in the

Gem install errors writable and PATH

Deadly 提交于 2019-12-22 12:33:08
问题 These are the two errors I am getting. I am on OS X. Honestly, don't know if I installed via gem or not - if that matters. WARNING: Installing to ~/.gem since /Library/Ruby/Gems/1.8 and /usr/bin aren't both writable. WARNING: You don't have /Users/M/.gem/ruby/1.8/bin in your PATH, gem executables will not run. 回答1: The default Ruby installation shipped on Mac OS X is owned by the system administrator, so you need root privs to install Gems. $ sudo gem install MYGEM The second warning is

AWS SES Timeout

☆樱花仙子☆ 提交于 2019-12-22 11:25:45
问题 I am using Rails 4.2, the AWS-SES gem and the Mailform gem. I am trying to set up AWS SES in development and have added this to config/development.rb : # Configure mail using AWS SES config.after_initialize do ActionMailer::Base.delivery_method = :amazon_ses ActionMailer::Base.custom_amazon_ses_mailer = AWS::SES::Base.new( :secret_access_key => ENV['AWS_SECRET_ACCESS_KEY'], :access_key_id => ENV['AWS_SECRET_KEY_ID'], :server => 'email.eu-west-2.amazonaws.com' ) end When I attempt to send

Date Format In RUBY

拈花ヽ惹草 提交于 2019-12-22 09:29:29
问题 Here, In RUBY I need a format of Like this "February 1st 2011 11.00" . I tried this one "Time.now.utc.strftime("%B %d %Y %R")" But I need to format numerals with suffixes st, nd, rd, th etc. Please suggest something. 回答1: If you specifically want "February 1st 2011 11.00" you would need to add your own DATE_FORMATS and call that. Time::DATE_FORMATS[:custom_ordinal] = lambda { |time| time.strftime("%B #{ActiveSupport::Inflector.ordinalize(time.day)} %Y %H.%M") } puts Time.now.to_s(:custom

rubygems 1.3.7 TypeError (in 'merge') during installation on Ubuntu

跟風遠走 提交于 2019-12-22 08:03:40
问题 While installing ruby-1.9.2-p0 with rvm on an updated Ubunutu x86_64, I keep getting an error in `merge': can't convert String into Hash (TypeError). All apt packages in rvm notes and those found in the rubygems manual have been installed. I believe the error is resulting when RVM is attempting to install rubygems. I also get the same error installing ruby gems with the system ruby. I think this is a dependency problem. I have compiled on Ubuntu before on both i386 and x86_64 before and never

Devise registration confirmation

喜你入骨 提交于 2019-12-22 07:07:23
问题 I have a User and an Admin role in my project. I created my authentication with Devise. In my admin role I don't have any confirmation. In my User model I have the following: devise :database_authenticatable, :confirmable, :recoverable, :rememberable, :trackable, :validatable, :timeoutable, :registerable # Setup accessible (or protected) attributes for your model attr_accessible :email, :username, :prename, :surname, :phone, :street, :number, :location, :password, :password_confirmation My

Can I use RVM to maintain a single version of Ruby for all users?

白昼怎懂夜的黑 提交于 2019-12-22 06:51:03
问题 I love RVM. I realize that the main use case for it is letting different users switch between different versions of Ruby. But let's say I'm deploying a Rails app to a server and I just want a single version of Ruby running. In particular, I want 1.9.2, which is a breeze to install with RVM but a pain without it. Is there a way that I can say "I want this to be the canonical Ruby installation for all users" (along with all of its gems) without having to create a bunch of symlinks by hand and

Rails Ruby Gems vs Pure Development When Generating A Rich Blog

偶尔善良 提交于 2019-12-22 06:00:28
问题 Some ruby gems like jekyll, toto and webby offer out of the box blog-type integration into your ruby app. Another way of developing a rich web blog-type application is to build and model the application yourself using pure ruby and rails practices. (e.g creating an Article and User model). The first offers out of the box features the 2nd option offers more customization and control. In people's experience on Stack Overflow, which would be the best route and what would people consider when

Rails Ruby Gems vs Pure Development When Generating A Rich Blog

血红的双手。 提交于 2019-12-22 06:00:25
问题 Some ruby gems like jekyll, toto and webby offer out of the box blog-type integration into your ruby app. Another way of developing a rich web blog-type application is to build and model the application yourself using pure ruby and rails practices. (e.g creating an Article and User model). The first offers out of the box features the 2nd option offers more customization and control. In people's experience on Stack Overflow, which would be the best route and what would people consider when