rubygems

Rails, default.js is empty, and jquery and jquery_ujs not loaded

江枫思渺然 提交于 2019-12-08 08:10:18
问题 I am practicing ruby on rails by using rails guides. In the section 5.13 Deleting Articles they are showing how to create the delete (destroy) functionality. I followed the steps correctly, but the delete confirmation dialogue isn't shown and the articles are not getting deleted. When I checked the chrome developer tools, "jquery" and "jquery_ujs" is not included and the "default.js" is empty. I am running ruby on rails on windows 7. This is my articles controller, class ArticlesController <

$GEM_HOME is ignored by `gem install`

£可爱£侵袭症+ 提交于 2019-12-08 07:21:12
问题 I have $GEM_HOME set, but gem install is still installing to the default ~/.gem directory. This rubygems issue says to remove the --user-install option in .gemrc , but I don't have a .gemrc file. How can I get gem install to honour the value of $GEM_HOME ? Here I firstly remove ~/.gem , and then show that it is automatically created: % rm -rf ~/.gem % find ~ -name '*gemrc*' % # No output, so .gemrc doesn't exist % echo $GEM_HOME /home/ravi/.local/share/gem % gem install neovim Building native

Example for using diff ruby gem to find difference between two files

二次信任 提交于 2019-12-08 07:20:28
Can someone give me an example to find the difference between two text files in Ruby. I am not able to figure out how to use the diff ruby gem. Also it would be great to know how to apply the diff output on the original file and get the latest file. I tried looking at the documentation for patchr gem but there was nothing available. I suggest that you try diffy instead. 来源: https://stackoverflow.com/questions/4925127/example-for-using-diff-ruby-gem-to-find-difference-between-two-files

Cannot load Shorturl gem (ruby ErrorLoad)

你。 提交于 2019-12-08 07:06:27
问题 I'm fairly new to Ruby and keep knocking my head against gems, but this latest puzzle has really got me stumped. After using the gem install shorturl, I added the following headers to a file in my project: require "rubygems" require "shorturl" class Controller < Autumn::Leaf When I run the project I get the following error: myfile.rb:3 in `require': no such file to load -- shorturl (LoadError) I'm not sure what other information would be useful, except that without the require the script is

paperclip 2.7.0 on ruby 1.8.7

妖精的绣舞 提交于 2019-12-08 07:04:27
问题 I have a very old rails app (rails 2.3.10 and ruby 1.8.7) and we want to move it on another server. I can reinstall all gems with same version except for paperclip 2.7. when i tried to install it i receive an error on activesupport, that it seems it require ruby 1.9.3. According with paperclip doc this shouldn't happens, some one of you can help me? i tried with all gems except paperclip, with no gems, and installing an old version of activesupport. Below you can find my tests. app@new-server

problems installing thin on Windows

别说谁变了你拦得住时间么 提交于 2019-12-08 06:31:58
问题 I'm trying to install Thin on Windows (ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]) but get an error message: C:>gem install thin Building native extensions. This could take a while... ERROR: Error installing thin: ERROR: Failed to build gem native extension. C:/rails/ruby/bin/ruby.exe extconf.rb checking for main() in c.lib... no creating Makefile nmake Microsoft (R) Program Maintenance Utility Version 1.50 Copyright (c) Microsoft Corp 1988-94. All rights reserved. cl -nologo -I.

mysql2 failing bundle install

旧巷老猫 提交于 2019-12-08 06:30:13
问题 I've been hung up on this issue for hours now and nothing I have found previously posted about this issue seems to work. Below is the mysql2 output for when I run bundle install : Fetching mysql2 0.4.5 Installing mysql2 0.4.5 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /Users/MYUSERNAME/Desktop/MY_PROJECT/vendor/ruby/2.4.0/gems/mysql2-0.4.5/ext/mysql2 /Users/MYUSERNAME/.rbenv/versions/2.4.2/bin/ruby -r ./siteconf20180623-40170

Error with rhc-create-domain on command line (Openshitft)

与世无争的帅哥 提交于 2019-12-08 06:02:09
问题 First I do not know much about Ruby, but, the Openshit command line uses the 'rhc' to manage my apps on cloud. Nice!...but the 'rhc' program its based on Ruby, Rubygems....something. Ok, i'm installed theses programs with apt-get on Linux Mint (Ubuntu based): sudo apt-get install ruby1.8 sudo apt-get install gem sudo apt-get install rubygems gem install json_pure gem install rake gem install rhc Nice!..rhc its visible in my console, but when i try execute any rhc command, the console returns

Adding urls api keys in environment variable in ruby

╄→гoц情女王★ 提交于 2019-12-08 05:43:41
问题 I have a url that I am using in one of the controllers. Is there a better place to put this url? The url uses an API key and I was wondering if there is a better place to add this url and/or api key such that its not added in the controller class code and ergo more editable? If i add it as an environment variable or anything else how do i access it from my controller class? thank you. ITS A RUBY AND RAILS PROJECT 回答1: Using environment variables might be a good idea if you want to keep things

cannot connect to Postgres (pg) database from my Ruby Script using gem “pg”(This is not rails, just pure ruby)

元气小坏坏 提交于 2019-12-08 05:17:35
问题 I downloaded the postgres.app for my Mac OSX machine. I have a rails app that has connected and used the postgres DB that came with the postgres app. Now I am writing a pure Ruby test script (Not Rails, pure Ruby, not even Active Record) to try to connect to the postgres database instance. These are the steps I followed to set this up 1) ran this command on the terminal: gem install pg -- --with-pg-config=/Applications/Postgres.app/Contents/MacOS/bin/pg_config 2) Added this code to the test