spree extension entering facebook app id - ruby-on-rails

I've got the extension spree_social_products installed in my spree 2.4.7 store on rails 4.1.8 and everything is working great except I cannot get the facebook intergration to configure.
The extension is here: https://github.com/spree-contrib/spree_social_products
I have an issue when trying to set my facebook app id.
The readme says run up a rails console and enter
Spree::Social::Config.facebook_app_id = 'YOUR_FACEBOOK_APP_ID'
When I run that command in the console I'm getting the following.
`<main>'2.1.0 :011 > Spree::Social::Config.facebook_app_id = 'XXXXX123456'`
NameError: uninitialized constant Spree::Social from (irb):11 from
/home/mspree/.rvm/gems/ruby-2.1.0#spree2.4/gems/railties-4.1.8/lib/rails/commands/console.rb:90:instart'
....
I running the command correctly ?
I've tried rails console and rails console development, both give the same error.

It turns out I had the wrong namespace and I had to create and set the value. I was expecting the variable to be present but it was not.
I found the following helpful.
https://groups.google.com/forum/#!topic/spree-user/Giuh5avHuRo

Related

Error Installing importmap on rails application

I am having troubling setting up an existing rails application. I am supposed to set up importmap but it is giving me trouble.
If having trouble viewing the uploaded pic, it says "rails aborted!
Don't know how to build task 'importmap:install'"
Rails error pic
If I run "rails --tasks" importmap:install does show up.
rails --tasks output snippet
As per the attached screenshot of the task list, the actual task name apparently is called app:importmap:install instead of importmap:install.
I'm not sure why that might be the case, though. It seems to me like you might (accidentally?) be working on a Rails engine instead of an actual app?

NameError: uninitialized constant className

I am getting error in irb
NameError: uninitialized constant Student
for Student.new or whatever model operations are there.
But in rails it gives no error and it works fine. What would be the reason?
This error only happens in Windows, same code I have in Linux and there it works fine.
What makes the difference here?
irb has nothing to do with your rails project.
What you want instead is to run
rails console
from within your rails project directory. Here you have access to everything defined within the application - Rails loads everything automatically.
rails c
Create new tab in terminal. Here you may work with modals. Like CRUD operations.
But make sure your terminal must pointing in rails working directory before trying rails c command ...

What is wrong with my config/routes.rb file?

I'm using the ruby 2.1.2p95 version, and I'm running into some problems following directions to this tutorial (http://tutorials.jumpstartlab.com/projects/blogger.html) on creating a blog.
I followed exactly what the tutorial said, up until the step "Setting up the router." Once I open config/router.rb, the first line in my document is "Rails.application.routes.draw do," not "Blogger::Application.routes.draw do."
The reason I'm asking is in the tutorial on Jump Start Lab, after I continued to the "Creating Template Step," I received a different error message from "Template missing...". I got "Unknown actions...", and eventually, I couldn't view the index page.
I also looked at another tutorial on Youtube (https://www.youtube.com/watch?v=-GQmC-8k09c), and I got the same problem, where the config/router.rb's first line remains the same.
Do you know why this is happening?
Am I supposed to manually change the first line from "Rails.application..." to "[Name of app]::Application.routes.draw do"?
I try with Rails 4.0.4, and it's Blogger::Application.routes.draw do but with rails 4.1.4 it's Rails.application.routes.draw do. I didn't see any news about new router api, so it should be same.
But if you wanna follow tutorial then you can make:
gem uninstall rails
and remove rails 4.1.* then install rails 4.0 with command
gem install rails -v 4.0.8

Error deploying to Heroku using Mongoid

I am getting an error on a view when I move my app to Heroku that I am not getting in development or locally in production mode.
I started with the Devise Mongoid app from railsapp.github.com and added bootstrap.
When I deploy to Heroku I get the following error on the Devise navigation parcial,
ActionView::Template::Error (can't convert Array into String):
Im using Mongoid 3.0.0.rc
I think it's related to Mongoid because I was able to get it work originally with 2.4.10 but now I get other errors with that version.
Also, If I comment out the lines in the parcial where it errors, it loads the root okay but eventually crashes out if I navigate around.
I'm running out of ideas!
I can post logs or configuration files if that would help.
Its known and being worked on.
https://github.com/mongoid/moped/issues/21
Advice downgrading back to what you were using for. 3.0.0.rc is also giving me some heroku issues

NameError: uninitialized constant Object::User

I searched the other posts that had this issue and could not find one that fixed my particular issue. My irb is going crazy. I am trying to change user roles in my database but I can't even get to my users!
irb(main):001:0> User.all
NameError: uninitialized constant Object::User
from (irb):1
from c:/Ruby192/bin/irb:12:in `<main>'
It was working fine, stopped working, was fine, and now stopped again. I have a User model and users added. I cannot pinpoint the issue. Let me know what code you need to see. Thanks!
You should run
ruby script/console # Rails < 3
or
rails c # Rails 3.x
But not (I believe you've just run this)
irb
Make sure you're actually using the rails console command rather than just running irb in your project folder.

Resources