DEV Community

dev.to open source help/discussion thread (v0)

Andy Zhao (he/him) on August 08, 2018

This is the starting point for getting help on any issue relating to working with the dev.to open source project. This thread will act as an FAQ de...
Collapse
 
s_awdesh profile image
Awdesh

I have similar issue running bundle install

bundle install
Your Ruby version is 2.0.0, but your Gemfile specified 2.5.1

only have Ruby 2.5.1 installed.

 ~/.rbenv/versions
❯ ls
2.5.1

I have tried restarting terminal and machine both just to clear cache if there's any.

Collapse
 
rhymes profile image
rhymes

Did you set 2.5.1 as the global version?

According to karloespiritu.github.io/cheatsheet... you need to type: rbenv global 2.5.1, otherwise it uses the default version shipped with the OS

Collapse
 
s_awdesh profile image
Awdesh

Thanks for the cheatsheet. Yes, I have tried rbenv global 2.5.1.

Thread Thread
 
rhymes profile image
rhymes

When you are in the directory of the project, what does rbenv version say?

Thread Thread
 
s_awdesh profile image
Awdesh

rbenv version
2.5.1 (set by /Users/awdesh/Documents/source/sandbox/dev.to/.ruby-version)

I feel like something is messed up with the /etc/paths/ although can't seem to figure it out. I am following this link here-: stackoverflow.com/questions/873067...

Thread Thread
 
andy profile image
Andy Zhao (he/him)

What's the output of ruby -v compared to rbenv version?

Try running rbenv shell 2.5.1 and then running bundle.

If not, a reinstall of 2.5.1 might help:

rbenv uninstall 2.5.1
# restart terminal
rbenv install 2.5.1
# install complete; restart terminal
ruby -v
#=> ruby -v version
rbenv version
#=> rbenv version

Let me know how it goes!

Thread Thread
 
s_awdesh profile image
Awdesh • Edited

Thanks Andy. I did a reinstall of rbenv and ran below.

❯ ruby -v

ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin15]

❯ rbenv version
2.5.1 (set by RBENV_VERSION environment variable)

❯ rbenv shell 2.5.1

still see the same issue.

❯ bundle install
Your Ruby version is 2.0.0, but your Gemfile specified 2.5.1

Thread Thread
 
andy profile image
Andy Zhao (he/him)

Ah, your bundle install might be running from your old Ruby version as opposed to the latest one.

Try running which gem and which bundle. You should be seeing something similar to this output:

which gem
#=> /Users/username/.rbenv/shims/gem
:which ruby
#=> /Users/username/.rbenv/shims/ruby
:which bundle
#=> /Users/username/.rbenv/shims/bundle

If it's different, you'll probably see that bundle or gem are running from different paths than ruby.

Thread Thread
 
s_awdesh profile image
Awdesh • Edited

That did it. Thanks for the tip.

gem and ruby paths were same but bundle. I updated the PATH for bundle gem file using BUNDLE_GEMFILE

export BUNDLE_GEMFILE=/Users/awdesh/.rbenv/shims/bundle

restarted terminal

bundle install  #worked.
Thread Thread
 
andy profile image
Andy Zhao (he/him)

Awesome! Glad to know it worked. From my experience, it's "cleaner" to reinstall your gems per version, but I'm not too sure if it matters too much.

Thread Thread
 
co16353sidak profile image

Hey, I am currently working on some night mode bugs and my work mainly works on editing scss/css files,
nevertheless I want to run a local setup of the application in an attempt to check the changes I am making.
I am having the same error as above only that dev.to required ruby version 2.6.1 but it seems to be picking up 2.3.7 from my system macOS
I have followed all the steps but to no use, I have little to no experience in ruby. could use your help in the same.

Collapse
 
sleeve profile image
Steve Morris

I don't have a ton of ruby experience so I actually ran into what I thought was a problem installing ruby with rbenv. I just wanted to share my experience here in case others run into the same issue.

I started by installing rbenv with homebrew.

~ $ brew install rbenv

No issues, cool. Then I went to install the current ruby version of 2.6.1 in rbenv but it kept hanging on the following line.

~ $ rbenv install 2.6.1
ruby-build: use openssl from homebrew
Downloading ruby-2.6.1.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.1.tar.bz2
Installing ruby-2.6.1...
ruby-build: use readline from homebrew

I kept canceling out of it thinking it was stuck but it was actually building in the background. The installer could use some work giving users some sort of visual feedback that it's actually building. I looked it up and stumbled on to a GitHub issue about it: github.com/rbenv/ruby-build/issues...

One of the comments mentioned that you can actually use the install -v flag when installing with rbenv to get a verbose output of the build process in your terminal. I then ran the following:

~ $ rbenv install -v 2.6.1

And no more hanging on readline! It will fill your terminal window with build logs but at least you know it's working.

Hope this helps someone!

Collapse
 
andy profile image
Andy Zhao (he/him)

Great tip, thanks!

Collapse
 
cathodion profile image
Dustin King • Edited

Here's something I ran into as I'm going through the setup instructions, in case anyone else has the same problem.

When I did gem install bundler, I got this error message:

Fetching: bundler-1.16.5.gem (100%)
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory.

It might have occurred because I uninstalled rvm (using rvm implode ) after installing rbenv.

The fix (found here ) was to add eval "$(rbenv init -)" to my .bash_profile (then do source ~/.bash_profile). After that gem install bundler worked.

Collapse
 
andy profile image
Andy Zhao (he/him)

Awesome, thanks for sharing!

Collapse
 
m760622 profile image
Mohammed Abunada

I found the solution in this site
usabilityetc.com/articles/ruby-on-...

