rubygems

Packaging Rails 2.3 Models

别等时光非礼了梦想. 提交于 2019-12-13 16:24:10
问题 I've got an existing webapp running on Rails. The plan is to setup a new server which will provide an API service, and eventually update the webapp to be a client of this API. It seems like a good approach to achieving this would be packaging all the models as gems and sharing them between the two applications. Eventually the API service would be monolithic - containing all the models, but there is a period of development/migration where models will need to be shared. Both the API and the

Error: “Could not find rake”, yet Rake is installed

你说的曾经没有我的故事 提交于 2019-12-13 16:08:23
问题 Why am I receiving this Rake error: $ rake --version /Volumes/Data/sampablokuper/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find rake (>= 0) amongst [] (Gem::LoadError) from /Volumes/Data/sampablokuper/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec' from /Volumes/Data/sampablokuper/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems.rb:1231:in `gem' from /Volumes/Data

Ruby on Rails: Cant download new gems (Name or service not known)

▼魔方 西西 提交于 2019-12-13 15:31:52
问题 For some reason, I can't add new gems (which haven't been donwloaded/used before) to my system. When I run bundle install after adding them to the Gemfile , I get errors like this: /usr/lib/ruby/1.8/rubygems/remote_fetcher.rb:180:in `fetch_path': SocketError: getaddrinfo: Name or service not known (http://rubygems.org/quick/Marshal.4.8/google_places_autocomplete-0.0.2.gemspec.rz) (Gem::RemoteFetcher::FetchError) from /usr/lib/ruby/1.8/rubygems/spec_fetcher.rb:106:in `fetch_spec' from /var/lib

Rails gem to break a paragraph into series of sentences

拟墨画扇 提交于 2019-12-13 11:34:38
问题 I'm trying to split a paragraph into series of sentences such that each sentence group stays under N characters. In case of a single sentence that is longer than N, it should be split into chunks with punctuation marks or spaces as separators. E.g., if N = 50, then the following string "Lorem ipsum, consectetur elit. Donec ut ligula. Sed acumsan posuere tristique. Sed et tristique sem. Aenean sollicitudin, sapien sodales elementum blandit. Fusce urna libero blandit eu aliquet ac rutrum vel

Logstash plugin installed but not found

风格不统一 提交于 2019-12-13 08:17:00
问题 I am using logstash 2.3.2 and for one of my project I have to save some data in RAM. I asked a question on stackoverflow (Logstash: is it possible to save documents in memory?) to get a filter for that and the most appropriate filter is memcached (even if this one is unofficial). I downloaded the plugin, I generated the gem file (which is not empty) and I successfully installed the plugin. However, when i run logsatsh by using this filter in my configuration file, I get the following error:

Fedena Installation for Linux and Ubuntu

妖精的绣舞 提交于 2019-12-13 08:16:02
问题 I am new to ruby on rails.While executing rake db:create i am getting following error.What is the problem.I found it is a common problem and googled it.I found to change rake version but my problem was not solved. rake aborted! ERROR: 'rake/rdoctask' is obsolete and no longer supported. Use 'rdoc/task' (available in RDoc 2.4.2+) instead. /usr/local/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/rdoctask.rb:1:in `<top (required)>' /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel

Updating more than one attribute at one time in ruby on rails

两盒软妹~` 提交于 2019-12-13 07:15:33
问题 I have a page where a user can see a list of messages in a current threaded conversation. They can delete each message using a delete link (a link inside an each loop for each message): <%= link_to 'Delete', message, :method => :delete, :confirm => "Are you sure?", :title => message.body %> <br /> This basically connects them to an action in my messages_controller: def destroy @message = Message.find(params[:id]) @message.update_attribute('sender_status', 1) if @message.sender_id == current

Bundle install fails in Rails Docker container

为君一笑 提交于 2019-12-13 06:48:18
问题 I'm having problems deploying my docker container, primarily due to bundler not being able to execute it's install command. Running bundle install locally with passenger seems to work just fine, only the deployment procedure causes problems upon setting up the gems. I am relatively new to Docker and I wouldn't call myself a Rails expert. That said, I have difficulties understanding how exactly bundler manages to mess this whole thing up in this way (especially in conjunction with Docker ). I

Rails on WINDOWS: install therubyracer & libv8 - working on a website designed on MAC

不问归期 提交于 2019-12-13 06:15:13
问题 I have a website developed with was RoR v 4.2.4 on MAC which needs some adaptions and I'm trying to get in running on my windows 10 (because I don't have a MAC).I was not successfull with the rails installer and rails 5.0. After a lot of pain installing RoR 4.2.4 with ruby 2.2.6 I managed to install nearly all missing gems using bundle check , bundle install and gem install xyz -v 0.0... . But now I'm really stuck with the last 2: therubyracer and libv8 What I tried: Install libv8 with gem

“sudo apt-get install ruby-dev” in Windows

不问归期 提交于 2019-12-13 05:52:34
问题 I need to install the Ruby development tools on Windows, essentially the same command as described in https://stackoverflow.com/a/12552948/6474013. I have already tried to use Sudowin but it's doesn't work for the ruby command prompt. I use RailsInstaller with Ruby 2.1.8 回答1: In order to install the compiler toolchain to compile certain gems on Windows, you can install the DevKit as an Addon to Ruby Installer. If you installed a Rails Installer package from http://railsinstaller.org/, this