gems

Connection refused - connect(2) Ruby on Rails Mail Setup

匿名 (未验证) 提交于 2019-12-03 01:14:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have set smtp settings in both config/environments/production.rb and development.rb also i have added the settings in `config/initializers/setup_mail.rb config.action_mailer.default_url_options = { :host => 'ipaddress' } config.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = { :address => 'smtp.gmail.com', :port => 587, :domain => 'gmail.com', :user_name => 'EMAIL_ADDRESS@gmail.com', :password => 'pass', :authentication => :plain, :enable_starttls_auto => true, :openssl_verify_mode => 'none' } config/initializers

Ruby: Could not find a temporary directory

匿名 (未验证) 提交于 2019-12-03 01:12:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am getting some 500 errors in my Passenger Rails app. When looking at the log it appears passenger cannot access the /tmp dir. I have validated that it is there and has RW access to root, and then tried www-data. What is going on here? 2014-01-14 16:01:16.6573 20624/7fa7c8806700 Pool2/SmartSpawner.h:301 ]: Preloader for /var/www/socialrest_homepage started on PID 20686, listening on unix:/tmp/passenger.1.0.20618/generation-0/backends/preloader.20686 App 20704 stdout: [Tue Jan 14 16:01:17 2014] [error] [client 168.215.171.129] Premature end

including rake tasks in gems

匿名 (未验证) 提交于 2019-12-03 01:10:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: 1) Is there a 'best' place for rake tasks inside of gems? I've seen them in /tasks, /lib/tasks, and I've seen them written as *.rb and *.rake -- not sure which (if any) is 'correct' 2) How do I make them available to the app once the gem is configured in the environment? 回答1: On Rails 3, you do this via Railties. Here's the code to do it for a gem I just made: class BackupTask So you basically create a class that inherits from Rails::Railtie, then within that class you have a rake_tasks block that loads the relevant files. You must load

infinite loop (?) in active admin

匿名 (未验证) 提交于 2019-12-03 01:09:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I use Rails 3.0.7 and in some cases WebBrick enters an infinite loop increasing CPU and memory usage. To break it, I need kill -9 . It happened when I tried to use active_scaffold and the bug occurs when I use ActiveAdmin. What is strange, when I use a default fields in ActiveAdmin, its OK, but when I try to show photo (from paper_clip), it hangs. There is a code for column: column "Photo" do user.photo end I tried to insert debugger before a line user.photo , and I noticed that this loop happens in activesupport-3.0.7/lib/active_support

socket.gethostbyname unable to find local hostname after updating to mac osx sierra

匿名 (未验证) 提交于 2019-12-03 01:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: After updating to OS Sierra, I tried running my local test suite with rspec spec , this immediately broke giving this stack trace: Coverage report generated for RSpec to / Users / October / Documents / code / clients - api / coverage . 38 / 101 LOC ( 37.62 %) covered . / Users / October /. rvm / gems / ruby - 2.3 . 1@clients - api / gems / bundler - 1.13 . 2 / lib / bundler / runtime . rb : 94 : in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'torid'. (Bundler::GemRequireError) Gem Load

Connection refused (PGError) (postgresql and rails)

匿名 (未验证) 提交于 2019-12-03 01:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I keep getting this error when i try to run my localhost using "$rails s": (Mac OSX 10.8.3) (ruby 2.0.0p195 (2013-05-14 revision 40734) [x86_64-darwin12.3.0]) (Rails 3.2.11) (psql (PostgreSQL) 9.2.2 ) **installed with homebrew I have been doing a lot of uninstalling postgresql and reinstalling so I have a hunch that there may be conflicting libraries somewhere...i just dont know where to start. I had Postgresql 9.1 and 9.2 in the same folder and just moved 9.1 into the trash. Here is the output when I run "rails s" in the terminal Danny$

dynamic_matchers.rb:55:in `method_missing': undefined method `migration_error=' for ActiveRecord::Base:Class (NoMethodError)

匿名 (未验证) 提交于 2019-12-03 01:07:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm on Windows. Ruby v.1.9.3p392 / Rails v. 3.2.13 - This is the demo_app project from the 2nd chapter of Michael Hart's Ruby on Rails Tutorial. This error comes up when I issue ' rails generate scaffold User name:string email:string ' Any idea how to fix this? C:\ruby\rails_projects\demo_app>rails generate scaffold User name:string email:s tring invoke active_record C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/act ive_record/dynamic_matchers.rb:55:in `method_missing': undefined method `migrati on_error=' for

Rails Mailer “Net::OpenTimeout: execution expired” Exception on production server only

匿名 (未验证) 提交于 2019-12-03 01:07:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am using Ruby MRI 2.0.0 and Rails 3.2.12 on a Ubuntu 12.04 TLS VPS and attempting to setup email notifications in my app. It was working fine a few days ago, but not anymore. My web host is OVH. My SMTP settings: config.action_mailer.perform_deliveries = true config.action_mailer.raise_delivery_errors = true ActionMailer::Base.smtp_settings = { :address => "smtp.gmail.com", :port => 587, :user_name => 'sender@gmail.com', :password => 'secret', :authentication => 'plain', :enable_starttls_auto => true } Using RAILS_ENV=production rails

Sass and Compass weird css errors after install

匿名 (未验证) 提交于 2019-12-03 01:06:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I installed compass and I can't compile to css properly. I have no idea what's causing it. Even thou stackoverflow is asking me to write more. Installed scout. Created simple css and html file. Tried to compile css file. Got error. Could not find an answer on google. My css: body { background: black; } Output: /* Syntax error: Invalid CSS after "black": expected expression (e.g. 1px, bold), was ";" on line 2 of C:/Users/Andrej/Documents/My Dropbox/Web Projects/First good website/sass/main.sass 1: C:/Users/Andrej/Documents/My Dropbox/Web

cannot load such file ― sqlite3/sqlite3_native (LoadError) on ruby on rails

匿名 (未验证) 提交于 2019-12-03 01:01:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm newbie to Ruby on Rails . When I try to setup basic installation and initiation of server using rails 4.0.0 on ruby 2.0.0 ., I'm facing above error message. How can I avoid this error message and proceed further ? Full Error Message: /usr/local/lib/ruby/gems/2.0.0/gems/sqlite3-1.3.7/lib/sqlite3.rb:6:in `require': cannot load such file -- sqlite3/sqlite3_native (LoadError) from /usr/local/lib/ruby/gems/2.0.0/gems/sqlite3-1.3.7/lib/sqlite3.rb:6:in `rescue in ' from /usr/local/lib/ruby/gems/2.0.0/gems/sqlite3-1.3.7/lib/sqlite3.rb:2:in ` '