Collapse
 
belverus profile image
Belverus

I can't explain how helpful this is. You saved me from a great amount of trouble. Thank you!

Collapse
 
peter profile image
Peter Kim Frank

Hey Tristan, definitely not a stupid question :)

It's probably a bit early to realistically stand up a fully self-hosted instance of DEV.

If your company is sharing technical content that is for public consumption, you're welcome to set up an organization account on the production site. You can look at Heroku as an example. You never know what might help other users.

@ben will follow up with a bit more info and context.

Collapse
 
ben profile image
Ben Halpern

Yeah, org accounts are the recommended way to go right now, but the instance direction is something we could start working on right away, as long as we’re willing to be patient along the way.

So that area has to be thought of as really theoretical at this point, but being an early adopter of that path could be very powerful, so you are welcome to volunteer to become part of our early group who might start thinking about that use case. Let me know if you’d like me to keep you in the loop.

Collapse
 
itsasine profile image
ItsASine (Kayla)

Does anyone know how to update the built-in version of ruby on Mac?

➜  ~ ruby -v
ruby 2.3.7p456 (2018-03-28 revision 63024) [universal.x86_64-darwin17]
➜  ~ /usr/local/Cellar/ruby/2.5.1/bin/ruby -v
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]

I ended up getting around it by using RubyMine and telling it to use the brew version for the dev.to environment, and then I set up the bin scripts as run configurations.

Since I had ruby 2.5.1 installed, I wasn't terribly inclined to download RVM just so it could download its own version of ruby, too. I just don't think this was the most optimal way of fixing my version issues.

(And as someone who never used postgressql before, that part was not intuative at all... but I have no clue how to fix that in the docs, since I was bumbling my way through it)

Collapse
 
rhymes profile image
rhymes

I use RVM because I have different projects using different versions of Ruby and it's useful for that:

➜  ~ rvm list
   ruby-2.3.0 [ x86_64 ]
   ruby-2.4.3 [ x86_64 ]
=* ruby-2.5.1 [ x86_64 ]

# => - current
# =* - current && default
#  * - default

(And as someone who never used postgressql before, that part was not intuative at all... but I have no clue how to fix that in the docs, since I was bumbling my way through it)

Can you please articulate what issues did you have? I think it's very important because a difficult onboarding can be a turn off for first contributors. Thank you!

Collapse
 
itsasine profile image
ItsASine (Kayla)

My issue was trying to figure out how to articulate it late at night ;)

I think the issues started with completely blowing past the hey you need to install this stuff first section of the README and just starting to get the local build working with stuff like api keys and bundle install. And since I was having issues with the ruby version, I was inclined to think all my issues were around ruby rather than the db.

The biggest thing after needing it installed was needing to have it run before running anything. The installation was lumped with installing things like bundle and yarn which are more hands-off, so it wasn't clear that after installing the prereqs, I should actually start the db and that it wasn't handled in the bin scripts like everything else.

Then I wanted to actually see what was in the db, so I hunted through the configs and internet to see how to find the settings of the db that's created to connect to it within RubyMine.

It wasn't anything really hard or missing, just stuff that wasn't obvious as someone not in the stack.

Collapse
 
andy profile image
Andy Zhao (he/him)

(And as someone who never used postgressql before, that part was not intuative at all...

Ah gotcha, we'll shore that up for the next iteration. What sort of issues are you having right now with it?

Does anyone know how to update the built-in version of ruby on Mac?

Are you using a Ruby version manager? You probably have rbenv or rvm installed.

Collapse
 
itsasine profile image
ItsASine (Kayla)

Are you using a Ruby version manager?

As far as I know, I have not because I'm not a Rubyish person, but I can check once I get home. I knew I brew installed it and would have installed it way back when for brew (since I'm pretty sure brew runs on ruby) but otherwise I don't recall ever doing anything with ruby.

What sort of issues are you having right now with it?

