How to tell if bundle install is doing anything | Fixed issues |
- How to tell if bundle install is doing anything
- Using Grape API with rails, deploy error on Heroku
- Rails: One Parent & Multiple Nested Children With Independent Views: 'Link_to' to other child's index
- An error occurred while installing active_shipping (0.9.13), and Bundler cannot continue
- Updating default value in select_tag with Ajax call
- Which action for single-action controller that merely redirects?
- GCM rails files location?
- Ruby on Rails 4.2.6 Undefined Method page_id
- Rails: How to make strong parameters easy to read
- ruby on rails console isn't working, I am getting"Switch to inspect mode" on windows
- application server sleeps after 10 minutes
- Why is my polymorphic association nil while the _id and _type fields are not?
- Undefined method scope for ActiveRecord_Relation
- Cannot run rspec with filter tags
- Rubymine syntax higlighting in js.erb files
- debugger in rails with byebug not working
- Serving custom errors for route constraint failures (Rails)
- Capybara: Set value of summernote textarea
- Can not store time in database
- Why update action is invoked when submitting form with non-changed data in Rails 4?
- Why is my Heroku app memory footprint so big
- getting error on destroy item
- calling a grape API endpoint directly from the browser results in UncaughtThrowError
- Error when doing rake db:migrate PG::ConnectionBad: fe_sendauth: no password supplied
- Ruby On Rails format_measure() or measure()
- How to avoid quering multiple times in serializer?
- Facing Redis issue with sidekiq on rails4 spree application
- Check if there are any unique tokens left of a certain character length
- LIFO except FIFO in Sidekiq
- react-rails - can't import react-router 'Link' in external file
How to tell if bundle install is doing anything Posted: 15 Jun 2016 07:36 AM PDT I have created a vagrant instance from hashicorp/precise64 and once I logged in via putty changed to vagrant directory I ran however the only output I have received is... My gemfile has approximately 150 gems and my gemfile.lock has over 500 lines. There has been no other output for half an hour and I was wondering at what point should I accept that something is wrong. I assumed with verbose specified there would be some output but nothing has appeared. Any help would be appreciated as I'm not sure if I'm just wasting my time. |
Using Grape API with rails, deploy error on Heroku Posted: 15 Jun 2016 07:30 AM PDT I want to use It just keeping showing this Here is heroku logs BTW, I put something If I need to post some file, please tell me thanks. |
Posted: 15 Jun 2016 07:28 AM PDT I have one parent called user with multiple nested children resources (emails and phonenumber) with independent views using the code shown in: http://blog.8thcolor.com/en/2011/08/nested-resources-with-independent-views-in-ruby-on-rails/ , only I want the in the show.html.erb of the email child to link to the index.html.erb page of the phonenumber one. The views are independent, and there are multiple users so it is important to retain the id of the parent when the view jumps from the show.html of the emails child to the index.html of phonenumber. but nothing I try works. A couple of things I have tried inside the email's show.html.erb file are: I've even tried just going back up to user without success via but get the following error: No route matches {:action=>"show", :controller=>"customers", :customer_id=>"25"} missing required keys: [:id] Any help would be appreciated. Thank you, Wex |
An error occurred while installing active_shipping (0.9.13), and Bundler cannot continue Posted: 15 Jun 2016 07:09 AM PDT When I run But did install |
Updating default value in select_tag with Ajax call Posted: 15 Jun 2016 06:51 AM PDT I have a select_tag attribute within a ruby application. However, the default value obtains information from a database - Often that information is changed via an Ajax call and I was just wondering how one would be able to update a default value within a select_tag widget. Here is the following code: where @event.setup_time is the default when the page is run ... however when there is an Ajax request, it is not updated as the view is not reloaded. Any and all help is appreciated. Cheers~ |
Which action for single-action controller that merely redirects? Posted: 15 Jun 2016 07:38 AM PDT I have an app where I try to stay adherent to REST. The app receives requests for external links that doesn't belong to the app, so the sole purpose of the action is to redirect the request to the external URL. My suggestion is to have the following controller/action: Is my thinking correct or should it be the |
Posted: 15 Jun 2016 06:42 AM PDT I was trying to implement gcm on my ror app , GCM on google chrom I was following these https://developers.google.com/web/fundamentals/getting-started/push-notifications/?hl=en It states that, we need to create main.js ,sw.js , manifest.json In it says that, create these files in top of your app directory , but i'm having doubts abot these Where should be these files located in rails ? and am i doing anything wrong, is this the right way to get this task done, Can anybody help me with this? |
Ruby on Rails 4.2.6 Undefined Method page_id Posted: 15 Jun 2016 06:57 AM PDT This is the error that I'm getting: undefined method `page_id' for #Page:0x0000000b2c1e28. Showing C:/Users/eiria/Sites/simple_cms/app/views/sections/_form.html.erb where line #6 raised: undefined method `page_id' for # Trace of template inclusion: app/views/sections/new.html.erb Rails.root: C:/Users/eiria/Sites/simple_cms I'm trying to nest Sections inside Pages for my Content Management System. This is my Sections form: This is my Sections controller: Section model: Page model: I don't see why it says undefined method page_id for line 6, while the same is used for line 5 but theres apparently nothing wrong there... Any help would be appreciated. P.S: This is my first question on stackoverflow, so please forgive me for any obvious mistakes. This question is almost completely identical to this, but my problem is creating a new section and not it. |
Rails: How to make strong parameters easy to read Posted: 15 Jun 2016 07:20 AM PDT My app has strong parameters as followings. How can I make this code easy to read? This line has a lot of my controller It would be appreciated if you could give me any suggestion. |
ruby on rails console isn't working, I am getting"Switch to inspect mode" on windows Posted: 15 Jun 2016 06:04 AM PDT When I run my rails console it is saying "Switch to inspect mode" .I am working on windows . Kindly help ! |
application server sleeps after 10 minutes Posted: 15 Jun 2016 06:01 AM PDT We have nginx server setup with unicorn as application server. nginx server sleeps after 10 minutes and not able to respond to any request after 10 minutes cycle. gem capistrano-unicorn is used to setup unicorn. This is the server specifications nginx/1.2.4 |
Why is my polymorphic association nil while the _id and _type fields are not? Posted: 15 Jun 2016 07:28 AM PDT I'm writing some tests for my Rails project. I've come to writing some tests around a polymorphic association, for which I have defined a fixture. However, when I try to access the polymorphically associated field on that fixture, it returns The strange part is that while the field itself is This is the model: (In case it wasn't obvious, the This is the action in the controller that I'm trying to test: The test itself looks like this: And, finally, the fixture for that existing comment ( Both the Running the test gives me this error: The three log lines near the top of the Why is this? What can I do to fix it? I have no ID fields defined in my fixtures YAML, and I'd prefer not to have to specify the IDs (unless it can be done with ERB). This is the entirety of the Answers fixture that the Comments depend on: That in turn depends on this Question fixture: |
Undefined method scope for ActiveRecord_Relation Posted: 15 Jun 2016 06:49 AM PDT Why scope that I defined doesn't work? part of my code below: Message.rb but if I make query directly it works: Can anybody explain to me why it happens? Update here is log, but nothing interesting |
Cannot run rspec with filter tags Posted: 15 Jun 2016 06:10 AM PDT I have spec When I run rspec on my iterm, it couldn't run Maybe it related to zsh command line (issue). I try to remove zsh from my iTerms 2 but it's not success. Any alternative shell for Rails dev ? Thanks |
Rubymine syntax higlighting in js.erb files Posted: 15 Jun 2016 06:53 AM PDT I have javascript files that have embedded ruby. While functionally everything works fine, the syntax higlighting as well as the error inspection function of RubyMine 2016 has issues with that. The first time i embed ruby in the javascript file by using the As i assume that embedding ruby in JavaScript is quite common, is there a way to make RubyMine play nice with my functional (and correct) code? Otherwise it looks like i have a huge number of errors, and editing becomes quite unintuitive: |
debugger in rails with byebug not working Posted: 15 Jun 2016 05:51 AM PDT I have a problem when I try using debugger in rails with byebug...I installed the byebug gem without any problems ... in gemfile : put the debugger in my controller: (I am using gitbash in windwos 7 ) The problem is when I try calling article_params I get a blank line only for long time with no respond I tried to restart my server and and tried debugging again but same problem....Here is an image for the problem here is the code from git bash (is the same in the image): Any one can help please? |
Serving custom errors for route constraint failures (Rails) Posted: 15 Jun 2016 05:26 AM PDT Got a Rails 4 application that has routes wrapped in a basic That's all good, but I'd like a little more robustness with regards to error handling (a simple But that just seems really sloppy. I'd like to avoid using external stuff like faraday and whatnot. I feel like this has to be possible in Rails, and I'm just not sure of the syntax. All the other SO questions/blog posts I've looked at don't seem to mention this kind of functionality at all. Any response appreciated. Thanks. |
Capybara: Set value of summernote textarea Posted: 15 Jun 2016 05:15 AM PDT I'm trying to test a implementation of summernote I realized that I found a solution from here: http://stackoverflow.com/a/30921215/1713912, but it doesn't work for me. Any ideas for a solution is much appreciated! My test: |
Can not store time in database Posted: 15 Jun 2016 05:34 AM PDT I have used the Time.new method in my rails application to get the current date and I want to store this date into a variable of type datetime . I am using postgresql. Now if I insert the date of this format manually into table using pgAdminIII ,it is working fine but if I try to insert the time into the table via a controller code then it is storing a different date time into table. For example suppose the current time is:- 2016-06-15 17:29:29 And if I insert this date and time into the table manually by copying this line from webpage then it is working fine. But my controller code to store it into table is inserting something else like 2016-06-15 11:41:39 Note: I have used only Time.new (time region is not specified in my code) |
Why update action is invoked when submitting form with non-changed data in Rails 4? Posted: 15 Jun 2016 07:14 AM PDT I load data from two tables to the single form. On the form I create new record for model B (child) while don't change anything for model A (parent). If for model B something is entered wrongly (for example, email address without '.com') then validation error for model B is displayed. After correcting the issue (put correct email) and pressing Submit button the update action for model A is invoked. But in model A there were no changes! Why update action for model A is being invoked in this case? There is no data to update to the database. Below is more detailed explanation: I use one signup form to enter data for two models: Tenant and User. Any tenant will have many users. When new user wants to signup he also enters data about his tenant (company). If entered tenant doesn't exist then new tenant is created along with new user. This part is working well. The problem is when new user enters the name of tenant that already exists in the database and ONLY if user will enter something wrong (for example, wrong email format). If something was entered wrong then validation error (for example, Email can't be blank) occurs AND all previously saved users of the same tenant are also displayed as a result of To display only the new record for which validation error was triggered I added In this case the signup form is displayed correctly, BUT when I correct the cause of the validation error (for example, enter correct email) and press Save button, then update action is executed instead of create action. And this is the problem, because I don't want any user to be able to update tenant data at signup stage. At signup user should be able to create only his personal data, not update his tenant's data. Please suggest the way to do this. Tenant model: User model: Tenant controller: Signup form: |
Why is my Heroku app memory footprint so big Posted: 15 Jun 2016 04:59 AM PDT I have a Rails 4.2 application running on Heroku, Ruby version is 2.2.4 When I restart the application, using Heroku´s log-runtime-metrics the app logs this: A simple click to a diferent page in the landing of the app reports these details: Oink reports: Memory usage: 435416 Entering the app I have some datatables with pagination, when moving around the pages the memory keeps increasing: Oink reporting at this moment: Memory usage: 602352 If I go out to a simpler page on the app Heroku reports: Oink reports Memory usage: 604744 After 5 minutes moving around Heroku reports for memory total something between 360 and 400+ MB. It doesn't get into Memory Quota errors but if a new web worker would be fired I bet it would. I have also taken some data from ObjectSpace. Navigating around the site (this time in local), first with the simplest pages, then entering the part with pagination with fetches more data, going out and so. These are some of the logs from ObjectSpace.count_objects: {:TOTAL=>556379, :FREE=>1142, :T_OBJECT=>27740, :T_CLASS=>7356, :T_MODULE=>1563, :T_FLOAT=>9, :T_STRING=>241807, :T_REGEXP=>2481, :T_ARRAY=>92685, :T_HASH=>16081, :T_STRUCT=>1118, :T_BIGNUM=>13, :T_FILE=>117, :T_DATA=>81408, :T_MATCH=>6132, :T_COMPLEX=>1, :T_RATIONAL=>909, :T_SYMBOL=>1691, :T_NODE=>62347, :T_ICLASS=>11779} {:TOTAL=>556379, :FREE=>1211, :T_OBJECT=>27540, :T_CLASS=>7354, :T_MODULE=>1565, :T_FLOAT=>9, :T_STRING=>241100, :T_REGEXP=>2478, :T_ARRAY=>93344, :T_HASH=>16763, :T_STRUCT=>1078, :T_BIGNUM=>13, :T_FILE=>122, :T_DATA=>81422, :T_MATCH=>6031, :T_COMPLEX=>1, :T_RATIONAL=>911, :T_SYMBOL=>1690, :T_NODE=>61968, :T_ICLASS=>11779} {:TOTAL=>556379, :FREE=>946, :T_OBJECT=>24257, :T_CLASS=>7523, :T_MODULE=>1565, :T_FLOAT=>9, :T_STRING=>251448, :T_REGEXP=>2362, :T_ARRAY=>83078, :T_HASH=>15272, :T_STRUCT=>1175, :T_BIGNUM=>63, :T_FILE=>128, :T_DATA=>89152, :T_MATCH=>5952, :T_COMPLEX=>1, :T_RATIONAL=>963, :T_SYMBOL=>2028, :T_NODE=>58656, :T_ICLASS=>11801} ENTERING DATATABLES, WITH PAGINATION, 25 RECORDS PER PAGE, DATA RETRIEVED CONTAINS UNIQUE STRINGS (ADDRESSES IN FACT). {:TOTAL=>556379, :FREE=>906, :T_OBJECT=>26280, :T_CLASS=>7363, :T_MODULE=>1563, :T_FLOAT=>9, :T_STRING=>252024, :T_REGEXP=>2474, :T_ARRAY=>87445, :T_HASH=>15347, :T_STRUCT=>1144, :T_BIGNUM=>16, :T_FILE=>133, :T_DATA=>80601, :T_MATCH=>6686, :T_COMPLEX=>1, :T_RATIONAL=>985, :T_SYMBOL=>1690, :T_NODE=>59906, :T_ICLASS=>11806} {:TOTAL=>556379, :FREE=>146, :T_OBJECT=>18752, :T_CLASS=>7359, :T_MODULE=>1563, :T_FLOAT=>9, :T_STRING=>295002, :T_REGEXP=>2304, :T_ARRAY=>81885, :T_HASH=>13791, :T_STRUCT=>867, :T_BIGNUM=>15, :T_FILE=>11, :T_DATA=>77634, :T_MATCH=>847, :T_COMPLEX=>1, :T_RATIONAL=>1251, :T_SYMBOL=>1679, :T_NODE=>41463, :T_ICLASS=>11800} {:TOTAL=>571870, :FREE=>433, :T_OBJECT=>19352, :T_CLASS=>7369, :T_MODULE=>1565, :T_FLOAT=>9, :T_STRING=>294098, :T_REGEXP=>2358, :T_ARRAY=>91079, :T_HASH=>14983, :T_STRUCT=>879, :T_BIGNUM=>15, :T_FILE=>16, :T_DATA=>77945, :T_MATCH=>1128, :T_COMPLEX=>1, :T_RATIONAL=>1591, :T_SYMBOL=>2028, :T_NODE=>45197, :T_ICLASS=>11824} {:TOTAL=>628109, :FREE=>343, :T_OBJECT=>20647, :T_CLASS=>7360, :T_MODULE=>1563, :T_FLOAT=>9, :T_STRING=>318169, :T_REGEXP=>2346, :T_ARRAY=>115854, :T_HASH=>17767, :T_STRUCT=>949, :T_BIGNUM=>15, :T_FILE=>10, :T_DATA=>79152, :T_MATCH=>1243, :T_COMPLEX=>1, :T_RATIONAL=>1789, :T_SYMBOL=>1685, :T_NODE=>47405, :T_ICLASS=>11802} {:TOTAL=>727564, :FREE=>470, :T_OBJECT=>22820, :T_CLASS=>7361, :T_MODULE=>1563, :T_FLOAT=>9, :T_STRING=>362350, :T_REGEXP=>2390, :T_ARRAY=>152959, :T_HASH=>22342, :T_STRUCT=>1035, :T_BIGNUM=>33, :T_FILE=>11, :T_DATA=>81286, :T_MATCH=>2167, :T_COMPLEX=>1, :T_RATIONAL=>2497, :T_SYMBOL=>1686, :T_NODE=>54779, :T_ICLASS=>11805} {:TOTAL=>811122, :FREE=>392, :T_OBJECT=>24361, :T_CLASS=>7362, :T_MODULE=>1563, :T_FLOAT=>9, :T_STRING=>409740, :T_REGEXP=>2434, :T_ARRAY=>176571, :T_HASH=>25118, :T_STRUCT=>1076, :T_BIGNUM=>51, :T_FILE=>13, :T_DATA=>82701, :T_MATCH=>2858, :T_COMPLEX=>1, :T_RATIONAL=>3093, :T_SYMBOL=>1686, :T_NODE=>60285, :T_ICLASS=>11808} LEAVING NOW DATATABLES AND PAGINATION TO A SIMPLER PAGE ON THE APP {:TOTAL=>819681, :FREE=>494, :T_OBJECT=>24601, :T_CLASS=>7374, :T_MODULE=>1563, :T_FLOAT=>9, :T_STRING=>413540, :T_REGEXP=>2437, :T_ARRAY=>178899, :T_HASH=>25953, :T_STRUCT=>1118, :T_BIGNUM=>93, :T_FILE=>14, :T_DATA=>83043, :T_MATCH=>2924, :T_COMPLEX=>1, :T_RATIONAL=>3121, :T_SYMBOL=>1688, :T_NODE=>60999, :T_ICLASS=>11810} I also can get gc profiler data. But what worries me there is that most of the reported data and allocated stuff if from gems that are required and I need anyway. So... I'm on my way trying to detect memory leaks, or the reason why memory footprint is so high, and reduce it as much as I can. Any advices how to proceed from here are welcome. It would be nice to understand why after a first click - after restarting - the reported memory by Heroku doubles, though I imagine that it is after that when most of the objects get constructed and memory allocated. But then the difference between what Oink reports and what Heroku reports is huge, I guess Oink reports in Bytes. And again I imagine that they are reporting different things, or at least Heroku is reporting about much more stuff. Any good hints how to interpret all this data? Isn't it a 300-400 MB memory footprint too much for a Heroku app? Thanks. |
Posted: 15 Jun 2016 06:17 AM PDT i have 1 crud of project and i am trying to destroy project from list as using ajax. destroy.js all_projects.html.erb index.html.erb when i try to load all project its working fine. but when i destroy project it will give me error in server side like below. what i missed to do please help me to find. thanks |
calling a grape API endpoint directly from the browser results in UncaughtThrowError Posted: 15 Jun 2016 05:03 AM PDT If I call an api endpoint directly from the web and the execution of the code runs into an error then the error thrown from the error! function is not handled. I receive an: UncaughtThrowError The same error does not happen if I call the same api from curl or swagger. Any help is appreciated. The code samples are below: In the API endpoint I have a before filter: The restrict_access_to_developers looks like this: So the error! method which is provided by the grape throws an :error but that is not handled... |
Error when doing rake db:migrate PG::ConnectionBad: fe_sendauth: no password supplied Posted: 15 Jun 2016 04:50 AM PDT So I've launched Postgres and I'm unable to do migration on my Cloud9 Rails instance.. I supplied password for a user and it say that there is no password supplied. I get this error: database.yml |
Ruby On Rails format_measure() or measure() Posted: 15 Jun 2016 04:50 AM PDT What is the difference between the Ruby On Rails function measure() and format_measure() ??? Thank you |
How to avoid quering multiple times in serializer? Posted: 15 Jun 2016 05:03 AM PDT I have a Model Note: I have |
Facing Redis issue with sidekiq on rails4 spree application Posted: 15 Jun 2016 04:36 AM PDT Hello I am facing issue of redis on staging. Issue is Redis::CommandError (ERR max number of clients reached): My findings are as follows ::
Please guide me to solve this issue. |
Check if there are any unique tokens left of a certain character length Posted: 15 Jun 2016 06:49 AM PDT I have a Post model with the attribute I'm using The token doesn't need to be unguessable, but must be unique. I'm starting with tokens 1 character long, and when they are all used up (all 64 combinations), I should move on to have tokens that are 2 characters long. How should I check if there are any token variations left for tokens that are 3 characters long? |
Posted: 15 Jun 2016 04:19 AM PDT Is it possible to achieve LIFO except FIFO in Sidekiq? The reason is that my queue grew up to 190000 jobs and newer jobs are more important than old ones. |
react-rails - can't import react-router 'Link' in external file Posted: 15 Jun 2016 04:14 AM PDT I've been trying to modularize my react-rails project as I currently have everything in one jsx file (not good practise - still learning) I've set up some files in a components folder which the main home.js.jsx file is reading - but one of the external components requires use of 'Link' from React router. The component ('Property') isn't read when I try to include link at the top of the file. Basic premise is that the 'properties' component takes all of the property data and renders each of them into a 'property' component. This is the relavent parts of the main home.js.jsx file, first showing how I require react-router: And then showing where the 'Properties' component is called: This is the _properties.js.jsx file that takes all of the property data: Then the problem arises below. When I try to include 'Link' from react-router it fails to read the component. ('Property is not defined'): If I take out the import line, it reads the property component fine but obviously fails because 'Link' is undefined. I've tried various methods of importing/exporting the component but having no luck. Does anybody know how this could work? Is there a basic way of export the 'react-router' library to be read across all of the files? Thanks in advance. |
You are subscribed to email updates from Newest questions tagged ruby-on-rails - Stack Overflow. To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google Inc., 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States |
No comments:
Post a Comment