Right now, nothing, since I was eventually able to get local dev.to up and running to get my screenshots for my PR :) Originally, though, since I was only installing it to use dev.to, I didn't:

  1. have it installed (ended up installing it outside of the recommended path since I was trying to solve ruby errors rather than continue reading the readme and find what I skipped over)
  2. have it running (lots of googling eventually found me to where a blog somewhere listed the command to run it)
  3. or how to access it (I loved the seed data scripts but wanted to add a user with specific data to hit my cases... I ended up setting up Github integration to use myself, but eventually figured out how to list known databases and then I could use RubyMine's built-in db handling to modify local data)

Like, reading the section of hey install this stuff didn't really click with me to actually run the database and that it was not a part of the bin scripts.

Thread Thread
 
andy profile image
Andy Zhao (he/him)

Ah gotcha, sorry that wasn't clear! We'll definitely update the instructions for the prerequisites.

And yep, let me know if you still have issues with your Ruby, or anything else really. 🙂

Collapse
 
stephaniekyyip profile image
Stephanie

I'm getting the following error when running bin/setup:

== Preparing database ==
rails aborted!
The following environment variables should be set: ALGOLIASEARCH_API_KEY, ALGOLIASEARCH_APPLICATION_ID, ALGOLIASEARCH_SEARCH_ONLY_KEY.
/usr/local/lib/ruby/gems/2.5.0/gems/envied-0.9.1/lib/envied.rb:38:in `error_on_missing_variables!'
/usr/local/lib/ruby/gems/2.5.0/gems/envied-0.9.1/lib/envied.rb:19:in `require'
/Users/Stephanie/Documents/Github/dev.to/config/application.rb:12:in `<top (required)>'
/Users/Stephanie/Documents/Github/dev.to/Rakefile:4:in `require'
/Users/Stephanie/Documents/Github/dev.to/Rakefile:4:in `<top (required)>'
/usr/local/lib/ruby/gems/2.5.0/gems/railties-5.1.6/lib/rails/commands/rake/rake_command.rb:20:in `block in perform'
/usr/local/lib/ruby/gems/2.5.0/gems/railties-5.1.6/lib/rails/commands/rake/rake_command.rb:18:in `perform'
/usr/local/lib/ruby/gems/2.5.0/gems/railties-5.1.6/lib/rails/command.rb:46:in `invoke'
/usr/local/lib/ruby/gems/2.5.0/gems/railties-5.1.6/lib/rails/commands.rb:16:in `<top (required)>'
/Users/Stephanie/Documents/Github/dev.to/bin/rails:9:in `require'
/Users/Stephanie/Documents/Github/dev.to/bin/rails:9:in `<top (required)>'
/usr/local/lib/ruby/gems/2.5.0/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `load'
/usr/local/lib/ruby/gems/2.5.0/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `call'
/usr/local/lib/ruby/gems/2.5.0/gems/spring-2.0.2/lib/spring/client/command.rb:7:in `call'
/usr/local/lib/ruby/gems/2.5.0/gems/spring-2.0.2/lib/spring/client.rb:30:in `run'
/usr/local/lib/ruby/gems/2.5.0/gems/spring-2.0.2/bin/spring:49:in `<top (required)>'
/usr/local/lib/ruby/gems/2.5.0/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `load'
/usr/local/lib/ruby/gems/2.5.0/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `<top (required)>'
/Users/Stephanie/Documents/Github/dev.to/bin/spring:15:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'
(See full trace by running task with --trace)

== Command ["bin/rails db:setup"] failed ==

But I already added the Algolia keys to config/application.yml:

ALGOLIASEARCH_API_KEY: "myKey"
ALGOLIASEARCH_APPLICATION_ID: "myKey"
ALGOLIASEARCH_SEARCH_ONLY_KEY: "myKey"

It seems like the ENV variables aren't being set, despite changing application.yml. I'm not sure what I'm missing.

Collapse
 
andy profile image
Andy Zhao (he/him)

Hm that's strange. Try these two things:

  1. You're probably doing this correctly already, but make sure you're setting the keys in config/application.yml and not sample_application.yml.
  2. You might be running into a spring error, which is a Rails app preloader. If spring is running, it'll run bin commands for you, but sometimes doesn't refresh when you change things like environment variables. Try turning it off with spring stop and then running bin/setup again.
Collapse
 
stephaniekyyip profile image
Stephanie

Spring wasn't actually running, but I figured out what the issue was.

When I ran git status, it seemed like I accidentally made some changes to config/application.rb. I undid those changes and now bin/setup works.

Thanks for trying to help though!

Thread Thread
 
andy profile image
Andy Zhao (he/him)

Great! Glad it's resolved :)

Collapse
 
delbetu profile image
M Bellucci • Edited

Hello everyone!
I'm trying to write specs for login/signup procedure.
I've inspected the code and came out with these potential scenarios.
Can someone help me to correct, validate, refine these scenarios to met the reality?
(I follow the format ---> )

1 User never login before

create new user
create new identity
update user data
create session
go to welcome page

2 User second login with same provider

find existing user
find existing identity
update user data
create session
go to dashboard

3 User second login with other provider

find existing user
create new identity
update user data
create session
go to dashboard

4 User revoked authorization on twitter, login and re-authorizes

find existing user
find existing identity
update user data
create session
go to dashboard
Error cases ——

5 Twitter doesn’t provide enough information for the user (let’s say uid is nil)

don't create session
go to back to same page
display error message Twitter authorization problem. Try again later

Collapse
 
andy profile image
Andy Zhao (he/him)

Yep, that sounds right. We have a feature test for Twitter auth /spec/features/user_logs_in_with_twitter_spec.rb and some other tests for registration in spec/models/user_spec.rb#270. Those should be helpful for see what else would need coverage.

Collapse
 
delbetu profile image
M Bellucci

Awesome thanks I'll take a look.

Collapse
 
delbetu profile image
M Bellucci

@ben ^ ?

Collapse
 
ben profile image
Ben Halpern

That seems like the right path. @andy can provide more thoughts

Collapse
 
carlymho profile image
Carly Ho 🌈

Hello! I was successfully able to run bin/setup and bin/startup does work and spin up the server, but when I go to the localhost port it tells me, I get a Cannot GET / error. All routes seem to be doing this. Anyone had this problem before? Do I need to input any keys above and beyond the Algolia ones to get the base site to work?

Collapse
 
andy profile image
Andy Zhao (he/him)

Hmm, not sure what that's about. Do you have another server that's connected to localhost:3000? Although if you do, you wouldn't have been able to start up the server.

Could you drop a screenshot of the browser on localhost:3000 and maybe a snippet of the server logs?

Collapse
 
andy profile image
Andy Zhao (he/him) • Edited

OH I think I know what it is. You might have went to localhost:3035 which is running Webpack. It might not be exactly 3035, but it's something similar and is not localhost:3000. localhost:3000 is the port for the backend Rails server, which is the one you want to visit.

Thread Thread
 
carlymho profile image
Carly Ho 🌈

Also, now that I've got it set up, props to whoever on your team likes this book:
to say nothing of the dog

Collapse
 
carlymho profile image
Carly Ho 🌈

oh wait, there we go! I think I did have something else running on 3000—not surprising, since I am always running like five development servers, but I should have double-checked that port was open. Thanks!

Collapse
 
jibrankalia profile image
Jibran Kalia • Edited

When running bin/setup I get the following error:

"2/8 Creating Users"
rails aborted!
Algolia::AlgoliaProtocolError: Cannot reach any host: getaddrinfo: nodename nor servname provided, or not known (1916c2b24231d12082a54f9c2f29efa2.algolia.net:443), getaddrinfo: nodename nor servname provided, or not known (1916c2b24231d12082a54f9c2f29efa2-1.algolianet.com:443), getaddrinfo: nodename nor servname provided, or not known (1916c2b24231d12082a54f9c2f29efa2-2.algolianet.com:443), getaddrinfo: nodename nor servname provided, or not known (1916c2b24231d12082a54f9c2f29efa2-3.algolianet.com:443)
/Users/jibrankalia/.rvm/gems/ruby-2.5.1/gems/algoliasearch-1.19.1/lib/algolia/client.rb:417:in `request'
/Users/jibrankalia/.rvm/gems/ruby-2.5.1/gems/algoliasearch-1.19.1/lib/algolia/client.rb:429:in `put'
/Users/jibrankalia/.rvm/gems/ruby-2.5.1/gems/algoliasearch-1.19.1/lib/algolia/index.rb:516:in `set_settings'
/Users/jibrankalia/.rvm/gems/ruby-2.5.1/gems/algoliasearch-rails-1.20.4/lib/algoliasearch-rails.rb:286:in `block (3 levels) in <class:SafeIndex>'
/Users/jibrankalia/.rvm/gems/ruby-2.5.1/gems/algoliasearch-rails-1.20.4/lib/algoliasearch-rails.rb:321:in `log_or_throw'
/Users/jibrankalia/.rvm/gems/ruby-2.5.1/gems/algoliasearch-rails-1.20.4/lib/algoliasearch-rails.rb:285:in `block (2 levels) in <class:SafeIndex>'
/Users/jibrankalia/.rvm/gems/ruby-2.5.1/gems/algoliasearch-rails-1.20.4/lib/algoliasearch-rails.rb:752:in `algolia_ensure_init'
/Users/jibrankalia/.rvm/gems/ruby-2.5.1/gems/algoliasearch-rails-1.20.4/lib/algoliasearch-rails.rb:595:in `block in algolia_clear_index!'
/Users/jibrankalia/.rvm/gems/ruby-2.5.1/gems/algoliasearch-rails-1.20.4/lib/algoliasearch-rails.rb:593:in `each'
/Users/jibrankalia/.rvm/gems/ruby-2.5.1/gems/algoliasearch-rails-1.20.4/lib/algoliasearch-rails.rb:593:in `algolia_clear_index!'
/Users/jibrankalia/side/dev.to/db/seeds.rb:26:in `<top (required)>'
/Users/jibrankalia/.rvm/gems/ruby-2.5.1/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:286:in `load'
/Users/jibrankalia/.rvm/gems/ruby-2.5.1/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:286:in `block in load'
/Users/jibrankalia/.rvm/gems/ruby-2.5.1/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:258:in `load_dependency'
/Users/jibrankalia/.rvm/gems/ruby-2.5.1/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:286:in `load'
/Users/jibrankalia/.rvm/gems/ruby-2.5.1/gems/railties-5.1.6/lib/rails/engine.rb:549:in `load_seed'
/Users/jibrankalia/.rvm/gems/ruby-2.5.1/gems/activerecord-5.1.6/lib/active_record/tasks/database_tasks.rb:270:in `load_seed'
/Users/jibrankalia/.rvm/gems/ruby-2.5.1/gems/activerecord-5.1.6/lib/active_record/railties/databases.rake:184:in `block (2 levels) in <top (required)>'
/Users/jibrankalia/.rvm/gems/ruby-2.5.1/gems/airbrake-5.8.1/lib/airbrake/rake/task_ext.rb:19:in `execute'
/Users/jibrankalia/.rvm/gems/ruby-2.5.1/gems/railties-5.1.6/lib/rails/commands/rake/rake_command.rb:21:in `block in perform'
/Users/jibrankalia/.rvm/gems/ruby-2.5.1/gems/railties-5.1.6/lib/rails/commands/rake/rake_command.rb:18:in `perform'
/Users/jibrankalia/.rvm/gems/ruby-2.5.1/gems/railties-5.1.6/lib/rails/command.rb:46:in `invoke'
/Users/jibrankalia/.rvm/gems/ruby-2.5.1/gems/railties-5.1.6/lib/rails/commands.rb:16:in `<top (required)>'
/Users/jibrankalia/side/dev.to/bin/rails:9:in `require'
/Users/jibrankalia/side/dev.to/bin/rails:9:in `<top (required)>'
/Users/jibrankalia/.rvm/gems/ruby-2.5.1/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `load'
/Users/jibrankalia/.rvm/gems/ruby-2.5.1/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `call'
/Users/jibrankalia/.rvm/gems/ruby-2.5.1/gems/spring-2.0.2/lib/spring/client/command.rb:7:in `call'
/Users/jibrankalia/.rvm/gems/ruby-2.5.1/gems/spring-2.0.2/lib/spring/client.rb:30:in `run'
/Users/jibrankalia/.rvm/gems/ruby-2.5.1/gems/spring-2.0.2/bin/spring:49:in `<top (required)>'
/Users/jibrankalia/.rvm/gems/ruby-2.5.1/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `load'
/Users/jibrankalia/.rvm/gems/ruby-2.5.1/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `<top (required)>'
/Users/jibrankalia/side/dev.to/bin/spring:15:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'
Tasks: TOP => db:setup => db:seed

Not sure what to do from here.

Collapse
 
andy profile image
Andy Zhao (he/him)

Hey Jibran, looks like you have some error with Algolia. You'll need Algolia API keys in order to run the local server on your machine. See our guide here on how to get it: docs.dev.to/get-api-keys-dev-env/

Collapse
 
jibrankalia profile image
Jibran Kalia

Hey Andy,

Got it to work. Silly setup error on my part. Thanks!

Thread Thread
 
andy profile image
Andy Zhao (he/him)

Gotcha :) Glad it's working!

Collapse
 
shell_brien profile image
Michelle Brien • Edited

Hello,

Trying to setup locally on my machine but running into an error after running bin/setup

"1/8 Creating Organizations"
"2/8 Creating Users"
rails aborted!
ActiveRecord::RecordInvalid: Validation failed: Profile image could not download file: SSL_connect returned=1 errno=0 state=error: certificate verify failed (unable to get local issuer certificate)

Has anyone else come across this before as finding it tricky to debug?

The console also throws this error at end of log

== Command ["bin/rails db:setup"] failed ==

So seems like db issues.. is there anything specific I need to do to set this up? I've just been following the installation steps where it only mentions to have postgresql 9.4 or higher (which I have)

Thanks for any help in advance!

Collapse
 
andy profile image
Andy Zhao (he/him) • Edited

Oh that's a strange error. I can't seem to reproduce it, but I think it might be something with the profile_image_url we're using. It's currently randomly generated by a gem, but feel free to replace it with any other valid image. The only non-standard validation we have for images is that its dimensions have to be less than or equal to 4096x4096.

You can replace line #31 in the seeds.rb file with any URL you'd like:

# current version
remote_profile_image_url: Faker::Avatar.image(nil, "300x300", "png", "set2", "bg2")

# change to anything, like your own dev.to profile pic:
remote_profile_image_url: "https://thepracticaldev.s3.amazonaws.com/uploads/user/profile_image/104515/87d99338-e340-4642-8393-e3731deb5b97.jpg"

# or use random Bill Murray images with 400x400 size:
remote_profile_image_url: Faker::Fillmurray.image(false, 400, 400)

Faker::Fillmurray docs here, if you're so inclined. 😇

Collapse
 
shell_brien profile image
Michelle Brien

Thank you!

Yes that was it, I've now been able to get running using my own profile pic. As happy as I am that it's working now am quite sad I've not been able to use the Bill Murray Faker... 😂

For info I was getting a 'redirect' error

ActiveRecord::RecordInvalid: Validation failed: Profile avatar could not download file: redirection forbidden:

...which seemed like it was expecting https in the url, but I couldn't find an easy way to resolve this.

But all good with a non-Faker url for the profile image 👍

Thread Thread
 
andy profile image
Andy Zhao (he/him)

Awesome, glad it worked! Unfortunate about Bill Murray 🙃

Collapse
 
maqbool profile image
Maqbool

I am getting following error I am not sure what is issue with bcrypt

BCrypt::Errors::InvalidHash in OmniauthCallbacksController#github

Collapse
 
andy profile image
Andy Zhao (he/him)

Hey, when are you hitting this error? We'll need some more context to help you debug. I'm guessing you tried signing in? If you're doing any sign in process, you'll need to setup the appropriate APIs. Instructions here: docs.dev.to/get-api-keys-dev-env/#...

Collapse
 
maqbool profile image
Maqbool

Hi Andy,

I did all the setup required by the docs and still got this error and there is a GitHub issue[1] and same error while populating the database with the initial seeds bin/setup got this error

BCrypt::Errors::InvalidHash: invalid hash

[1] github.com/codahale/bcrypt-ruby/is...

Collapse
 
ben profile image
Ben Halpern

We'll be here for any and all random problems folks run into.

Collapse
 
kreceo profile image
Darrell Lane

Hi,

I have recently been learning python, HTML5 CSS3 and now Javascript for the past 3 months, and so I am quite new to all of this, but I am incredibly driven and passionate about growing and learning new things and more.

I am also new to the community scene, therefore I was hoping someone could help me learn how I can contribute and get to know others who I can work alongside and grow with.

Thanks,

Collapse
 
cathodion profile image
Dustin King • Edited

I've got it running but I get a 401 unauthorized when I try to log in (using the Twitter button).

A page showing login buttons

An error page showing OAuth::Unauthorized

I'm looking to play around with editing posts and comments to look into the stale post/comment issue I've run into (maybe the same as #526, though I haven't had it give me a 404 ), which might require looking into caching stuff.

Collapse
 
andy profile image
Andy Zhao (he/him)

Hmm, did you set up your Twitter OAuth app? Guide here: docs.dev.to/get-api-keys-dev-env/#...

Collapse
 
cathodion profile image
Dustin King

Thanks, I must have skipped that one. I'm now waiting to hear back from Twitter about my applicaiton for an API account.

Thread Thread
 
andy profile image
Andy Zhao (he/him)

Oh hmm that must be new. If you'd rather, you can make a GitHub OAuth app instead. For sign in purposes they're the same.

Collapse
 
tam360 profile image
Mirza

Hey @ben , it's my first time contribution to any open source project. I am trying to setup the project on my machine (rails version 5.2.1) but schema migrations are causing some trouble. Here take a look:

migration issue

Collapse
 
andy profile image
Andy Zhao (he/him)

Hey @mirza, that's a current bug with the migrations since our older migrations are not forward-compatible right now. Since you're setting up for the first time, we recommend using bin/setup to setup your database from scratch. If you've setup your database already with rails db:create or rake db:create (same command), you'll need to drop it first with rails db:drop before running bin/setup.

Collapse
 
tam360 profile image
Mirza

i followed your suggestion and its now working. thanks mate! any advise for a rookie OSS contributor?

Thread Thread
 
andy profile image
Andy Zhao (he/him)

Glad it works! You can check out our issues page and work on any issues with the approved label. There should be enough context in the issue or the comments to get started. Any issues with "good first issue" is also a good start.

For OSS in general, I personally don't have much advice but that's how repo works. We try to adhere to similar standards that the OSS community has, and any feedback along the way will certainly be heard!

Collapse
 
delbetu profile image
M Bellucci

Is anyone else having problems when running the whole suite of tests?

[Zonebie] Setting timezone: ZONEBIE_TZ="Mid-Atlantic"
....**............
1st Try error in ./spec/features/articles/user_edits_an_article_spec.rb:31:
Unable to find field "article_body_markdown"

RSpec::Retry: 2nd try ./spec/features/articles/user_edits_an_article_spec.rb:31
....................................................*................................................................................................................................................................................................................................................................./Users/mbellucci/.rvm/gems/ruby-2.5.3/gems/railties-5.1.6.1/lib/rails/backtrace_cleaner.rb:14: [BUG] Segmentation fault at 0x00007000085e74c0
ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin17]

-- Crash Report log information --------------------------------------------
   See Crash Report log file under the one of following:                    
     * ~/Library/Logs/DiagnosticReports                                     
     * /Library/Logs/DiagnosticReports                                      
   for more details.                                                        
Don't forget to include the above Crash Report log file in bug reports.     

-- Control frame information -----------------------------------------------
c:0180 p:---- s:0982 e:000981 CFUNC  :sub
c:0179 p:0019 s:0976 e:000975 BLOCK  /Users/mbellucci/.rvm/gems/ruby-2.5.3/gems/railties-5.1.6.1/lib/rails/backtrace_cleaner.rb:14 [FINISH]
c:0178 p:0011 s:0972 e:000971 BLOCK  /Users/mbellucci/.rvm/gems/ruby-2.5.3/gems/activesupport-5.1.6.1/lib/active_support/backtrace_cleaner.rb:85 [FINISH]
c:0177 p:---- s:0968 e:000967 CFUNC  :map
c:0176 p:0010 s:0964 e:000963 BLOCK  /Users/mbellucci/.rvm/gems/ruby-2.5.3/gems/activesupport-5.1.6.1/lib/active_support/backtrace_cleaner.rb:85 [FINISH]
Collapse
 
andy profile image
Andy Zhao (he/him)

Yeah, this seems to be an issue for me, too. I wrote a post about it: dev.to/andy/ruby-segmentation-faul...

I didn't think it was anything since I was the only person on our team who could reproduce it for a while. I've also been using our CI as a workaround since that seems to pass properly.

I don't think it's hardware related, but my specs are macOS 10.13.5 on a Macbook Air with a 1.6 GHz i5 and 8 GB 1600 MHz DDR3 RAM.

Collapse
 
jajoosam profile image
Samarth Jajoo

Trying github auth with gitpod and failing 😕

https://gitpod-url.gitpod.io/?error=redirect_uri_mismatch&error_description=The+redirect_uri+MUST+match+the+registered+callback+URL+for+this+application.&error_uri=https%3A%2F%2Fdeveloper.github.com%2Fapps%2Fmanaging-oauth-apps%2Ftroubleshooting-authorization-request-errors%2F%23redirect-uri-mismatch&state=[REDACTED]

Any help would be awesome :)

Collapse
 
andy profile image
Andy Zhao (he/him)

Hey Samarth! To get GitHub auth working, you can follow this guide:
docs.dev.to/backend/auth-github/

The one thing you might need to change is the authorization callback URL in your GitHub OAuth app. I'm not sure how it would work with GitPod though; maybe try matching it to whatever GitPod URL you instead of localhost:3000?

Collapse
 
georgecoldham profile image
George • Edited

Hey, im trying to contribute to issue #3091

Rate limiting new posts for users #3091

Is your feature request related to a problem? Please describe. I occasionally find my feed clogged with posts that I guess are bots? Or users trying to push users off site.

Describe the solution you'd like Rate limit users posts per hour. Perhaps loosen limits for people who have old enough accounts and/or enough post interactions.

Describe alternatives you've considered Creating a bot to filter out any similarly titled articles?

Additional context Example of my latest feed: Screenshot 2019-06-10 at 13 49 14

Examples of users who have been created today and have posted 15+ posts each within the last 40 minutes: Screenshot 2019-06-10 at 13 53 46 Screenshot 2019-06-10 at 13 54 07 Screenshot 2019-06-10 at 13 54 16

Screenshot 2019-06-10 at 14 00 23 Screenshot 2019-06-10 at 14 00 35

Im new to ruby/rails & this codebase and having a couple of issues with identifying the correct place to add new features.

Where I am up to:

I have rate limiting working and it will save a users post instead of publishing it. I am trying to inform the user of this by appending a message in the front end based upon a flag on the Article. Similar to the flag used when informing the user of a saved post (eg. Article.published). but I cannot figure out how to add this parameter to the Article object.

Thanks for any help.

Collapse
 
andy profile image
Andy Zhao (he/him)

Hey George, thanks for working on this. I'm not completely clear on what you mean by "appending a message in the front end based upon a flag on the Article." In my head, you mean the following:

  1. User who has already hit the rate limit hits the publish button
  2. The post is not published but instead saved
  3. User lands on the unpublished post with the red "edit" banner

I think it would make more sense to add error messaging that prevents a user from publishing, and the user will still have click "save draft" instead.

Collapse
 
georgecoldham profile image
George

I had this, although it was recommended against in the pull request. Although it seems there were more issues there.

Collapse
 
gate3 profile image
Doyin Olarewaju 🇳🇬🇨🇦 • Edited

Trying to setup the project for the first time and i keep getting this error when i run bin/setup.

Any help will be greatly appreciated thanks.
@zhao-andy

Collapse
 
andy profile image
Andy Zhao (he/him)

Hmm, do you have your environment variables set up properly, with the correct syntax? Your application.yml should look like this:

SOME_KEY: "some_value_for_api_key"
SOME_KEY: "some_value_for_api_key"
SOME_KEY: "some_value_for_api_key"
SOME_KEY: "some_value_for_api_key"

Make sure you're using double quotes for the values, and that your keys have no quotes. There should also only be a colon and space in between the two.

Collapse
 
gate3 profile image
Doyin Olarewaju 🇳🇬🇨🇦

Thanks that worked

Collapse
 
andypiper profile image
Andy Piper

Long-time reader, first-time poster (on this thread!)

Can anyone help me to understand what the roadmap / design goal / plan is around the external API?

I'm seeing a bunch of specs, some of which explicitly live under /api/v0 and others of which just seem to be available at the root level unversioned. Some of them seem to overlap (github_repos_spec). Some objects like User seem to be "needed" or no-brainer entities on an external API, but are at the top level and unversioned. I'm not really seeing any documentation on this at the moment.

Also, are there any thoughts about adopting or conforming to e.g. OpenAPI or other standard specifications?

In general: big fan of APIs; want to help, advise, contribute; but at the moment I'm fairly confused about what I'm seeing in the codebase and in a few scattered posts where devs have used the current early v0. Would love to understand more about the goals and design intent here!

Collapse
 
theoutlander profile image
Nick Karnik

I was running into an error around gem install pg after bundle install ran for a while.

I followed the instructions here to fix it

Collapse
 
sleeve profile image
Steve Morris

I also ran into an issue during bundle install where pg failed to install.

Fetching pg 1.1.4
Installing pg 1.1.4 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /Users/sleeve/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/pg-1.1.4/ext
/Users/sleeve/.rbenv/versions/2.6.1/bin/ruby -I /Users/sleeve/.rbenv/versions/2.6.1/lib/ruby/2.6.0 -r
./siteconf20190305-63813-1cef7ua.rb extconf.rb
checking for pg_config... no
No pg_config... trying anyway. If building fails, please try again with
 --with-pg-config=/path/to/pg_config

I went with the recommended quick install method for PostgreSQL and just installed the macOS app. It looks like this unfortunately causes an issue in bundle install where it can't find the pg_config file. I tried to follow the instructions in the referenced blog post above but some of the commands are actually written/formatted incorrectly. I was able to find the pg_config file within the app package though.

/Applications/Postgres.app/Contents/Versions/11/bin/pg_config

Once I found that, I ran the following command to get pg installed.

~ $ sudo gem install pg -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/11/bin/pg_config

Then I was able to rerun bundle install and it completed successfully.

Collapse
 
_sumeetm profile image
Sumeet M • Edited

@ben How can I make myself an admin? Is there any separate area for admins?

Collapse
 
andy profile image
Andy Zhao (he/him)

For development, you can add yourself as admin via CLI.

  1. Open up your CLI
  2. Run bin/rails console
  3. Run this one-liner:
User.last.add_role :super_admin # assuming you are the last user
Collapse
 
_sumeetm profile image
Sumeet M

Thanks for the quick reply. I'm thinking of moving my discourse forum to dev.to hosted site.

Can you let me know what are the minimum requirements to host dev.to instance?

I've around 19K users and 20000+ Posts on my discourse forum.

Thread Thread
 
andy profile image
Andy Zhao (he/him)

Ah gotcha. Someone else in this thread asked this question, so I'll link that thread, which includes @ben and @peter 's responses: dev.to/tristan957/comment/4j6g

Thread Thread
 
_sumeetm profile image
Sumeet M

It's not relevant to my question. It's not related to programming its something about a community of founders which is based on discourse.

So I wanted to know the basic requirements to run dev.to hosted environment.

Thanks.

Thread Thread
 
_sumeetm profile image
Sumeet M

@andy @ben can you guys pls reply on this?

Collapse
 
khangtran profile image
Kael Tran

Hi guys,
When i tried to run bin/setup, it throws this error
Alt text of image
I tried to Google but since I have no exp with Ruby so i am kinda clueless.
Thank you

Collapse
 
andy profile image
Andy Zhao (he/him)

Hey Khang, sorry just seeing this now. A few questions:

  • Are you using rbenv as your Ruby version manager? rbenv global should give you a Ruby version.
  • What version Ruby are you running? Run ruby -v to find out. This should match the version given with rbenv global
Collapse
 
jsjlewis96 profile image
Jake Lewis

Hey, I'm looking to start work on

Allow pinning of GitHub organisation projects #243

GitHub Organisation Projects

It would be great if you could pin a GitHub repo from one of your organisations, as well as your personal repositories e.g. I'd like to be able to pin this project on my profile

(on the 13th as I'm still without broadband). Is there anything I need to do outside of the stuff mentioned in getting started? Also, would this make for a decent first issue, as I'm completely new to Ruby on Rails (any good resources would also be cool). Thanks!
Collapse
 
ben profile image
Ben Halpern

I wouldn't say this is a particularly simple first Rails issue but since it's yours I think you have the other insight to make it happen.

Basically in the controller we have this defined:

@client = Octokit::Client.
          new(access_token: current_user.identities.where(provider: "github").last.token)

Octokit is the GitHub Ruby wrapper. It's been around a long time and is well-supported.

From here with @client, we currently call an octokit method to look up repos to display in the settings area.

@client.repositories.each do |repo|
...

I imagine to add the org repos, it'll be a matter of finding out what octokit has for that. Maybe they have a flattened way of finding all the repos, but I imagine it could be about sort of traveling up and down the object tree to get them. Hopefully it can be done efficiently.

Good luck, we can help with any bumps!

Collapse
 
hugoliconv profile image
Hugo

I have an issue running bin/startup

== STARTING UP ==

== Command ["foreman start -f Procfile.dev"] failed ==
Collapse
 
andy profile image
Andy Zhao (he/him)

Hey Hugo, what's the full error message you're getting?

Collapse
 
hugoliconv profile image
Hugo

Thanks for answer quickly. It was my mistake, I forgot to install foreman

Thread Thread
 
andy profile image
Andy Zhao (he/him)

Gotcha, glad you resolved it :)

Collapse
 
ben profile image
Ben Halpern

Perhaps you don’t have your environment variables/keys set up?

Collapse
 
wangonya profile image
Kelvin Wangonya

Hey guys. Does fixing a typo count as a contribution? :)

Collapse
 
andy profile image
Andy Zhao (he/him)

Yeah, based on the URL endpoint you provided it looks like you are missing Stream API keys. See our docs for more info:
docs.dev.to/get-api-keys-dev-env/#...

Collapse
 
stargator profile image
Stargator

Have you given any (and I mean any) thought to using Dart in the future? Whether via AngularDart for the frontend or Dart on the backend?

What about Flutter for Android and iOS apps?

Collapse
 
ben profile image
Ben Halpern

I've played around with Flutter. I don't think it necessarily fits our use cases today, but I am all for keeping an eye on Flutter and Dart as choices for new things in the future. (And possibly for our current native app story, but need to be convinced)

Collapse
 
s_awdesh profile image
Awdesh

1.) Could we create a separate CONTRIBUTING.md file for "How to Contribute" guidelines?

Collapse
 
ben profile image
Ben Halpern

Yeah, I think that makes sense.

Collapse
 
misterhtmlcss profile image
Roger K.

Can I start to assist in this project by helping with items to do with the Roadmap? I see it's pretty scant and I used to do PM work along time ago and while it's not exactly relevant here, I may be able to afford more time to it than is being done now.

Thoughts?

Collapse
 
kmaksim profile image
Maksim Kislyakov

Hi all. Is there any way to hide specific tags from feed? dev.to has "my tags" section, but i don't understand its purpose.

Collapse
 
kmaksim profile image
Maksim Kislyakov

Hey @ben Will you get a notification when i mention you?

Collapse
 
andy profile image
Andy Zhao (he/him)

Hey @gradi , sorry about that. Just seeing your message now. Tags help you build your feed, and the feed provides posts based on the tags and people you follow.

We currently don't have a way to hide specific tags from a feed. It's something that's been suggested before by other people. Feel free to add any additional thoughts in this issue: github.com/thepracticaldev/dev.to/...

Collapse
 
stephaniekyyip profile image
Stephanie

I’m working on the issue below. What’s the best way to better understand how the RSS publishing feature works?

Improve documentation of RSS cross-publication feature #321

Hi! Thanks for the RSS cross-publish feature. Just had a suggestion related to its documentation in the website.

Feature Request or Task

User Story / Description

As a user wanting to cross-publish on DEV, I would like to have a description of how a draft is created from an RSS item so that I can decide whether my feed is correctly formatted for cross-publication.

Definition of Done

  • The tags used to build the draft are documented on the cross publication page in the user settings/profile.
  • If multiple tags are used/tried to pull the content (eg content, summary...), their priority order is documented.
  • Whether drafts support content with markdown content is documented.

Additional Info (device/browser, helpful links)

From Twitter discussion with DEV:

Hey there! Yep, if you put your Markdown as in the tag, it should properly pull in. Alternatively, if you don't want to change your description tag, we look for the content and summary (and description, in that order respectively) tags to pull the body text.

Collapse
 
prathaprathod profile image
Prathap Rathod

Can i make my own dev.to community

Collapse
 
butonix profile image
Butonix

How to make yourself an administrator?

Collapse
 
andy profile image
Andy Zhao (he/him) • Edited

In rails console you can run:

yourself = User.last
# or
yourself = User.find_by_username('butonix')
yourself.add_role :super_admin

Whatcha working on? More context means I can offer more help. :)

Collapse
 
kris profile image
0xAirdropfarmer • Edited

Hey guy MacOS and Ubuntu on digital ocean found this same problem

Collapse
 
andy profile image
Andy Zhao (he/him)

Hey Kris, not sure where you ran into that error. Could you provide some more details about the issue?

From a basic check, it looks like you're running into an issue with our ENV variable checker gem envied. Your application.yml should have key value pairs where the key is all capitals with no quotes and the value should have quotes, like so:

KEY: "value"
GITHUB_KEY: "somethingsomething"
# etc
Collapse
 
ronaldoperes profile image
Ronaldo Peres

Hi,

Can i contribute using Microsoft Windows?

Collapse
 
andy profile image
Andy Zhao (he/him)

Definitely! Check out our installation guide and docs in general: docs.dev.to/installation/windows/

Collapse
 
samyujr profile image
samyujr

Hi,
I would like to know the production release for dev.to. How is the production release cycle like?

Collapse
 
andy profile image
Andy Zhao (he/him)

Hey there, we use Travis as our CI. Someone makes a pull request, it runs through tests, and after a variety of checks (Travis test suite passes, CodeClimate looks okay) and a review, we merge it. Once merged to the master branch, it goes through the CI once again and if it passes, it deploys.